From 00fa74c216e589dae0998b6beb58a356f0991da0 Mon Sep 17 00:00:00 2001
From: Dominik Brilhaus <brilhaus@nfdi4plants.org>
Date: Wed, 19 Mar 2025 15:00:20 +0100
Subject: [PATCH] improve logic to gather output directories from kallisto
 scatter step

---
 .cwl/cwl-plots/runs/kallisto.svg              |  10 +++++-----
 .cwl/cwl-plots/workflows/kallisto.svg         |  10 +++++-----
 arc.cwl                                       |   4 ++--
 .../isaSampleToRawDataSeq/rnaseq-samples.xlsx | Bin 7183 -> 7184 bytes
 runs/isaSampleToRawDataSeq/run.cwl            |  13 ++++++++++---
 runs/kallisto/run.cwl                         |   8 ++++----
 workflows/isaSampleToRawDataSeq/workflow.cwl  |   8 ++++++--
 ...d-dirInDestination.cwl => gather-dirs.cwl} |   6 +++---
 workflows/kallisto/kallisto-quant.cwl         |   2 +-
 workflows/kallisto/workflow.cwl               |  13 ++++++-------
 10 files changed, 42 insertions(+), 32 deletions(-)
 rename workflows/kallisto/{yield-dirInDestination.cwl => gather-dirs.cwl} (64%)

diff --git a/.cwl/cwl-plots/runs/kallisto.svg b/.cwl/cwl-plots/runs/kallisto.svg
index 45f69bc..241535b 100644
--- a/.cwl/cwl-plots/runs/kallisto.svg
+++ b/.cwl/cwl-plots/runs/kallisto.svg
@@ -109,15 +109,15 @@
 <path fill="none" stroke="black" d="M79.18,-185.43C89.76,-174.74 104.84,-161.76 121,-155 157.69,-139.66 267.22,-133.56 330.49,-131.27"/>
 <polygon fill="black" stroke="black" points="330.73,-134.77 340.61,-130.93 330.49,-127.77 330.73,-134.77"/>
 </g>
-<!-- finalOut -->
+<!-- kallistoOutDir -->
 <g id="node9" class="node">
-<title>finalOut</title>
+<title>kallistoOutDir</title>
 <polygon fill="#94ddf4" stroke="black" points="346.06,-38.5 346.06,-74.5 407.94,-74.5 407.94,-38.5 346.06,-38.5"/>
-<text text-anchor="middle" x="377" y="-52.3" font-family="Times,serif" font-size="14.00">finalOut</text>
+<text text-anchor="middle" x="377" y="-52.3" font-family="Times,serif" font-size="14.00">kallistoOutDir</text>
 </g>
-<!-- kallisto&#45;&gt;finalOut -->
+<!-- kallisto&#45;&gt;kallistoOutDir -->
 <g id="edge8" class="edge">
-<title>kallisto&#45;&gt;finalOut</title>
+<title>kallisto&#45;&gt;kallistoOutDir</title>
 <path fill="none" stroke="black" d="M377,-110.93C377,-103.17 377,-93.78 377,-85.06"/>
 <polygon fill="black" stroke="black" points="380.5,-84.9 377,-74.9 373.5,-84.9 380.5,-84.9"/>
 </g>
diff --git a/.cwl/cwl-plots/workflows/kallisto.svg b/.cwl/cwl-plots/workflows/kallisto.svg
index 9e81b88..930b4ca 100644
--- a/.cwl/cwl-plots/workflows/kallisto.svg
+++ b/.cwl/cwl-plots/workflows/kallisto.svg
@@ -37,15 +37,15 @@
 <path fill="none" stroke="black" d="M491.95,-193.08C456.78,-182.13 394.44,-162.71 348.49,-148.4"/>
 <polygon fill="black" stroke="black" points="349.25,-144.97 338.66,-145.34 347.16,-151.66 349.25,-144.97"/>
 </g>
-<!-- finalOut -->
+<!-- kallistoOutDir -->
 <g id="node11" class="node">
-<title>finalOut</title>
+<title>kallistoOutDir</title>
 <polygon fill="#94ddf4" stroke="black" points="260.06,-38.5 260.06,-74.5 321.94,-74.5 321.94,-38.5 260.06,-38.5"/>
-<text text-anchor="middle" x="291" y="-52.3" font-family="Times,serif" font-size="14.00">finalOut</text>
+<text text-anchor="middle" x="291" y="-52.3" font-family="Times,serif" font-size="14.00">kallistoOutDir</text>
 </g>
