nanopore-scripts
nanopore-scripts copied to clipboard
Issue running expand-cigar.py
Hi,
I'm following the assembly workflow for MinION data presented in this preprint from Nick Loman, Joshua Quick and Jared Simpson. To assess read accuracy, they use your expand-cigar.py and count-errors.py scripts.
I am having problems running expand-cigar.py on my position-sorted BAM file (generated using BWA-MEM with -x ont2d). I using python version 2.7.5.
Here is the error I get:
$ python ../poreathon/analysis/expand-cigar.py --bam pass.fastq.bwa.sorted.bam --fasta ../../data/ReferenceSequence_GBJ02459.1_phagelambda/GBJ02459.1_enterobacteria_phage_lambda_genome.fna >output.txt
Traceback (most recent call last):
File "../poreathon/analysis/expand-cigar.py", line 112, in <module>
main(args)
File "../poreathon/analysis/expand-cigar.py", line 62, in main
curr_chrom_seq = get_chrom(fa, bam.getrname(curr_chrom_id))
File "pysam/calignmentfile.pyx", line 570, in pysam.calignmentfile.AlignmentFile.getrname (pysam/calignmentfile.c:7987)
ValueError: reference_id -1 out of range 0<=tid<1
Do you have any recommendations for a python version, or any dependencies?
Thanks! Kathleen