Notice:
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.

CommandLineFunction error in Queue

palmeirapalmeira LiegeMember ✭✭

Dear GATK-Team,

I am trying to add non-GATK software to my current Queue pipeline and have been following the Advanced Queue Usage.
However, I get the following error when running my bash script and I don't see where this error is coming from. Do I fail to import a needed library?

INFO  13:40:59,347 QScriptManager - Compiling 1 QScript
ERROR 13:40:59,551 QScriptManager - map.scala:18: not found: type CommandLineFunction
ERROR 13:40:59,555 QScriptManager - class RunBlast extends CommandLineFunction {
ERROR 13:40:59,557 QScriptManager -                        ^

Here is my scala script:

import org.broadinstitute.gatk.queue.QScript
import org.broadinstitute.gatk.queue.extensions.gatk._
class RunBlast extends CommandLineFunction {
  @Input(doc="File to use as query")
  var queryFile: File = _
  @Ouput(doc="File to write output results")
  var blastHits: File = _
  @Argument(doc="BLAST algorithm to use")
  var algorithm: String = "blastn"
  @Argument(doc="Database to query against")
  var database: String = "nt"
  def commandLine = algorithm + " -db " + database + " -query " + queryFile + " -out " + blastHits
}
class ScriptToRunBlast extends QScript {
  def script() {
    val runBlast = new RunBlast
    runBlast.queryFile = new File("mySequence.fasta")
    runBlast.blastHits = new File("blastHits.out")
    add(runBlast)
  }

And my command line invocation:

java -Xmx500M -jar $HOME"/src/Queue-3.2-2/Queue.jar" \
    -S $HOME"/scripts/humanomics/scala/map.scala" \
    -run \
    -startFromScratch

Thanks in advance

Tagged:

Comments

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    I think you need to add an import statement for the CommandLineFunction. We might have forgotten to include it in the doc -- if so, sorry about that. If you are using an IDE like IntelliJ it should suggest the appropriate import.

  • kshakirkshakir Broadie, Dev ✭✭

    import org.broadinstitute.gatk.queue.function._ should work.

  • palmeirapalmeira LiegeMember ✭✭

    Thanks a lot for your help. Adding the following imports fixed three different errors and got my script running:

    import java.io.File
    import org.broadinstitute.gatk.queue.function._
    import org.broadinstitute.gatk.utils.commandline._
    

    Could you point me to the documentation where I could look into in order to debug these myself in the future? For now, I managed to debug this by googling around and adding these imports from other scala scripts because they seemed to make sense to debug my errors.
    I am not using any IDE, I'm just using emacs with scala highlighting.

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    @palmeira Unfortunately our Queue docs are still lagging. The easiest way to debug dependency issues is really to use an IDE, because that will automatically suggest any necessary imports, on top of providing plenty of useful other functions that can save you time. For Java and Scala we really like IntelliJ IDEA, which has a free "community" edition that has all the key features you'd need.

Sign In or Register to comment.