So you mean to say that cimport is not used for reading BAM files?
• 0 views
•
link
I am trying to read BAM file using CYTHON via pysam but was not successful in doing so because of errors that are pasted below with code,
>>> pyximport.install()
(None, <pyximport.pyximport.PyxImporter object at 0x7fc5c0c12ba8>)
>>> import _pysam_flagstat
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named '_pysam_flagstat'
>>> from pysam.calignmentfile cimport AlignmentFile,AlignedSegment
File "<stdin>", line 1
from pysam.calignmentfile cimport AlignmentFile,AlignedSegment
^
SyntaxError: invalid syntax
>>> import cython
>>> from pysam.calignmentfile cimport AlignmentFile,AlignedSegment
File "<stdin>", line 1
from pysam.calignmentfile cimport AlignmentFile,AlignedSegment
^
SyntaxError: invalid syntax
I have installed pysam and cython correctly but don't now I am seeing this error. Is there any solution?
The cython stuff, such as cimport isn't really intended for use in interactive sessions, to me knowledge. That's all for writing modules, which it doesn't appear you're doing. Just use pysam in the normal python manner.
Log in to answer this question.