Tagged with #wrappers
0 documentation articles | 0 announcements | 2 forum discussions

No articles to display.

No articles to display.

Created 2015-02-09 11:59:49 | Updated | Tags: queue scatter-gather wrappers

Comments (3)

Hi guys, I've been trying to do something supposedly simple: i.e. annotating a VCF file with a custom annotation, using Queue with a custom wrapper. I followed the instructions here https://www.broadinstitute.org/gatk/events/3391/GATKw1310-Q-4-Advanced_Queue.pdf However, since I'm working with a VCF file, I thought about distributing better my job(s) by scattering/gathering the input, benefiting of Queue functionality. I thought, following this presentation https://www.broadinstitute.org/gatk/events/3391/GATKw1310-Q-3-Queue_Parallelism.pdf that .scatterCount would be available natively by extending commandLineFunction, but apparently I get a message saying it's not a member of my class.

Would you please suggest how can I scatter/gather a VCF file if I have to process it with a custom wrapper? I haven't found this question answered before, but happy to read elsewhere if it's been already.

This is my script

package org.broadinstitute.gatk.queue.qscripts

import org.broadinstitute.gatk.queue.QScript
import org.broadinstitute.gatk.queue.extensions.gatk._
import org.broadinstitute.gatk.queue.util.QScriptUtils
import org.broadinstitute.gatk.utils.commandline._
import org.broadinstitute.gatk.queue.function.scattergather._
import collection.JavaConversions._

class customAnnotation extends QScript {
  // Create an alias 'qscript' to be able to access variables
  qscript =>

  // Required arguments.  All initialized to empty values.

  @Input(doc="VCF file to be annotated", fullName="vcf", shortName="V", required=true)
  var inVcf: File = _

* definitions of names

    val baseName = swapExt(qscript.inVcf, "vcf", "anno")
    val myOut = new File( baseName + ".customAnno.vcf")
    val annotationOut = new File( baseName + ".parsed.vcf")
    val testFile = new File( baseName + ".TEST")

* CUSTOM annotation as command line

    class MyAnnotation extends CommandLineFunction {

        @Input(doc = "input VCF file")
        val input: File = qscript.inVcf

        @Output(doc = "output VCF file")
        val output: File = qscript.myOut

        this.jobNativeArgs = Seq("--mem=12000")

        this.jobNativeArgs ++= Seq("--time=12:00:00")
        // job name
        override def jobRunnerJobName = "myAnno"

        this.scatterCount = 30

        override def commandLine = required("perl ~/tools/customAnno.pl") +
            required("-i", input) +
            required("-o", output)


* main script

  def script() {

    val myanno = new MyAnnotation



and this is the error I get:

Picked up _JAVA_OPTIONS: -XX:ParallelGCThreads=1
INFO  12:01:38,767 QScriptManager - Compiling 1 QScript 
ERROR 12:01:40,198 QScriptManager - testAnno.scala:56: value scatterCount is not a member of customAnnotation.this.MyAnnotation 
ERROR 12:01:40,200 QScriptManager -         this.scatterCount = 30 
ERROR 12:01:40,200 QScriptManager -              ^ 
ERROR 12:01:40,225 QScriptManager - two errors found 
##### ERROR ------------------------------------------------------------------------------------------
##### ERROR stack trace 
org.broadinstitute.gatk.queue.QException: Compile of /home/lescai/pipeline/annotation/testAnno.scala failed with 2 errors
    at org.broadinstitute.gatk.queue.QScriptManager.loadScripts(QScriptManager.scala:79)
    at org.broadinstitute.gatk.queue.QCommandLine.org$broadinstitute$gatk$queue$QCommandLine$$qScriptPluginManager$lzycompute(QCommandLine.scala:95)
    at org.broadinstitute.gatk.queue.QCommandLine.org$broadinstitute$gatk$queue$QCommandLine$$qScriptPluginManager(QCommandLine.scala:93)
    at org.broadinstitute.gatk.queue.QCommandLine.getArgumentSources(QCommandLine.scala:230)
    at org.broadinstitute.gatk.utils.commandline.CommandLineProgram.start(CommandLineProgram.java:205)
    at org.broadinstitute.gatk.utils.commandline.CommandLineProgram.start(CommandLineProgram.java:155)
    at org.broadinstitute.gatk.queue.QCommandLine$.main(QCommandLine.scala:62)
    at org.broadinstitute.gatk.queue.QCommandLine.main(QCommandLine.scala)
##### ERROR ------------------------------------------------------------------------------------------

thanks for helping an inexperienced .scala user :) Francesco

Created 2012-12-28 07:08:02 | Updated 2013-01-07 19:14:29 | Tags: developer python wrappers

Comments (5)

Hi all,

Wouldn't it be useful to have GATK wrapped into a Python API? pygatk. As pysam is for samtools or pybedtools is for bedtools. Is anybody developing this?

Regards, Pablo.