Undefined variable error in linux
2
0
Entering edit mode
5.0 years ago
karthick.n ▴ 10

Hi,

I am running the following command in Linux for variant filteration:

gatk VariantFiltration -R hg19.fa -V NA12878.gatk.raw.vcf -O NA12878.gatk.raw.flag.vcf -filter “DP < 10.0” --filter-name “LowDP” -filter “QD < 2.0” --filter-name “QD” -filter “MQ < 40.0” --filter-name “MQD” -filter “FS > 60.0” --filter-name “FSsnp” -filter “FS > 200.0” --filter-name “FSindel”

I'm getting the below error for that command:

14:51:41.836 WARN JexlEngine - ![0,2]: 'DP < 10.0;' undefined variable DP 14:51:44.273 WARN JexlEngine - ![0,2]: 'DP < 10.0;' undefined variable DP 14:51:44.569 WARN JexlEngine - ![0,2]: 'DP < 10.0;' undefined variable DP 14:51:45.322 INFO ProgressMeter - chr11:67440041 0.2 362000 2169830.2 14:51:46.801 WARN JexlEngine - ![0,2]: 'DP < 10.0;' undefined variable DP 14:51:48.077 WARN JexlEngine - ![0,2]: 'DP < 10.0;' undefined variable DP 14:51:49.353 WARN JexlEngine - ![0,2]: 'DP < 10.0;' undefined variable DP

The command also generating the output file (filtered vcf file), but has the same number of variants in the input file.

I really don't know what is going wrong. Is that correct syntax for that command? Can anyone of you help me out ?

Thanks in advance!

sequencing seq gatk linux • 3.2k views
ADD COMMENT
1
Entering edit mode
5.0 years ago

check if some variants are missing the DP attribute

grep -v ";DP=" NA12878.gatk.raw.vcf | grep -v "#" | head

if any, it means that your JEXL expression DP < 10.0 will fail because there is no such attribue DP.

ADD COMMENT
0
Entering edit mode

Thanks a lot Mr.Pierre.

Yes. Few of the variants don't have that attribute. Is it because of the improper variant calling? Should I need to do variant calling again? Also, how to remove those variants from the vcf file. Kindly provide your answer.

Thanks in advance! :) Have a great day

ADD REPLY
0
Entering edit mode

hard to answer without knowing how the variants were called.

ADD REPLY
0
Entering edit mode

Hi Sir,

This is the command for variant calling:

gatk HaplotypeCaller -R hg19.fa -I NA12878.sort.mkdup.bam -O NA12878.gatk.raw.vcf --max-alternate-alleles 1

ADD REPLY
0
Entering edit mode

This is the answer. If the INFO attribute is not present for a variant position it will return a WARN it's not an error though. From the gatk forums a staff member said:

The WARN statements simply let you know that the annotation is missing at the site. There is no need to to worry about them, as sometimes an annotation cannot be calculated for a site. As for passing sites without the requested annotation, we do not fail sites unless the annotation values fail the filters. However, you can add this argument to fail those sites :smile:

ADD REPLY
0
Entering edit mode
5.0 years ago
Mark ★ 1.6k

What gatk version are you using? There's a few mistakes but it all depends on the version you're using. The first one I notice is that you might need double dashes for filter eg --filter. The second is that in the latest version of gatk it's actually --filter-name and --filter-expression.

https://software.broadinstitute.org/gatk/documentation/tooldocs/current/org_broadinstitute_hellbender_tools_walkers_filters_VariantFiltration.php

ADD COMMENT
0
Entering edit mode

Hi Amar,

Thanks a lot for your quick response!

I'm using the latest version of gatk (v4.1.4.0) only. Also modified the command based on your input, but still the system throwing the same error. :( . This is the modified command.

gatk VariantFiltration -R hg19.fa -V NA12878.gatk.raw.vcf -O NA12878.gatk.raw.flag.vcf --filter-name "LowDP" --filter-expression "DP < 10.0" --filter-name "QD" --filter-expression "QD < 2.0" --filter-name "MQD" --filter-expression "MQ < 40.0" --filter-name "FSsnp" --filter-expression "FS > 60.0" --filter-name "FSindel" --filter-expression "FS > 200.0"^C

ADD REPLY
0
Entering edit mode

I found the issue. Pierre is correct. We all should read the "error" messages returned!

If you look closely it's not an error but a warning. Look closely at the error:

14:51:41.836 WARN JexlEngine - ![0,2]: 'DP < 10.0;' undefined variable DP 
14:51:44.273 WARN JexlEngine - ![0,2]: 'DP < 10.0;' undefined variable DP 
14:51:44.569 WARN JexlEngine - ![0,2]: 'DP < 10.0;' undefined variable DP 
14:51:45.322 INFO ProgressMeter - chr11:67440041 0.2 362000 2169830.2 
14:51:46.801 WARN JexlEngine - ![0,2]: 'DP < 10.0;' undefined variable DP 
14:51:48.077 WARN JexlEngine - ![0,2]: 'DP < 10.0;' undefined variable DP 
14:51:49.353 WARN JexlEngine - ![0,2]: 'DP < 10.0;' undefined variable DP

You will notice that it's warning you at certain positions within the genome/VCF file the DP INFO is not present. This is normal. In the latest gatk it will warn you if the a filtered INFO value is not present it will return a warning but NOT an error. Your filtering is working fine.

ADD REPLY
1
Entering edit mode

Thanks a lot Amar :) For your responses!

ADD REPLY

Login before adding your answer.

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