Error reading variable into GaTK command

Hi
I'm trying to use a variable (JXL below) within my GaTK command in the JEXL select line, so I can make my script generic. But I get an error. I don't understand why.

Command:
java -Xmx${MEM} -jar ${gatk_dir}/GenomeAnalysisTK.jar -R ${genome} \
-T SelectVariants \
-L ${CHROM} \
--variant ${data_dir}/"6_"${SAMPLE_ABB}"HC_flagged"${CHROM}".vcf" \
-selectType SNP \
--restrictAllelesTo BIALLELIC \
-select ${JXL} \
-ef \
-o ${data_dir}/"7_"${SAMPLE_ABB}"HC_filterd_forBQSR"${CHROM}".vcf"

The Variable
SM_BAM=$1
P1="'vc.getGenotype("
P2='"'
P3=").getGQ() > 20'"
JXL=${P1}${P2}${SM_BAM}${P2}${P3}

If I do echo $JXL I get this:
JXL='vc.getGenotype("Sample10006").getGQ() > 20'

The error:

ERROR ------------------------------------------------------------------------------------------
ERROR A USER ERROR has occurred (version 3.5-0-g36282e4):
ERROR
ERROR This means that one or more arguments or inputs in your command are incorrect.
ERROR The error message below tells you what is the problem.
ERROR
ERROR If the problem is an invalid argument, please check the online documentation guide
ERROR (or rerun your command with --help) to view allowable command-line arguments for this tool.
ERROR
ERROR Visit our website and forum for extensive documentation and answers to
ERROR commonly asked questions http://www.broadinstitute.org/gatk
ERROR
ERROR Please do NOT post this error to the GATK forum unless you have really tried to fix it yourself.
ERROR
ERROR MESSAGE: Invalid argument value '>' at position 14.
ERROR Invalid argument value '20'' at position 15.
ERROR ------------------------------------------------------------------------------------------

This however works:
java -Xmx${MEM} -jar ${gatk_dir}/GenomeAnalysisTK.jar -R ${genome} \
-T SelectVariants \
-L ${CHROM} \
--variant ${data_dir}/"6_"${SAMPLE_ABB}"HC_flagged"${CHROM}".vcf" \
-selectType SNP \
--restrictAllelesTo BIALLELIC \
-select 'vc.getGenotype("Sample10006").getGQ() > 20' \
-ef \
-o ${data_dir}/"7_"${SAMPLE_ABB}"HC_filterd_forBQSR"${CHROM}".vcf"

Tagged:

Best Answer

Answers

  • prepagamprepagam Member

    Sorry to clear, if I do echo $JXL I get:
    'vc.getGenotype("Sample10006").getGQ() > 20'

Sign In or Register to comment.