-<!-- collectResults&#45;&gt;finalOut -->
+<!-- collectResults&#45;&gt;kallistoOutDir -->
 <g id="edge12" class="edge">
-<title>collectResults&#45;&gt;finalOut</title>
+<title>collectResults&#45;&gt;kallistoOutDir</title>
 <path fill="none" stroke="black" d="M291,-111.31C291,-103.29 291,-93.55 291,-84.57"/>
 <polygon fill="black" stroke="black" points="294.5,-84.53 291,-74.53 287.5,-84.53 294.5,-84.53"/>
 </g>
diff --git a/arc.cwl b/arc.cwl
index 0043dcf..e42113e 100644
--- a/arc.cwl
+++ b/arc.cwl
@@ -50,7 +50,7 @@ steps:
             StandardDeviation:  kallisto_StandardDeviation
             BootstrapSamples:   kallisto_BootstrapSamples
             resultsFolder:      kallisto_resultsFolder
-        out: [finalOut]
+        out: [kallistoOutDir]
 
 
     isaSampleToRawDataSeq:
@@ -65,7 +65,7 @@ steps:
     sleuth:
         run: runs/sleuth/run.cwl
         in:
-            inKallistoResults:      kallisto/finalOut
+            inKallistoResults:      kallisto/kallistoOutDir
             inMetadataFile:         isaSampleToRawDataSeq/output
             inMetadataSample:       sleuth_inMetadataSample
             inMetadataFactorList:   sleuth_inMetadataFactorList
diff --git a/runs/isaSampleToRawDataSeq/rnaseq-samples.xlsx b/runs/isaSampleToRawDataSeq/rnaseq-samples.xlsx
index 1c05d363efc105474dc4887ac57f94beba0ac181..e73d722501815a8b129f9f7a95b3b0af60c45ab0 100644
GIT binary patch
delta 748
zcmeCTm|!6s;LXe;!oa}6!Qhi$9OeCNO3&em!fN$5G8-MHw0MVhYQN&2Q878<#=R4-
zxBRS$negCLZd#dXRj|DH`y={p+eD-^u5q!n_4V*NGZ()KueR9sHRx~Pp16*6O8?o{
zO=CMYWto@PJGU>huA3yD*gkL3b<Nur9`ls44l5^p@~hL>Iyvq(!~fdvQ|5cIyxrLN
z{^m~k+Cq*;a<21z(wGFbXCK{pXO@ut)nx`p6N6Xv{A%cYe<0xgZNB|0X4|%XS<v~S
z<kaEHEyB$ca&_ZVKAG;?%ZTEgjeq<FnDUD^`wF(OumgSP^0LNl^9@mHMl%CT3v+|C
zq%=!I0}B(&)Knz}eLEZdpwyhilFa<P;*89KVmlP0qT-GTI#1RVSFgWd&3DLvhvC9%
zmwPLNHADh}#l*snur9jtx5KP+(v<TzB`k!(6_OZL*wjw%SHIbRd+&{yws~_;{5+Sz
zn0csiV%V}*CCUjrUsE_|Z@Lkz?>y&2Zn|x^_ATxV=MC8|>!YNW`1h#FT5m0E<}obg
zjau2aNpVimK8Np_2ez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O5
z4OhUxu%z*rC<8-$QEE=Hz8;7~HyaejyMY>XfEuMxG>T95me!I7n(b6@g<}m+N*t&}
s8AS<~#AI~|)yX@hdF6oW9{ns3`3aPdV`5+sMp5^D@)Kz_Hbt=c0AigIApigX

diff --git a/runs/isaSampleToRawDataSeq/run.cwl b/runs/isaSampleToRawDataSeq/run.cwl
index 8f00f6a..3df9da4 100644
--- a/runs/isaSampleToRawDataSeq/run.cwl
+++ b/runs/isaSampleToRawDataSeq/run.cwl
@@ -1,6 +1,9 @@
 cwlVersion: v1.2
 class: Workflow
 
+requirements:
+  MultipleInputFeatureRequirement: {}
+
 inputs:
   arcPath: Directory 
   assayName: string
@@ -15,10 +18,14 @@ steps:
       assayName: assayName
       startingNodeNum: startingNodeNum
       outName: outName
-    out: [output]
+    out:
+      - sampleseqCsv
+      - sampleseqXlsx
 
 outputs:
-  output: 
+  sampleseqs: 
     type: File[]
-    outputSource: isaSampleToRawDataSeq/output
+    outputSource:      
+      - isaSampleToRawDataSeq/sampleseqCsv
+      - isaSampleToRawDataSeq/sampleseqXlsx
 
diff --git a/runs/kallisto/run.cwl b/runs/kallisto/run.cwl
index 3ec2a22..d702ed4 100644
--- a/runs/kallisto/run.cwl
+++ b/runs/kallisto/run.cwl
@@ -35,9 +35,9 @@ steps:
       StandardDeviation: StandardDeviation
       BootstrapSamples: BootstrapSamples
       resultsFolder: resultsFolder
-    out: [finalOut]
+    out: [kallistoOutDir]
 
 outputs:
-  finalOut:
-    type: Directory[]
-    outputSource: kallisto/finalOut
+  kallistoOutDir:
+    type: Directory
+    outputSource: kallisto/kallistoOutDir
diff --git a/workflows/isaSampleToRawDataSeq/workflow.cwl b/workflows/isaSampleToRawDataSeq/workflow.cwl
index 9cace45..f9db3ee 100644
--- a/workflows/isaSampleToRawDataSeq/workflow.cwl
+++ b/workflows/isaSampleToRawDataSeq/workflow.cwl
@@ -39,9 +39,13 @@ inputs:
       position: 4
 
 outputs:
-  output:
-    type: File[]
+  sampleseqCsv:
+    type: File
     outputBinding:
       glob:
         - "*.csv"
+  sampleseqXlsx:
+    type: File
+    outputBinding:
+      glob:
         - "*.xlsx"
diff --git a/workflows/kallisto/yield-dirInDestination.cwl b/workflows/kallisto/gather-dirs.cwl
similarity index 64%
rename from workflows/kallisto/yield-dirInDestination.cwl
rename to workflows/kallisto/gather-dirs.cwl
index bc90cb8..c7a13f5 100644
--- a/workflows/kallisto/yield-dirInDestination.cwl
+++ b/workflows/kallisto/gather-dirs.cwl
@@ -1,18 +1,18 @@
 cwlVersion: v1.2
 class: ExpressionTool
 doc: |
-  Takes a directory (e.g. from a workflow step) and yields it in a desired directory.
+  Takes an array of directories (e.g. from a workflow step) and yields them in a destination directory.
 requirements:
   - class: InlineJavascriptRequirement
 inputs:
-  inDir: Directory
+  inDirs: Directory[]
   destinationDir: string
 expression: |
   ${
     return {"outDir": {
       "class": "Directory", 
       "basename": inputs.destinationDir,
-      "listing": [inputs.inDir]
+      "listing": inputs.inDirs
     } };
   }
 outputs:
diff --git a/workflows/kallisto/kallisto-quant.cwl b/workflows/kallisto/kallisto-quant.cwl
index 026f7e1..692be58 100755
--- a/workflows/kallisto/kallisto-quant.cwl
+++ b/workflows/kallisto/kallisto-quant.cwl
@@ -126,7 +126,7 @@ arguments: [ "--output-dir", $(inputs.QuantOutfolder) ]
 
 outputs:
 
-  outFolder:
+  kallistoQuantOutDir:
     type: Directory
     outputBinding:
       glob: $(runtime.outdir)/$(inputs.QuantOutfolder)
diff --git a/workflows/kallisto/workflow.cwl b/workflows/kallisto/workflow.cwl
index 4ce5617..56e1400 100644
--- a/workflows/kallisto/workflow.cwl
+++ b/workflows/kallisto/workflow.cwl
@@ -51,17 +51,16 @@ steps:
             FragmentLength: FragmentLength
             StandardDeviation: StandardDeviation
             BootstrapSamples: BootstrapSamples
-        out: [outFolder]
-
+        out: [kallistoQuantOutDir]
     collectResults:
-        run: ./yield-dirInDestination.cwl
-        scatter: inDir
+        run: ./gather-dirs.cwl
         in:
-            inDir: quant/outFolder
+            inDirs: quant/kallistoQuantOutDir
             destinationDir: resultsFolder
         out: [outDir]
 
 outputs:
-  finalOut:
-    type: Directory[]
+  kallistoOutDir:
+    type: Directory
     outputSource: collectResults/outDir
+    
-- 
GitLab