To celebrate the release of GATK 4.0, we are giving away free credits for running the GATK4 Best Practices pipelines in FireCloud, our secure online analysis portal. It’s first come first serve, so sign up now to claim your free credits worth $250. Sponsored by Google Cloud. Learn more at https://software.broadinstitute.org/firecloud/documentation/freecredits

Why is only one call allowed for a task even when different arguments are used?

mmahmmah Member, Broadie

I am trying to collect the output from a scatter operation's jobs into a single directory, similarly to this question. Each scattered job outputs two files, so I want to save two arrays of files while gathering. I wrote a single task and called it twice, once to save each array, but WDL validation does not like this: ERROR: Two or more calls have the same name for copy_output. Why is it an error to call the same task twice but with different inputs? This makes it difficult to reuse WDL code.

scatter(sam in demultiplex.demultiplexed_sam){
    call sort{ input: 
        picard_jar = picard_jar,
        unsorted = sam
    }
    call deduplicate{ input:
        picard_jar = picard_jar,
        sorted = sort.sorted,
        sample_id = sort.id
    }
}
call copy_output{ input:
    files = deduplicate.deduplicated,
    output_path = output_path
}
call copy_output{ input:
    files = deduplicate.statistics,
    output_path = output_path
}
task copy_output{
    Array[File] files
    String output_path

    command{
        mkdir -p ${output_path};
        for file in ${sep=' ' files}  ; do 
            cp -l $file "${output_path}"
        done
    }
}

Best Answer

Answers

Sign In or Register to comment.