Closed GoogleCodeExporter closed 8 years ago
Thanks. The issue is that the iterator object closes after .next().
The solution is to keep an object alive. The following works:
piter = pysam.Samfile("ex1.bam", "rb" ).pileup( 'seq1', 10, 20)
pcolumn = piter.next()
for pread in pcolumn.pileups:
print "read: {0}, base: {1}".format(pread.alignment.qname, pread.alignment.seq[pread.qpos])
I have now created an error that should prevent the segfault and
added some documentation
Best wishes,
Andreas
Original comment by andreas....@gmail.com
on 17 Sep 2013 at 8:09
Original issue reported on code.google.com by
carlos.b...@gmail.com
on 1 Jul 2013 at 3:01