Feature request: Global variables

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, Moderator, 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.