Dear all I've a big problem with samtools mpileup since I am trying to retriving base counts and indel but fails to locate indels. More in particular, it seems that INDELs are shifted by one position (i.e. if the deletion is located at position 2, samtools gives me that is at position 1).
I've tryied bam-readcount to do the same task and it calls INDEL at the right position (after check it with IGV).
What I've tryied so far is:
- Using different samtools versions: nothing changes
- Using different machines: nothing changes
I would like to ask you if it is a well known bug that others found or it's just me.
I know that I could pharse the output with awk shifting indels, but I prefer not to "touch" data in that sense. Thank you in advance for your help
Please add the command line, an example of the VCF and the evidence that made you think the indel is shifted (=reproducible example).
I didn't produce a .vcf, but a .tab file with counts.
RIGHT output of bam-readcount
samtools WRONG parsed
The point is that also the mpileup file reports the deletions at position chr1:27105518 (so the code is parsing correctly compared to readcount) but when I open the .bam file on IGV it's clear that the deletion is in position 27105519 as reported by readcount
Hello,
the output you are showing doesn't look like the mpileup format. Please show us all commands that lead to this output.
Which version of samtools are you using?
Also please note, that
samtools mpileup
is deprecated. Instead usebcftools mpileup
.fin swimmer
I thank you in advance for your precious hepl! I handle the .mpileup file with an already tested perl script (https://github.com/riverlee/pileup2base/blob/master/pileup2baseindel.pl ). Before parsing the .mpileup I made sure that the script worked well and everything was good exept for deletions. I need to you samtools instead of bcftools since i need to count % of nucleoides for each position and it seems that this is the fastest way. I've tryied samtools 0.1.19, 0.1.18, 1.3 and 1.9 and ALL gave me same bug with ALL the deletions were shifted. Count and insertion positions are still ok.
To rule out that this perl script is the problem, can you please show the exact command line for
mpileup
and its raw output for the position. It is very unlikely that samtools is reporting incorrect indel positions given how established it is and the number of users running it to scan for SNVs for almost a decade now.The command is the following:
bam-readcount reports that the deletion is at position 27105519 (according to IGV), but samtools says that it is at position 27105518 The output of the .mpileup is the following:
I cut the output ...