thanks, could you provide a small bam-file that would replicate
the problem. Please also send the pysam and samtools version and
I will have look.
Pileup in pysam is a bit shaky as I am no using it myself. There
is some read-filtering going in within samtools that I have hoped to
have emulated in pysam, but probably incompletely. It is also based on
some deprecated code within samtools and is really asking for a
re-write.
Best wishes,
Andreas
thanks for bringing this up. Samtools pileup replicates the old
and now deprecated samtools pileup functionality. I don't know
enough about mpileup to comment on the differences right now
(probably different read processing/filtering). Implementing
mpileup is on our todo list.
Best wishes,
Andreas
With pileup the output of samtools and pysam are
consistent:
samtools pileup -r chr3:50050800-50050810 test.bam | awk '$2 >= 50050799
&& $2 <= 50050809 { print $1"\t"$2"\t"$4 }'
chr3 50050799 2182
chr3 50050800 2182
chr3 50050801 2182
chr3 50050802 2182
chr3 50050803 2182
chr3 50050804 2182
chr3 50050805 2182
chr3 50050806 2182
chr3 50050807 2182
chr3 50050808 2182
chr3 50050809 218