From f31bbdea797535bcd9d7e78407fcfc94fd063ed1 Mon Sep 17 00:00:00 2001
From: Dominik <dominik.brilhaus@hhu.de>
Date: Fri, 24 Mar 2023 13:04:47 +0100
Subject: [PATCH] docker-free kallisto sleuth

---
 runs/kallisto_sleuth/run.cwl                | 42 ++++++++++++---------
 runs/kallisto_sleuth/run.yml                |  5 ++-
 workflows/kallisto_sleuth/kallisto_sleuth.R | 12 +-----
 3 files changed, 31 insertions(+), 28 deletions(-)

diff --git a/runs/kallisto_sleuth/run.cwl b/runs/kallisto_sleuth/run.cwl
index dc8b77a..60a4475 100644
--- a/runs/kallisto_sleuth/run.cwl
+++ b/runs/kallisto_sleuth/run.cwl
@@ -1,21 +1,29 @@
 #!/usr/bin/env cwl-runner
+
 cwlVersion: v1.2
-class: Workflow
+class: CommandLineTool
+
 inputs:
-  in_sleuth:
-    type: File
-  out_folder:
-    type: string
+- id: r_script
+  type: File
+  inputBinding:
+    position: 0
+- id: in_sleuth
+  type: File
+  inputBinding:
+    position: 1
+- id: out_folder
+  type: string
+  inputBinding:
+    position: 2
+
 outputs:
-  out_dir:
-    type:
-      type: array
-      items: Directory
-    outputSource: kallisto_sleuth/outdir
-steps:
-  kallisto_sleuth:
-    run: ../../workflows/kallisto_sleuth/workflow.cwl
-    in:
-      in_sleuth: in_sleuth
-      out_folder: out_folder
-    out: [outdir]
+- id: outdir
+  type:
+    type: array
+    items: Directory
+  outputBinding:
+    glob: $(runtime.outdir)/$(inputs.out_folder)
+
+baseCommand:
+- Rscript
diff --git a/runs/kallisto_sleuth/run.yml b/runs/kallisto_sleuth/run.yml
index 49c1123..7307a35 100644
--- a/runs/kallisto_sleuth/run.yml
+++ b/runs/kallisto_sleuth/run.yml
@@ -1,5 +1,8 @@
 cores: 1
+r_script:
+  class: File
+  path: ../../workflows/kallisto_sleuth/kallisto_sleuth.R
 in_sleuth:
   class: File
-  path: ../kallisto_collect/kallisto_sleuthObject.RData
+  path: ../kallisto_collect/out/kallisto_sleuthObject.RData
 out_folder: out
diff --git a/workflows/kallisto_sleuth/kallisto_sleuth.R b/workflows/kallisto_sleuth/kallisto_sleuth.R
index 688904d..c4b599b 100644
--- a/workflows/kallisto_sleuth/kallisto_sleuth.R
+++ b/workflows/kallisto_sleuth/kallisto_sleuth.R
@@ -1,20 +1,12 @@
 #!/usr/bin/env Rscript
-################################################
-### Diff. gene expression with sleuth ##########
-################################################
-
-################################################
-#### CWL-independent tests
-################################################
 
-# arc_root <- "~/gitlab_dataplant/samplearc_rnaseq_adrian/"
-# in_sleuth <- "runs/kallisto_collect/kallisto_sleuthObject.RData"
-# out_folder <- "runs/kallisto_sleuth"
+### Diff. gene expression with sleuth
 
 ################################################
 #### Load required library
 ################################################
 library(sleuth)
+
 ################################################
 #### Read arguments from CLI
 ################################################
-- 
GitLab