CatVariant does not work.

weini_huangweini_huang LondonMember

Hi there,

do you know why I got this error when I try to use CatVariant ?

java -Xmx10G -jar /Users/xxx/bin/GenomeAnalysisTK-3.5/GenomeAnalysisTK.jar org.broadinstitute.sting.tools.CatVariants \
-V file1.vcf
-V file2.vcf
-o merged.vcf \
-R /Users/xxx/referenceHG19/ucsc.hg19.fasta

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 'org.broadinstitute.gtak.tools.CatVariants' at position 0.
ERROR ------------------------------------------------------------------------------------------

Thank you very much.

Best Answer

Answers

  • SheilaSheila Broad InstituteMember, Broadie, Moderator

    @weini_huang
    Hi,

    Sorry for the late response. It looks like your command is incorrect. Have a look at this thread for help.

    -Sheila

  • @weini_huang Is your issue resolved? I have the same issue. I tried both org.broadinstitute.sting.tools.CatVariants and org.broadinstitute.gtak.tools.CatVariants. I get the same error "Invalid argument value 'org.broadinstitute.sting.tools.CatVariants' at position 0."

    However, this works:
    java -jar GenomeAnalysisTK.jar -T CombineVariants

    Any advise? @Sheila

  • shleeshlee CambridgeMember, Broadie, Moderator

    Hi @fancy1228,

    Sheila is away on vacation still. One of the invocations you tried has a typo: gtak should be gatk.

  • Hi @shlee ,
    Thanks for your quick reply. I also changed the java version from 1.8.0_20 to 1.7.0_67. I got this below. It seems a java version issue. Which java version do you recommend? Thank you.

    Exception in thread "main" java.lang.UnsupportedClassVersionError: org/broadinst itute/gatk/engine/CommandLineGATK : Unsupported major.minor version 52.0

  • shleeshlee CambridgeMember, Broadie, Moderator

    I believe GATKv3.5 uses Java 8 so you should NOT be reverting to 7.

  • Thanks for your help @shlee
    I changed java back to 1.8 and I used gatk3.7. The errors still did not go away. I will use CombineVariants for now, however, if you could help me figure the issue out, that'll be really great. Thanks!

    ERROR A USER ERROR has occurred (version 3.7-0-gcfedb67):
    ERROR MESSAGE: Invalid argument value 'org.broadinstitute.sting.tools.CatVariants' at position 0.
  • shleeshlee CambridgeMember, Broadie, Moderator

    Hi @fancy1228,

    Thanks for posting the error message. It would also be helpful to see the exact command you are using. If you look at CatVariants documentation you will see there is something unconventional in how the tool is called:

    java -cp GenomeAnalysisTK.jar org.broadinstitute.gatk.tools.CatVariants \
        -R reference.fasta \
        -V input1.vcf \
        -V input2.vcf \
        -out output.vcf \
        -assumeSorted
    

    Notice the -cp parameter between java and the jar. Are you following this convention?

  • Hi @shlee,
    I noticed that if I used java -jar GenomeAnalysisTK.jar --help, I could get the help message. However, if I used java -cp GenomeAnalysisTK.jar --help, I got an error below. Any advice? Thank you.

    Unrecognized option: --help
    Error: Could not create the Java Virtual Machine.
    Error: A fatal exception has occurred. Program will exit.

  • shleeshlee CambridgeMember, Broadie, Moderator

    Hi @fancy1228,

    Yes, conventionally, for GATK3, you can see the common arguments with java -jar GenomeAnalysisTK.jar --help. For GATK4, the equivalent command is gatk --help.

    To list the tools with their one-line summaries, the flag is --list.

    To get information on a specific tool, for GATK3 it is java -jar GenomeAnalysisTK.jar -T ToolName --help and for GATK4 it is gatk ToolName --help. The exception occurs for CatVariants. To get the tool specific information, you type java -cp GenomeAnalysisTK.jar org.broadinstitute.gatk.tools.CatVariants --help. Then you'll see something similar to the following:

    -------------------------------------------------------
    Program Name: org.broadinstitute.gatk.tools.CatVariants
    -------------------------------------------------------
    -------------------------------------------------------
    usage: java -jar GenomeAnalysisTK.jar -R <reference> -V <variant> -out <outputFile> [-args <arg_file>] [-assumeSorted] 
           [--variant_index_type <variant_index_type>] [--variant_index_parameter <variant_index_parameter>] [-l <logging_level>] 
           [-log <log_to_file>] [-h] [-version]
    
     -R,--reference <reference>                            genome reference file <name>.fasta
     -V,--variant <variant>                                Input VCF file/s
     -out,--outputFile <outputFile>                        output file
     -args,--arg_file <arg_file>                           Reads arguments from the specified file
     -assumeSorted,--assumeSorted                          assumeSorted should be true if the input files are already sorted 
                                                           (based on the position of the variants)
     --variant_index_type <variant_index_type>             which type of IndexCreator to use for VCF/BCF indices 
                                                           (DYNAMIC_SEEK|DYNAMIC_SIZE|LINEAR|INTERVAL)
     --variant_index_parameter <variant_index_parameter>   the parameter (bin width or features per bin) to pass to the 
                                                           VCF/BCF IndexCreator
     -l,--logging_level <logging_level>                    Set the minimum level of logging
     -log,--log_to_file <log_to_file>                      Set the logging location
     -h,--help                                             Generate the help message
     -version,--version                                    Output version information
    
    

    I hope I've answered your question. Fyi, GATK4 releases today.

  • Hi all,

    I am having a similar issue. I can get the help menu just fine when using java -cp /apps/user/opt/gatk-3.8/GenomeAnalysisTK.jar org.broadinstitute.gatk.tools.CatVariants --help, but when I use java -cp /apps/user/opt/gatk-3.8/GenomeAnalysisTK.jar org.broadinstitute.gatk.tools.CatVariants to try and combine my individual chromosome vcfs into a single file I get the following error:

    Error: Could not find or load main class org.broadinstitute.gatk.tools.CatVariants

    My commands are as follows:

    java -cp /apps/user/opt/gatk-3.8/GenomeAnalysisTK.jar org.broadinstitute.gatk.tools.CatVariants \
    -R /project/WagnerLab/cbrock2/kivu_genomes/kivu_test/reference/puncross.gapsEstimated.fasta \
    --variant kivu.list \
    -nt 6 \
    -o /gscratch/cbrock2/kivu_cichlidFull_SNPs.vcf \
    2>&1 | tee GenoGVCF.Fullsnps.stdout.stderr.txt

    Thanks so much for your help.

    Best,

    Chad

  • Hi all,

    Nevermind, I figured it out. It must've been an errant space or typo. Thanks,

    Chad

Sign In or Register to comment.