-
-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scatter before a when occurs #1668
Comments
https://www.commonwl.org/v1.2/Workflow.html#Scatter/gather tells us that "upstream parameters which are connected to scattered parameters must be arrays" but I can only reproduce your bug when the https://www.commonwl.org/v1.2/Workflow.html#Conditional_execution_(Optional) tells us that the So with CWL v1.2, to skip based upon an input being missing when that input is also being scattered over requires nesting the scatter in a sub workflow. illumina_quality_kraken2:
label: Kraken2
doc: Taxonomic classification of FASTQ reads
when: $(inputs.kraken_database !== null)
in:
tmp_id: identifier
identifier:
valueFrom: $(inputs.tmp_id)_Qfiltered
threads: threads
kraken_database: kraken_database
database: kraken_database
forward_reads: phix_filter/out_forward_reads
reverse_reads: phix_filter/out_reverse_reads
paired_end:
default: true
run:
class: Worflow
inputs:
identifier: string # a guess at the type
threads: int # a guess at the type
kraken_database: File[] # replace with the real type
forward_reads: Any # replace with the real type
reverse_reads: Any # replace with the real type
paired_end: bool
steps:
kraken2:
run: ../kraken2/kraken2.cwl
scatter: database
in:
identifier: identifier
threads: threads
kraken_database: kraken_database
database: kraken_database
forward_reads: forward_reads
reverse_reads: reverse_reads
paired_end: paired_end
out: [sample_report]
outputs:
sample_report:
type: File[] # replace with the real type
out: [sample_report] |
Another workaround would be if the workflow input |
Expected Behavior
We are using a when to check if a variable is given to a workflow or not to execute a specific step.
When this variable (a String[]) we apply a
when: $(inputs.kraken_database !== null)
check to see if this variable is given. In addition we apply a scatter on this variable to run it for each of the elements.Actual Behavior
It tries to perform the scatter before the when is processed.
Workflow Code
Your Environment
/usr/local/bin/cwltool 3.1.20220224085855
The text was updated successfully, but these errors were encountered: