Skip to content
Snippets Groups Projects
Commit 66c50d9b authored by Ruben Vorderman's avatar Ruben Vorderman
Browse files

fix logic and formatting

parent 4f983c44
No related branches found
No related tags found
No related merge requests found
......@@ -70,15 +70,24 @@ task Cutadapt {
then "mkdir -p $(dirname " + read2output + ")"
else ""
# FIXME: This crappy overengineering can be removed once cromwell can handle subworkflow inputs correctly.
# Some WDL magic here to set both adapters with one setting.
# If then else's are needed to keep the variable optional and undefined
Array[String]+? adapterForward = if (defined(adapter) || defined(adapterBoth)) then select_first([adapter, adapterBoth]) else adapter
# Assume adapterRead2 will not be set when read2 is not set.
Array[String]+? adapterReverse = if defined(read2) then select_first([adapterRead2, adapterBoth]) else adapterRead2
Array[String]+? adapterForward = if (defined(adapter) || defined(adapterBoth))
then select_first([adapter, adapterBoth])
else adapter
# Check if read2 is defined before applying adapters.
Array[String]+? adapterReverse = if (defined(read2) && (defined(adapterRead2) || defined(adapterBoth)))
then select_first([adapterRead2, adapterBoth])
else adapterRead2
# Same for contaminations
Array[String]+? anywhereForward = if (defined(anywhere) || defined(contaminations)) then select_first([anywhere, contaminations]) else anywhere
Array[String]+? anywhereReverse = if defined(read2) then select_first([anywhereRead2, contaminations]) else anywhereRead2
Array[String]+? anywhereForward = if (defined(anywhere) || defined(contaminations))
then select_first([anywhere, contaminations])
else anywhere
Array[String]+? anywhereReverse = if (defined(read2) && (defined(anywhereRead2) || defined(contaminations)))
then select_first([anywhereRead2, contaminations])
else anywhereRead2
command {
set -e
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment