ValueError: error during iteration "Pysam"

682 views Asked by At

I have ran into this error and I am having trouble resolving it. Here is it what I get:

Traceback (most recent call last):
 File "afile.py", line 100, in <module>
   for col in bam.pileup( chrm, ps1, ps1+1,truncate=True):
 File "pysam/calignmentfile.pyx", line 2060, in pysam.calignmentfile.IteratorColumnRegion.__next__
  (pysam/calignmentfile.c:23305)
 ValueError: error during iteration

Thanks a lot in advance.

1

There are 1 answers

0
ryan On

i hit this recently. the root cause in my case was that the .bai bam index file was out of date. after i regenerated it with samtools index XXX.bam, the pysam crash went away.