I'm trying to track down a strange behavior we recently noticed using pysam's pileup function. We are trying to find SNPs at specific positions. Depending on how we call the pileup function, we get different results.
If we do the call like this:
we get one set of reads.
If we call it like this:
We get a completely different set of reads (some overlap, but not much). From my reading of the source, I can't find any reason why the results should be different. Or even which set of reads is correct. Has anyone else ever seen this?
Thanks
pysam: 0.4.1
samtools: 0.1.12a (pysam embedded)
If we do the call like this:
Code:
for p in bamfile.pileup(): if p.pos == MYPOS: #assume only one reference/chromosome in bam file for read in p: print read.alignment.qname
If we call it like this:
Code:
for p in bamfile.pileup(chrom,pos,pos+1): if p.pos == MYPOS: for read in p: print read.alignment.qname
Thanks
pysam: 0.4.1
samtools: 0.1.12a (pysam embedded)
Comment