This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Detection nucleotide changes in VCF file

Hi,

I have a small question. I just started to work with bash and i want to count the amount of specific mutations my file has.

So for example; A >>> T

Not al the mutations but just one mutation on its own, compared to the reference genome.

The file I use is an VCF-file

Thank you in advance!

mutation linux vcl next-gen alignment

1 answer

bcftools view --no-header -i 'REF=="A" && ALT=="T" ' input.vcf | wc -l

or using awk

awk -F '\t'  '($4=="A" && $5=="T" && !($0 ~ /^#/))' input.vcf | wc -l

If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one answer if they all work.

Upvote|Bookmark|Accept

Log in to answer this question.