Heads up:
We’re moving the GATK website, docs and forum to a new platform. Read the full story and breakdown of key changes on this blog.
Update: July 26, 2019
This section of the forum is now closed; we are working on a new support model for WDL that we will share here shortly. For Cromwell-specific issues, see the Cromwell docs and post questions on Github.

How to generate Array[File] output of variable size?

markwmarkw Cambridge, MAMember, Broadie, Dev admin

I have a task that returns an Array[File] whose size is set by an input integer, like this:

task MyTask {
  Int size
  String dollar = "$" #workaround to access bash variables, see issue #1819
  command <<<
    for i in {0...${size}}; do
      echo "This is file ${dollar}{i}" > ${dollar}{i}.txt
      echo "${dollar}{i}.txt" >> output_files.txt
    done
  >>>
  output {
    Array[File] files = read_lines("output_files.txt")
  }
}

Using Cromwell 30 with JES, "output_files.txt" gets delocalized to the bucket instead of the actual files 0.txt, 1.txt, 2.txt, etc. Is this intentional behavior or a bug? Is there any other way to approach this problem?

Thank you.

Best Answer

Answers

Sign In or Register to comment.