0
$\begingroup$

I tried to add a "gather_results" task to a workflow that takes in an array of Files and moves output files to a new folder of a specified name.

Cannot interpolate Array[File?]+ into a command string with attribute set wdl PlaceholderAttributeSet(None,None,None,Some( ))]

The wdl file passes womtools and I have no idea what a PlaceholderAttributeSet is, which makes debugging quite difficult.

--

gather files task

task gather_result{
  input{
    String dir
    String? subDir
    Array[File?]+ files
  }

  command
  {
    mkdir --parents ${dir}/${default="" subDir}; /bin/mv -t ${dir}/${default="" subDir} ${sep=" " files}
  }
  runtime
  {
    docker_image: "pipeline"
    memory: "2 GB"
  }
  output
  {
    String out = stdout()
  }
}

How it's called:

  call gather_result as gather_files {
      input: files=[create_hic.output_hic[1],
                    dedup.deduped_bam,
                    calculate_stats.stats[0],
                    calculate_stats.stats_hists[0],
                    calculate_stats.stats_json[0]],
            dir=OutputDir
    }

$\endgroup$
2
  • $\begingroup$ WDL can be a pain. Try and simplify it (reduce input complexity by adding one piece of files at a time). Wil need trial and error. Drop the ? if U can. Check all input types. One might need a flatten. $\endgroup$ Jul 17, 2021 at 21:13
  • $\begingroup$ If I drop the ? I get a womtools error saying wld can't interpolate Array[File]+ to Array[File?]+ $\endgroup$ Jul 19, 2021 at 3:26

1 Answer 1

1
$\begingroup$

I think you'll need to convert your Array[File?]+ to a Array[File] before you can use ~{sep=" " files} in the command section.

You can use the select_all function for that, which will only keep valid files.

https://github.com/openwdl/wdl/blob/main/versions/development/SPEC.md#arrayx-select_allarrayx

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.