This is a test version of Biostars. For the public version, visit https://www.biostars.org.
calculate mismatch rate from VCF file

I want to calculate the mismatch rate on base-level, I notice that the information in VCF file may help.

##INFO=<ID=DP4,Number=4,Type=Integer,Description="Number of high-quality ref-forward , ref-reverse, alt-forward and alt-reverse bases">

Question: can I use (alt-forward + alt-reverse) / (ref_forward + ref-reverse + alt-forward + alt-reverse) to get the mismatch rate?

PS: in my case, the mismatch means one bases convert into the other, the insertion or deletion is not included

Thank you in advance!

mismatch-rate vcf

1 answer

I want to calculate the mismatch rate on base-level,

samtools stats in.bam | grep "error rate" | cut -f 2,3

error rate: 2.032389e-02

Thank you for your reply!! My bad. I didn't mention that I want to get the mismatch rate for each site. Is this error rate for each site?

I was using it but the output file was too big, so that I thought the vcf file was more efficient. But now I know that I can stop working on vcf file and turn to mpileup again. Thank you so much~~

I was using it but the output file was too big

pipe the output

Log in to answer this question.