Question on SnpSift Filter
1
0
Entering edit mode
4.9 years ago
lawrence.hsu ▴ 10

I've have been trying to filter a vcf to pull out the first annotation from the ANN field but it keeps returning the whole thing.

This is the code I have been using:

java -jar SnpSift.jar filter "ANN[0]" input.vcf

The extractfield command works fine so the program is able to identify the first ANN.

SNP software error • 2.6k views
ADD COMMENT
2
Entering edit mode
4.9 years ago
Shicheng Guo ★ 9.4k

I think the correct way should be:

java -jar SnpSift.jar filter "ANN[0]=="xxx"" input.vcf

You didn't set the value to ANN[0], therefore, it always return all the SNPs. check this example:

java -jar  ~/hpc/tools/snpEff/SnpSift.jar filter "ANN[0].EFFECT has 'missense_variant'" All_samples_Exome_QC.DG5.clean.vcf.recode.ANN.vcf > All_samples_Exome_QC.DG5.clean.vcf.recode.ANN.missense.vcf

If you want to select 'High' impact variants, the following command should works:

java -jar  ~/hpc/tools/snpEff/SnpSift.jar filter "ANN[0].IMPACT has 'HIGH'" All_samples_Exome_QC.DG5.clean.vcf.recode.ANN.vcf > All_samples_Exome_QC.DG5.clean.vcf.recode.ANN.HIGH.vcf

if you want to select "High" + "AF<0.2", you can try the following script:

java -jar /gpfs/home/guosa/hpc/tools/snpEff/SnpSift.jar filter "(ANN[0].IMPACT has 'HIGH')&& (AF< 0.2)" All_samples_Exome_QC.chr21.vcf.DR2L0.8.DG.snpEff.vcf > All_samples_Exome_QC.chr21.vcf.DR2L0.8.DG.snpEff.High.vcf
ADD COMMENT
0
Entering edit mode

So what would you set ANN[0] to if you want the first annotation?

ADD REPLY
0
Entering edit mode

The first annotation is changeable. You can set ANN[0].ALLELE, ANN[0].EFFECT, ...

ADD REPLY

Login before adding your answer.

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