benedictpaten / marginAlign

UCSC Nanopore
MIT License
42 stars 13 forks source link

MarginStats "string index out of range" #25

Closed noncodo closed 7 years ago

noncodo commented 7 years ago

marginStats --mismatchesPerAlignedBase MarginAlign_em_bwa_pass2D_merged.sam pass_2d_merged.fastq ../RefSeq.fasta

Traceback (most recent call last): File "/Users/martinsmith/apps/marginAlign/src/margin/marginStats.py", line 97, in <module> main() File "/Users/martinsmith/apps/marginAlign/src/margin/marginStats.py", line 70, in main referenceFastaFile, globalAlignment=not options.localAlignment) File "/Users/martinsmith/apps/marginAlign/src/margin/utils.py", line 379, in getReadAlignmentStats refSequences[sam.getrname(aR.rname)], aR, globalAlignment), samIterator(sam)) File "/Users/martinsmith/apps/marginAlign/src/margin/utils.py", line 379, in <lambda> refSequences[sam.getrname(aR.rname)], aR, globalAlignment), samIterator(sam)) File "/Users/martinsmith/apps/marginAlign/src/margin/utils.py", line 308, in __init__ for aP in AlignedPair.iterator(alignedRead, self.refSeq, self.readSeq): File "/Users/martinsmith/apps/marginAlign/src/margin/utils.py", line 274, in iterator if aP.getReadBase().upper() != alignedSegment.query_alignment_sequence[readPos].upper(): IndexError: string index out of range

mitenjain commented 7 years ago

Sorry for the hassle. This error seems like a resultant from a missing space or newline character in reference fasta. Could you check if the reference fasta file has a newline at the end?

Also, if you could send me (miten@soe.ucsc.edu) a toy set of reads and your reference, that will help me reproduce the error at our end and resolve it quickly.