Entering edit mode
7.2 years ago
ammarsabir15
▴
70
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?
So you mean to say that cimport is not used for reading BAM files?
It's not directly used in python interactive sessions to do so. One instead does
import pysam
.