From f59f79efa20801366e1e3777c50d017b4e155d00 Mon Sep 17 00:00:00 2001
From: Dominik Brilhaus <brilhaus@nfdi4plants.org>
Date: Wed, 24 Jan 2024 18:01:18 +0100
Subject: [PATCH] add kallisto index workflows

---
 runs/kallisto_index/run.cwl                | 36 ++++++++++++++++++++++
 runs/kallisto_index/run.yml                |  8 +++++
 workflows/kallisto_index/kallisto_index.sh | 29 +++++++++++++++++
 3 files changed, 73 insertions(+)
 create mode 100644 runs/kallisto_index/run.cwl
 create mode 100644 runs/kallisto_index/run.yml
 create mode 100644 workflows/kallisto_index/kallisto_index.sh

diff --git a/runs/kallisto_index/run.cwl b/runs/kallisto_index/run.cwl
new file mode 100644
index 0000000..6cbbb9c
--- /dev/null
+++ b/runs/kallisto_index/run.cwl
@@ -0,0 +1,36 @@
+#!/usr/bin/env cwl-runner
+
+cwlVersion: v1.2
+class: CommandLineTool
+
+hints:
+  DockerRequirement:
+    dockerPull: quay.io/biocontainers/kallisto:0.43.0--hdf51.8.17_2
+
+inputs:
+- id: sh_script
+  type: File
+  inputBinding:
+    position: 0
+- id: in_genome_ref
+  type: File
+  inputBinding:
+    position: 2
+- id: out_folder
+  type: string
+  inputBinding:
+    position: 3
+
+outputs:
+- id: outdir
+  type:
+    type: array
+    items: Directory
+  outputBinding:
+    glob: $(runtime.outdir)/$(inputs.out_folder)
+- id: example_out:
+  type: stdout
+stdout: output.txt
+
+baseCommand:
+- bash
diff --git a/runs/kallisto_index/run.yml b/runs/kallisto_index/run.yml
new file mode 100644
index 0000000..57e15e4
--- /dev/null
+++ b/runs/kallisto_index/run.yml
@@ -0,0 +1,8 @@
+cores: 1
+sh_script:
+  class: File
+  path: ../../workflows/kallisto_index/kallisto_index.sh
+in_genome_ref:
+  class: File
+  path: ../../studies/ ##TODO
+out_folder: ./out
diff --git a/workflows/kallisto_index/kallisto_index.sh b/workflows/kallisto_index/kallisto_index.sh
new file mode 100644
index 0000000..c346206
--- /dev/null
+++ b/workflows/kallisto_index/kallisto_index.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+### Build kallisto index
+
+################################################
+#### Read arguments from CLI
+################################################
+
+in_genome_ref=$1
+out_folder=$2
+
+################################################
+#### Print version and citation to test kallisto 
+################################################
+
+kallisto version
+kallisto cite
+
+################################################
+#### If it does not exist, create out dir
+################################################
+
+mkdir -p $out_folder
+
+################################################
+#### Build kallisto index
+################################################
+
+kallisto index -i $out_folder/kallisto_index $in_genome_ref
-- 
GitLab