Hi GATK Users,

Happy Thanksgiving!
Our staff will be observing the holiday and will be unavailable from 22nd to 25th November. This will cause a delay in reaching out to you and answering your questions immediately. Rest assured we will get back to it on Monday November 26th. We are grateful for your support and patience.
Have a great holiday everyone!!!

GATK Staff

Usage of WDL objects and the read_objects function

Hi! I recently started trying out cromwell and was having trouble trying out the read_objects feature of the WDL specification. I created this example WDL (x-test.wdl) :

task hello {
    Object SampleAttrs
    String sample = SampleAttrs.sample
    String bamPath = SampleAttrs.bamPath

    command {
        /bin/echo "Sample: ${sample} | Bam: ${bamPath}"

    output {
        File response = stdout()

workflow xtest {
    Array[Object] AllSampleAttrs = read_objects("./multi-attributes.tsv")

    scatter (attrs in AllSampleAttrs) {
        call hello { input:

with the following multi-attributes.tsv file:

sample  bamPath attr1   attr2   attr3
smpl-1  /path/to/sample1.bam    a       b       c
smpl-2  /path/to/sample2.bam    d       e       f
smpl-3  /path/to/sample3.bam    g       h       i

and ran the WDL as follows:

java -jar cromwell-0.20-e5901ff-SNAPSHOT.jar run x-test.wdl - - xtest.meta.json

and got an error like so:

Unable to load namespace from workflow: ERROR: Variable does not reference any declaration in the task (line
3, col 33):

    String sample = SampleAttrs.sample

Am I interpreting and using the WDL Object specification type and read_objects function incorrectly?


Best Answer


Sign In or Register to comment.