Filter variants by specific base change pattern
1
0
Entering edit mode
7.2 years ago

I would like to filter a VCF file by specific base change e.g. C>T & G>A. It seems that VCFtools does not allow this kind of filter. Does anyone has any idea?

Thanks heaps

SNP • 1.7k views
ADD COMMENT
1
Entering edit mode
7.2 years ago

using VCFfilterJs: https://github.com/lindenb/jvarkit/wiki/VCFFilterJS

java -jar dist/vcffilterjs.jar  -e 'variant.getReference().getDisplayString().equals("A") && variant.getAlternateAlleles().size()==1 && variant.getAlternateAlleles().get(0).getDisplayString().equals("C")' input.vcf

or just awk:

awk -F '\t' '($0 ~/^#/ || ($4=="A" && $5=="C"))' input.vcf
ADD COMMENT
0
Entering edit mode

Is there is a documentation for the functions used in the filtering variant.getReference().getDisplayString() Or how to decide which argument (function/s) to pass to -e

ADD REPLY

Login before adding your answer.

Traffic: 3314 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