Enable global workflow variables inside tasks
open | Created 2017-07-30 | Last updated 2019-02-21| Posted by antonkulaga | See in Github


Needs Triage User Requested Improvement WDL Developer Joy


As far as I remember, in the Past it was possible to reference global workflow variables inside a task. But now I get wdl validation errors like this:

ERROR: Variable genome does not reference any declaration in the task (line 36, col 27):

    curl -z ${folder}"/"${genome} --max-time 10 --retry 3 --retry-delay 1 ${genomeURL}
                          ^

Task defined here (line 26, col 6):

task download_genome {

Here is the wdl

workflow indexes {

  File genomesFolder
  String version #release version
  String species #species and also name of the index/


  String releaseURL #path to releseas


  String transcriptome #relative file name (.fa.gz)
  String genome #relative file name (.fa.gz)
  String annotation #relative annotation file name (.gtf)


    call download_genome  {
    input:
         genomeURL = releaseURL + "/" + genome,
         transcriptomeURL = releaseURL + "/" + transcriptome,
         annotationURL = releaseURL + "/" + annotation,
         folder = genomesFolder + "/" + species + "/" + version
    }

}

task download_genome {

  String genomeURL
  String transcriptomeURL
  String annotationURL
  String folder


  command {
    mkdir -p ${folder}
    curl -z ${folder}"/"${genome} --max-time 10 --retry 3 --retry-delay 1 ${genomeURL}
    curl -z ${folder}"/"${transcriptome} --max-time 10 --retry 3 --retry-delay 1 ${transcriptomeURL}
    curl -z ${folder}"/"${annotation} --max-time 10 --retry 3 --retry-delay 1 ${annotationURL}
  }

}

Return to top