If you happen to see a question you know the answer to, please do chime in and help your fellow community members. We encourage our fourm members to be more involved, jump in and help out your fellow researchers with their questions. GATK forum is a community forum and helping each other with using GATK tools and research is the cornerstone of our success as a genomics research community.We appreciate your help!

Test-drive the GATK tools and Best Practices pipelines on Terra

Check out this blog post to learn how you can get started with GATK and try out the pipelines in preconfigured workspaces (with a user-friendly interface!) without having to install anything.

Unable to run SVPreprocess. Java cannot find the main class


I'm sure this is obvious but I can't seem to find my bug. I have been trying to execute the commands as listed in the documentation for our data but I am thwarted at every turn.

Here are the steps I have taken.
1) Download and decompress the latest-n-greatest release of genomeStrip (svtoolkit_2.00.1774.tar.gz)

2) Ensure that the java classpath includes the genomeSTRiP directory and the necessary dependencies.

export GS=$HOME/apps/svtoolkit
export CLASSPATH=".:$GS/lib:$GS/lib/depend:$GS/lib/gatk:$GS/lib/SVToolkit.jar:$GS/lib/gatk/Queue.jar"

3) Execute the SVPreprocess command

java -Xmx8g -cp $CLASSPATH org.broadinstitute.gatk.queue.QCommandLine \
  -S $GS/qscript/SVPreprocess.q \
  -S $GS/qscript/SVQScript.q \
  -cp $CLASSPATH \
  -gatk GenomeAnalysisTK.jar \
  -configFile $GS/conf/genstrip_parameters.txt \
  -R /data/hs37d5.fa \
  -tempDir /tmp \
  -md metadata \
  -genomeMaskFile $HOME/apps/masks/Homo_sapiens_assembly19.mask.101.fasta \
  -genderMapFile $GS/conf/ \
  -I $HOME/data/align.2017-12-14/bams/SAFID_abc1.recal.bam

I continue to get this error message:
Error: Could not find or load main class org.broadinstitute.gatk.queue.QCommandLine

I'm not sure what I'm doing wrong here.
Can anyone help me out?


Best Answer


  • bhandsakerbhandsaker Member, Broadie ✭✭✭✭

    I have always found this to be one of the hardest things to debug when using java - there is little to point you to what the underlying problem is.

    I don't think your classpath is right. I use just:
    export SV_CLASSPATH="${SV_DIR}/lib/SVToolkit.jar:${SV_DIR}/lib/gatk/GenomeAnalysisTK.jar"
    java -cp ${SV_CLASSPATH} ...
    and this works fine for me. You can also test by removing all of the other arguments, then ensure you are getting past loading the main class (you will get an error about missing required arguments).

  • dfermindfermin USMember
    Accepted Answer

    Thanks bhandsaker! That seems to have worked for me.
    Don't really understand what I was doing wrong but using your classpath string worked for me after I set $SV_DIR

  • bhandsakerbhandsaker Member, Broadie ✭✭✭✭

    Glad it worked.
    The main problem was that you didn't have GenomeAnalysisTK.jar on the classpath.

  • dfermindfermin USMember

    That's what I didn't get I guess. I specified the path where that jar lived and assumed java would "see it".

Sign In or Register to comment.