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

Variable set in workflow as workflow output

ahakoneahakone Member, Broadie

Hi,

I am trying to set a File set within the workflow (File optional_output in example below) as the workflow output.

task atask {
  File? i
  output {
    File output_file = i
  }
}

workflow w {
  File? optional_file
  File other_file

  if (defined(optional_file)) {
    call atask {
      input: 
        i = optional_file
    }
  }

  File optional_ouput = if (defined(atask.output_file)) then select_first([atask.output_file]) else other_file

  output {
    File w.atask.output_file = optional_output
  }
}

But I get a "Unable to load namespace from workflow: ERROR: Unexpected symbol (the . in w.atask.output_file)" and "Workflow input processing failed" error.

I think I can do something like the solution posted here https://gatkforums.broadinstitute.org/wdl/discussion/9810/dynamically-change-workflow-output-based-on-conditional but I'd like to avoid it if possible since I'd like to keep the workflow output type to be a File and also to be named specifically "w.atask.output_file".
Thanks.

Tagged:

Best Answer

Answers

  • ahakoneahakone Member, Broadie

    I wanted to maintain that naming convention because that's how the other outputs are formatted (e.g., btask.* becomes "btask.output_file": "gs://some_cloud_path") and another script runs through the outputs of the workflow. But it turned out that the script doesn't care about the naming convention so this solution works, thanks.

Sign In or Register to comment.