From e92c35867c7d9fc2184b9d66ef06386dc536ba42 Mon Sep 17 00:00:00 2001
From: Dominik Brilhaus <brilhaus@nfdi4plants.org>
Date: Fri, 2 Aug 2024 13:15:05 +0200
Subject: [PATCH] design workflow

---
 runs/kallisto/README.md                  |  5 +++--
 runs/kallisto/workflow.yml               | 17 +++++++++-----
 workflows/kallisto/kallisto-workflow.cwl | 28 +++++++++++++++++++-----
 3 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/runs/kallisto/README.md b/runs/kallisto/README.md
index f3a9d64..65d21cd 100644
--- a/runs/kallisto/README.md
+++ b/runs/kallisto/README.md
@@ -4,5 +4,6 @@
 
 ```bash
 cd runs/kallisto/
-cwltool ../../workflows/kallisto/kallisto-index.cwl index.yml
-```
\ No newline at end of file
+cwltool --cachedir cache2 ../../workflows/kallisto/kallisto-workflow.cwl workflow.yml > $(date +"%Y-%m-%d_%H-%M").log 2>&1 &
+```
+
diff --git a/runs/kallisto/workflow.yml b/runs/kallisto/workflow.yml
index b21cbe8..e1d32d5 100644
--- a/runs/kallisto/workflow.yml
+++ b/runs/kallisto/workflow.yml
@@ -1,10 +1,15 @@
-InputReads: 
+InputReadsMultipleSamples: 
+  - 
+    - class: File
+      path: ../../assays/Talinum_RNASeq_minimal/dataset/DB_097_CAMMD_CAGATC_L001_R1_001.fastq.gz
+      format: edam:format_1930 # FASTQ
+  - 
+    - class: File
+      path: ../../assays/Talinum_RNASeq_minimal/dataset/DB_099_CAMMD_CTTGTA_L001_R1_001.fastq.gz
+      format: edam:format_1930 # FASTQ
+IndexInput:
   - class: File
-    path: ../../assays/Talinum_RNASeq_minimal/dataset/DB_097_CAMMD_CAGATC_L001_R1_001.fastq.gz
-    format: edam:format_1930 # FASTQ
-InputFiles:
-  - class: File
-    path: ../../../studies/TalinumGenomeDraft/resources/Talinum.gm.CDS.nt.fa
+    path: ../../studies/TalinumGenomeDraft/resources/Talinum.gm.CDS.nt.fa
     format: edam:format_1929 # FASTA
 isSingle: true
 FragmentLength: 200
diff --git a/workflows/kallisto/kallisto-workflow.cwl b/workflows/kallisto/kallisto-workflow.cwl
index 08047cd..37fb7df 100644
--- a/workflows/kallisto/kallisto-workflow.cwl
+++ b/workflows/kallisto/kallisto-workflow.cwl
@@ -3,25 +3,41 @@ class: Workflow
 
 requirements:
   ScatterFeatureRequirement: {}
+  StepInputExpressionRequirement: {}
+  InlineJavascriptRequirement: {}
 
 inputs:
-  InputReads: []
-  Index: File
+  InputReadsMultipleSamples:
+    type: 
+      type: array
+      items: 
+        type: array
+        items: File
+  IndexInput: File[]
   isSingle: boolean
   FragmentLength: double?  
   StandardDeviation: double?
   BootstrapSamples: int?  
 
 steps:
+  index:
+    run: kallisto-index.cwl
+    in:
+      InputFiles: IndexInput
+      IndexName: 
+        source: IndexInput
+        valueFrom: $(self[0].nameroot)
+    out: [index]
   quant:
     run: kallisto-quant.cwl
     scatter: InputReads
     in:
-      InputReads: listFiles/inDirFiles
+      InputReads: InputReadsMultipleSamples
       QuantOutfolder:
-        source: InputReads
-        valueFrom: $(self.nameroot)
-      Index: Index
+        # source: InputReadsMultipleSamples
+        # valueFrom: $(self[0].nameroot)
+        valueFrom: testSample
+      Index: index/index
       isSingle: isSingle
       FragmentLength: FragmentLength 
       StandardDeviation: StandardDeviation
-- 
GitLab