Detection nucleotide changes in VCF file
1
0
Entering edit mode
3.9 years ago
stan.aanhane ▴ 30

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 • 904 views
ADD COMMENT
1
Entering edit mode
3.9 years ago
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
ADD COMMENT
0
Entering edit mode

It works perfectly! Thank you!

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 2007 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6