Question: SnpSift command query
0
gravatar for prasundutta87
2.3 years ago by
prasundutta87330
prasundutta87330 wrote:

Hi,

I wish to exclude all the variants in a vcf file where the first snpeff annotation is either intron_variant or 'splice_acceptor_variant&intron_variant or 'splice_region_variant&intron_variant' or 'splice_donor_variant&intron_variant.

Now the command that does NOT work is:

java -jar SnpSift.jar filter "(ANN[0].EFFECT != 'intron_variant')|(ANN[0].EFFECT !='splice_acceptor_variant&intron_variant')|(ANN[0].EFFECT !='splice_region_variant&intron_variant')|(ANN[0].EFFECT != 'splice_donor_variant&intron_variant')" final_result.vcf >final_result_no_introns.vcf

The above command works when I replace '|' with '&&'.

Is this a software issue or I am not understanding the usage of the logical operators in SnpSift correctly?

snp software error • 1.4k views
ADD COMMENTlink modified 2.3 years ago by Robert Sicko570 • written 2.3 years ago by prasundutta87330
1
gravatar for Pierre Lindenbaum
2.3 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum120k wrote:

try '||' (OR operator) instead of '|' (bitwise inclusive OR operator)

ADD COMMENTlink written 2.3 years ago by Pierre Lindenbaum120k

Thank you for the suggestion. I used it just now. No filtering was performed on my input file..furthermore the operator '&&' doing the job does not make sense. Is there a catch somewhere that I am missing?

ADD REPLYlink modified 2.3 years ago • written 2.3 years ago by prasundutta87330
1
gravatar for Robert Sicko
2.3 years ago by
Robert Sicko570
United States
Robert Sicko570 wrote:

&& makes sense if you are using annotation !=

you want to keep variants where the first annotation != 'intron_variant' AND first annotation != 'splice_acceptor_variant&intron_variant' AND first annotation != 'splice_region_variant&intron_variant' AND first annotation != 'splice_donor_variant&intron_variant'

= left with variants where first annotation != any of the above

ADD COMMENTlink written 2.3 years ago by Robert Sicko570

Actually since | is the OR operator, if any one condition is TRUE, then only filtering will take place.

When && or AND operator is used, it means that if all the conditions are TRUE together, only then filtering will take place. Since, one variant willl have only one effect in the first annotation, I used '|'.

ADD REPLYlink modified 2.3 years ago • written 2.3 years ago by prasundutta87330

Right, but I believe snpsift filter keeps variants that pass the specified condition(s) rather than filter variants that do not pass the specified condition(s). Look at the examples given on the snpsift filter documentation page

ADD REPLYlink written 2.3 years ago by Robert Sicko570
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 811 users visited in the last hour