Referencing output of a sub workflow in a workflow

alongaloralongalor Member
edited September 2017 in Ask the Cromwell + WDL Team

I was wondering if it is possible to reference the output of a sub workflow in a workflow without explicitly defining the output of the sub workflow in the "optional" outputs section of the sub workflow definition.

Providing an example below (code attached):

jointCallingGenotypes.wdl is a workflow that calls a sub workflow, jointCallingGenotypesPerSample.wdl. When the output of the sub workflow is not defined in the "optional" outputs section of the sub workflow definition (jointCallingGenotypes_No_Output_Def.zip below), I get the following error:

[[email protected] Dependencies]$ $java -jar $wdltool validate ./jointCallingGenotypes.wdl
ERROR: Call output not found: Call 'jointCallingGenotypesPerSample' doesn't have an output 'Merged_GVCF' (line 47, col 44).

      GVCFs=jointCallingGenotypesPerSample.Merged_GVCF
                                           ^

Options:
 - Add the output 'Merged_GVCF' to 'jointCallingGenotypesPerSample'.
 - Modify the member access (on line 47) to use an existing output (current outputs of 'jointCallingGenotypesPerSample': 'MergeVCFs.Merged_GVCF', 'HaplotypeCallerERC.GVCF').

As specified in the helpful error message above, I have two options to fix this: "Add the output 'Merged_GVCF' to 'jointCallingGenotypesPerSample'" or "Modify the member access (on line 47) to use an existing output".

The first option works. When I explicitly define the output of the sub workflow in the "optional" outputs section of the sub workflow definition (jointCallingGenotypes_Success.zip below) there are no complaints from the validate tool:

[[email protected] Dependencies]$ $java -jar $wdltool validate ./jointCallingGenotypes.wdl

However, I could not find any information in the documentation or on the forum on how to execute the second option. After removing the explicit definition the output in the sub workflow, I tried to reference the output as shown below without success:

[[email protected] Dependencies]$ $java -jar $wdltool validate ./jointCallingGenotypes.wdl
ERROR: Expression will not evaluate (line 47, col 54):

      GVCFs=jointCallingGenotypesPerSample.MergeVCFs.Merged_GVCF
                                                     ^

Any help with how to execute this second option would be much appreciated.

Thanks,

Alon

Best Answer

Answers

Sign In or Register to comment.