I'm doing samtools mpileup snp calling but samtools is not including reads that are improperly paired or mates unmapped when I examine the snps using the bam file. Due to the nature of the reference I have I want to turn this behavior off. Turning quality scores filters for base and reads do not have an effect. Any ideas how to do this, or a snp caller that can set to include reads that are improperly paired to the snp calling process?
samtools mpileup -I -q 20 -Q 20 -DSuf Triticum_aestivum.IWGSP1.21.dna.genome.fa A6_P33_Triticum_aestivum.IWGSP1.20.dna.genome_novo_H15_t60.sort.rmdup.bam C6_P33_Triticum_aestivum.IWGSP1.20.dna.genome_novo_H15_t60.sort.rmdup.bam D3_P33_Triticum_aestivum.IWGSP1.20.dna.genome_novo_H15_t60.sort.rmdup.bam| bcftools view -bvcg - > A6C6D3_P33_Triticum_aestivum.IWGSP1.20.dna.genome_novo_H15_t60.sort.rmdup.bcf
bcftools view A6C6D3_P33_Triticum_aestivum.IWGSP1.20.dna.genome_novo_H15_t60.sort.rmdup.bcf | ./vcfutils.pl varFilter -D100 > A6C6D3_P33_Triticum_aestivum.IWGSP1.20.dna.genome_novo_H15_t60.sort.rmdup.vcf
Thanks Andreas for such a great answer.
So just to check I understand correctly if I want it to include anomalous read pairs I use the -A option and delete "&& (b->core.flag&1) && !(b->core.flag&2)" to remove the skipping of improperly paired reads?
Yes you are right. You may have to do "make samtools" again in order for that change to take place.
Thanks a lot, should be a big help.
No sorry, that's not what I wanted to say. Just specifying -A is enough to include orphan reads!
It worked by doing what I said but if same can be done just with the -A option, would be more reproducible for others, I'll check it thanks.
My bad. I thought you asked to change the code. But the code was for the purpose of explaining the parameter.