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 https://software.broadinstitute.org/firecloud/documentation/freecredits

Feature request: Global variables

ppanteliadppanteliad BostonMember, Broadie

After spending some time trying to make GATK Best Practices to run on my server, I noticed that the main reason for my struggle was: the paths to my tools {GenomeAnalysisTK.jar, samtools, bwa, etc...}

Since these tools are used throughout the pipeline multiple times, wouldn't it be useful(and more user friendly) if we could declare the tools in the inputs.json like the input files and not have to go through the entire wdl to change everything.

something like this:

String samtools
String bwa


workflow myWorkflow {

        call print1
        call print2

}





task print1 {
        command{
                echo "${samtools}"
                echo "${bwa}"
        }

}


task print2{
        command {
                echo "${samtools}"
                echo "${bwa}"
        }
}
Tagged:

Best Answer

Answers

  • ChrisLChrisL Cambridge, MAMember, Broadie, Dev
    edited April 2017

    You will still need to pass the variables in as inputs to the tasks though. There's no global variables in WDL. Something like (NB samtools --version might not be a valid samtools command!):

    workflow myWorkflow {
      String samtools
      call printVersion { input: samtools = samtools }
    }
    
    task printVersion {
      String samtools
      command{
        ${samtools} --version
      }
    }
    
Sign In or Register to comment.