Below is a simple workflow that conditionally creates an index file for a FASTA reference file before using it as an input to a CWL tool.
#!/usr/bin/env bash
if ! [ -f data/reference.fa.sa ]; then
bwa index data/reference.fa
fi
for sample in samples; do
bwa mem data/reference.fa $sample > outputs/$sample.sam
done
# we have limited storage space so we
# cleanup indices once we are done
rm -f data/reference.fa.*
The step in this script that creates an index is in a conditional. In the beginner tutorial this script is presented without the conditional but this gives us an opportunity to introduce conditional steps in the intermediate tutorial.
Below is a simple workflow that conditionally creates an index file for a FASTA reference file before using it as an input to a CWL tool.
The step in this script that creates an index is in a conditional. In the beginner tutorial this script is presented without the conditional but this gives us an opportunity to introduce conditional steps in the intermediate tutorial.
Here is an example workflow using conditional:
where the input can either be:
or (if the index is pre-computed)