Closed mullinyu closed 6 years ago
I can't see the version number of pysam. Could you execute the following command to check the version of pysam:
pip freeze | grep pysam
You can also check the version with
import pysam pysam.__version__
Also see #24 .
Probably you have the same version problem.
I'm using Nanopore to sequence long reads and then use minimap2 to align to human genome. I got the following exception when run NanoSV with BAM file generated.
Exception: Wed May 16 17:08:46 2018 Busy with calculating the coverage distribution... Wed May 16 17:32:04 2018 Busy with parsing bam file... Traceback (most recent call last): File "/home/kitsanyeung/.local/lib/python3.5/site-packages/nanosv/NanoSV.py", line 64, in
main()
File "/home/kitsanyeung/.local/lib/python3.5/site-packages/nanosv/NanoSV.py", line 52, in main
utils.parse_bam.parse_bam()
File "/nfs/home/kitsanyeung/.local/lib/python3.5/site-packages/nanosv/utils/parse_bam.py", line 46, in parse_bam
read = r.Read(line.query_name, line.infer_read_length())
AttributeError: 'pysam.libcalignedsegment.AlignedSegment' object has no attribute 'infer_read_length'
I checked the pysam document: infer_read_length(self) infer read length from CIGAR alignment. This method deduces the read length from the CIGAR alignment including hard-clipped bases. Returns None if CIGAR alignment is not present.
I checked the version of pysam used. Python 3.5.1 (default, Feb 28 2017, 11:00:48) [GCC 4.6.4] on linux Type "help", "copyright", "credits" or "license" for more information.
Any ideas/suggestions?