Entering edit mode
6.1 years ago
Click downvote
▴
720
I have the following code, where I want to type a:
for a in samfile:
flag = a.flag
is_reverse = flag & 0x10
....
It should have the type AlignedSegment from https://github.com/pysam-developers/pysam/blob/master/pysam/libcalignedsegment.pxd because that seems to be the type of a:
In [25]: a
Out[25]: <pysam.libcalignedsegment.AlignedSegment at 0x7f7fc5e53588>
When I use
from pysam.libcalignedsegment cimport AlignedSegment
I get the error
read_bam.cpp:618:28: fatal error: htslib/kstring.h: No such file or directory
compilation terminated.
I understand this means that it cannot find htslib when compiling. However pysam works so I guess it is me just cimporting pysam in the wrong way.
To be clear, I want to type a so I get no overhead:
cdef AlignedSegment a
What do I import?
How did you test it ?
What is the command line and the output of your pysam installation ?
I am able to run
and it works :)
Export
LIBRARY_PATH
before starting Jupyter.This is a problem when I try to compile a Cython project.
echo $LIBRARY_PATH
is empty, btw.I know it's empty, you need to set it appropriately.