To celebrate the release of GATK 4.0, we are giving away free credits for running the GATK4 Best Practices pipelines in FireCloud, our secure online analysis portal. It’s first come first serve, so sign up now to claim your free credits worth $250. Sponsored by Google Cloud. Learn more at

Error with my HaplotypeCaller scala script

TsunamiTsunami ChinaMember
edited September 2016 in Ask the GATK team

Hi everyone,

I'm trying to run HaplotypeCaller through Queue because it really took a long time for HaplotypeCaller to finish one job. I've already read about some examples and forums to start on my firsr scala script, but it didn't work. This is the gatk HaplotypeCaller command line that works fine:

java -jar /home/yangxx/software/GATK-3.5/GenomeAnalysisTK.jar -T HaplotypeCaller \
-R /home/yangxx/hg38bundle/Homo_sapiens_assembly38.fa \
-I /home/yangxx/PIH/GATK-rerun/PHPR0003_L5_I333-NewBatch2/BQSRrecal.bam \
-dontUseSoftClippedBases -U ALLOW_N_CIGAR_READS -stand_call_conf 20.0 -stand_emit_conf 20.0 -ERC GVCF -nda \
-o /home/yangxx/PIH/GATK-rerun/PHPR0003_L5_I333-NewBatch2/HaplotypeCaller.1.g.vcf 

And I try to rewrite it to scala script for Queue, showed as below:

package org.broadinstitute.gatk.queue.qscripts

import org.broadinstitute.gatk.utils.ValidationExclusion
import org.broadinstitute.gatk.queue.QScript
import org.broadinstitute.gatk.queue.extensions.gatk._

class HaplotypeCallerCommand extends QScript {

  @Input(doc="Bam file to genotype.", shortName="I",required=true)
  var bamFile: Seq[File] = _

  @Input(doc="The reference file for the bam files.", shortName="R",required=true)
  var referenceFile: File = _

  @Argument(doc="Type for common command GATK --unsafe parameter",shortName="U")
  var Unsafe: TYPE = _

  def script{
    var HaCaller = new HaplotypeCaller
    HaCaller.input_file = bamFile
    HaCaller.reference_sequence = referenceFile
    HaCaller.out = new File("/home/yangxx/PIH/GATK-rerun/PHPR0003_L5_I333-NewBatch2/HaplotypeCaller.g.vcf")
    HaCaller.dontUseSoftClippedBase = true
    HaCaller.unsafe = Unsafe
    HaCaller.annotateNDA = true
    HaCaller.standard_min_confidence_threshold_for_calling = 20.0
    HaCaller.standard_min_confidence_threshold_for_emitting = 20.0
    HaCaller.emitRefConfidence  = GVCF

I ran Queue dry run like this:
java -jar Queue.jar -S test.scala -I /home/yangxx/PIH/GATK-rerun/PHPR0003_L5_I333-NewBatch2/BQSRrecal.bam -R /home/yangxx/hg38bundle/Homo_sapiens_assembly38.fa -do true -U ALLOW_N_CIGAR_READS

And Error report like this:
INFO 20:33:50,145 QScriptManager - Compiling 1 QScript
ERROR 20:34:05,024 QScriptManager - test.scala:20: not found: type TYPE
ERROR 20:34:05,026 QScriptManager - var Unsafe: TYPE = _
ERROR 20:34:05,027 QScriptManager - ^
ERROR 20:34:05,369 QScriptManager - test.scala:27: value dontUseSoftClippedBase is not a member of org.broadinstitute.gatk.queue.extensions.gatk.HaplotypeCaller
ERROR 20:34:05,370 QScriptManager - HaCaller.dontUseSoftClippedBase = true
ERROR 20:34:05,371 QScriptManager - ^
ERROR 20:34:05,404 QScriptManager - four errors found

ERROR ------------------------------------------------------------------------------------------
ERROR stack trace

org.broadinstitute.gatk.queue.QException: Compile of test.scala failed with 4 errors
at org.broadinstitute.gatk.queue.QScriptManager.loadScripts(QScriptManager.scala:79)
at org.broadinstitute.gatk.queue.QCommandLine.getArgumentSources(QCommandLine.scala:229)
at org.broadinstitute.gatk.utils.commandline.CommandLineProgram.start(
at org.broadinstitute.gatk.utils.commandline.CommandLineProgram.start(
at org.broadinstitute.gatk.queue.QCommandLine$.main(QCommandLine.scala:61)
at org.broadinstitute.gatk.queue.QCommandLine.main(QCommandLine.scala)

ERROR ------------------------------------------------------------------------------------------
ERROR A GATK RUNTIME ERROR has occurred (version 3.5-0-g36282e4):
ERROR This might be a bug. Please check the documentation guide to see if this is a known problem.
ERROR If not, please post the error message, with stack trace, to the GATK forum.
ERROR Visit our website and forum for extensive documentation and answers to
ERROR commonly asked questions
ERROR MESSAGE: Compile of test.scala failed with 4 errors
ERROR ------------------------------------------------------------------------------------------

INFO 20:34:06,239 QCommandLine - Shutting down jobs. Please wait...

Thanks for any kindly answer and help !

Issue · Github
by Sheila

Issue Number
Last Updated
Closed By


Sign In or Register to comment.