gatk Hardfilter Error
1
0
Entering edit mode
10 months ago
bestone ▴ 30

Hello, I run the code but I got the Error. Could you pls help me with this issue? How can I fix it?

 gatk VariantFiltration
  -R reference. fasta
  -V input.vcf
  --filter-expression "FILTER == 'PASS' && (QUAL < 30.0 || QD < 2.0 || FS > 60.0 || MQ < 40.0 || MQRankSum < -12.5 || ReadPosRankSum < -8.0)"
  --filter-name "FILTER_NAME"
  -O filtered.vcf
hardfilter • 1.7k views
ADD COMMENT
0
Entering edit mode

A USER ERROR has occurred: Argument output was missing: Argument 'output' is required.


Set the system property GATK_STACKTRACE_ON_USER_EXCEPTION (--java-options '-DGATK_STACKTRACE_ON_USER_EXCEPTION=true') to print the stack trace. zsh: command not found: -R zsh: command not found: -V zsh: command not found: --filter-expression zsh: command not found: -O

ADD REPLY
1
Entering edit mode

the formatting is missing in your question. how do you break lines ? did you add a antislash at the end of the lines ? didn't you forgot the last antislash before your option -O ?

ADD REPLY
0
Entering edit mode

Actually, I didn't forget, I added it, I tried, then I removed it, but I still got an error.

ADD REPLY
1
Entering edit mode

show us the very complete command line, including the antislash, including the error.

ADD REPLY
0
Entering edit mode
gatk VariantFiltration \
   -R reference.fasta \
   -V input.vcf.gz \
   -O output.vcf.gz \
   --filterExpression "AB < 0.2 || MQ0 > 50" \
   --filterName "my_filters"
/Users/uguremre/opt/anaconda3/bin/gatk:80: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if len(args) is 0 or (len(args) is 1 and (args[0] == "--help" or args[0] == "-h")):
/Users/uguremre/opt/anaconda3/bin/gatk:80: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if len(args) is 0 or (len(args) is 1 and (args[0] == "--help" or args[0] == "-h")):
/Users/uguremre/opt/anaconda3/bin/gatk:117: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if len(args) is 1 and args[0] == "--list":
/Users/uguremre/opt/anaconda3/bin/gatk:301: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if call(["gsutil", "-q", "stat", gcsjar]) is 0:
/Users/uguremre/opt/anaconda3/bin/gatk:305: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if call(["gsutil", "cp", jar, gcsjar]) is 0:
/Users/uguremre/opt/anaconda3/bin/gatk:458: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if not len(properties) is 0:
/Users/uguremre/opt/anaconda3/bin/gatk:462: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if not len(filesToAdd) is 0:
Using GATK jar /Users/uguremre/opt/anaconda3/share/gatk4-4.0.5.1-0/gatk-package-4.0.5.1-local.jar
Running:
    java -Dsamjdk.use_async_io_read_samtools=false -Dsamjdk.use_async_io_write_samtools=true -Dsamjdk.use_async_io_write_tribble=false -Dsamjdk.compression_level=2 -jar /Users/uguremre/opt/anaconda3/share/gatk4-4.0.5.1-0/gatk-package-4.0.5.1-local.jar VariantFiltration -R reference.fasta -V input.vcf.gz -O output.vcf.gz --filterExpression AB < 0.2 || MQ0 > 50 --filterName my_filters

USAGE: VariantFiltration [arguments]

Edited by GenoMax : Remainder of message was redacted since it was a print-out of in-line help for this tool.

ADD REPLY
0
Entering edit mode

A USER ERROR has occurred: filterExpression is not a recognized option


Set the system property GATK_STACKTRACE_ON_USER_EXCEPTION (--java-options '-DGATK_STACKTRACE_ON_USER_EXCEPTION=true') to print the stack trace.

ADD REPLY
1
Entering edit mode

A USER ERROR has occurred: filterExpression is not a recognized option

This is the only important message here.

Are you copying and pasting this command from a document? in macOS?

ADD REPLY
0
Entering edit mode

so how can I fix it?

ADD REPLY
1
Entering edit mode

Are you copying and pasting this command from a document? in macOS? Looks like something in your command is not being recognized as a proper option (hyphens or quotes).

ADD REPLY
0
Entering edit mode
ADD REPLY
1
Entering edit mode

This may sound odd but can you turn-off "smart quotes and dashes" option in System Preferences and then type the hyphens and quotes in command by hand?

ADD REPLY
0
Entering edit mode

I tried it but unfortunately, still not working

ADD REPLY
1
Entering edit mode

Are you getting the same error or has that changed?

ADD REPLY
0
Entering edit mode

yes the same error

ADD REPLY
1
Entering edit mode

Have you re-typed every hyphen, quote and = (including one in middle of --filter-expression_?

ADD REPLY
0
Entering edit mode

Yes I re-typed the manual

ADD REPLY
1
Entering edit mode

Can you take out the --filter-expression option and see if the command works?

ADD REPLY
0
Entering edit mode

it worked when I remove it

ADD REPLY
1
Entering edit mode

That goes to show that there is something incorrect about the option in your command line. You will need to fix that.

ADD REPLY
0
Entering edit mode

The example given in the documentation is wrong, the parameters are --filter-expression and --filter-name as listed below, not --filterExpression. I parameter names might have changed between versions and the example hasn't been updated" Michael replied below. I changed them. It. worked thank you so much for your help.

ADD REPLY
1
Entering edit mode

I guess you changed the command in the original post since?

I moved @Michael's comment to an answer. You can accept it (green check mark) to provide closure to this thread.

ADD REPLY
1
Entering edit mode
10 months ago
Michael 54k

The example given in the documentation is wrong, the parameters are --filter-expression and --filter-name as listed below, not --filterExpression. Parameter names might have changed between versions and the example hasn't been updated.

ADD COMMENT
0
Entering edit mode

Thank you so much it worked:)

ADD REPLY

Login before adding your answer.

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