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.
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 withsamtools index XXX.bam
, the pysam crash went away.