diff --git a/runs/kallisto_quant/README.md b/runs/kallisto_quant/README.md index 7e0399169b09ac01f90709bcec1dd8d6e2e9694a..34ee54236040614751867b388188f9e716e11b7b 100644 --- a/runs/kallisto_quant/README.md +++ b/runs/kallisto_quant/README.md @@ -8,14 +8,6 @@ cd /Users/dominikbrilhaus/gitlab_dataplant/samplearc_rnaseq/runs/kallisto_quant ## Let it flow ```bash -### store arc root (two levels up from here) as variable -arc_root=$(echo ${PWD%/*/*}) - -### replace arc root line in yml (specific to the machine from where this is run) -### not sure, if this works on linux... -sed -i '' "s|^arc_root:.*|arc_root: $arc_root|g" kallisto_quant.yml - ### run with cwltool -cwltool ../../workflows/kallisto_quant.cwl kallisto_quant.yml - +cwltool --enable-dev run.cwl kallisto_quant.yml ``` diff --git a/runs/kallisto_quant/kallisto_quant.yml b/runs/kallisto_quant/kallisto_quant.yml index 44f6bfe71211805c278a75c660038635fb68dce0..e5c7505ffe14ba3399cdc1d9f86db5e2ca50dd43 100644 --- a/runs/kallisto_quant/kallisto_quant.yml +++ b/runs/kallisto_quant/kallisto_quant.yml @@ -9,4 +9,4 @@ in_fastq_dir: kallisto_bootstrap: 100 kallisto_threads: 4 kallisto_fragmentLength: 200 -kallisto_stdDev: 20 \ No newline at end of file +kallisto_stdDev: 20 diff --git a/runs/kallisto_quant/run.cwl b/runs/kallisto_quant/run.cwl index a5e9b88dbd41da7e29d83608f59bf32e40410e09..87cc30fd0557a67aff2ec890055e8513472f5d22 100644 --- a/runs/kallisto_quant/run.cwl +++ b/runs/kallisto_quant/run.cwl @@ -33,4 +33,4 @@ steps: kallisto_threads: kallisto_threads kallisto_fragmentLength: kallisto_fragmentLength kallisto_stdDev: kallisto_stdDev - out: [outdir] \ No newline at end of file + out: [outdir] diff --git a/runs/kallisto_sleuth/README.md b/runs/kallisto_sleuth/README.md index 05639e7e53b53e81a9f51f01627e43af130fec9c..9df2ee4950593a59f32c90c641af71e1210eb4ef 100644 --- a/runs/kallisto_sleuth/README.md +++ b/runs/kallisto_sleuth/README.md @@ -8,14 +8,6 @@ cd /Users/dominikbrilhaus/gitlab_dataplant/samplearc_rnaseq/runs/kallisto_sleuth ## Let it flow ```bash -### store arc root (two levels up from here) as variable -arc_root=$(echo ${PWD%/*/*}) - -### replace arc root line in yml (specific to the machine from where this is run) -### not sure, if this works on linux... -sed -i '' "s|^arc_root:.*|arc_root: $arc_root|g" kallisto_sleuth.yml - ### run with cwltool -cwltool ../../workflows/kallisto_sleuth.cwl kallisto_sleuth.yml - +cwltool --enable-dev run.cwl kallisto_sleuth.yml ``` diff --git a/runs/kallisto_sleuth/kallisto_sleuth.yml b/runs/kallisto_sleuth/kallisto_sleuth.yml index 34364fd1b8f453cf2ec511b2549f890fd06442ba..49c11233026681aefe4d30351eaab03e21ba7477 100644 --- a/runs/kallisto_sleuth/kallisto_sleuth.yml +++ b/runs/kallisto_sleuth/kallisto_sleuth.yml @@ -1,7 +1,5 @@ cores: 1 -r_script: +in_sleuth: class: File - path: ../../workflows/kallisto_sleuth.R -in_sleuth: runs/kallisto_collect/kallisto_sleuthObject.RData -out_folder: runs/kallisto_sleuth -arc_root: /Users/dominikbrilhaus/gitlab_dataplant/samplearc_rnaseq \ No newline at end of file + path: ../kallisto_collect/kallisto_sleuthObject.RData +out_folder: out diff --git a/runs/kallisto_sleuth/sleuth_dge.csv b/runs/kallisto_sleuth/out/sleuth_dge.csv similarity index 100% rename from runs/kallisto_sleuth/sleuth_dge.csv rename to runs/kallisto_sleuth/out/sleuth_dge.csv diff --git a/runs/kallisto_sleuth/run.cwl b/runs/kallisto_sleuth/run.cwl new file mode 100644 index 0000000000000000000000000000000000000000..9565052896a943443788e6d06556f8ed2631f05d --- /dev/null +++ b/runs/kallisto_sleuth/run.cwl @@ -0,0 +1,21 @@ +#!/usr/bin/env cwl-runner +cwlVersion: v1.2.0-dev1 +class: Workflow +inputs: + in_sleuth: + type: File + out_folder: + type: string +outputs: + out_dir: + type: + type: array + items: Directory + outputSource: kallisto_quant/outdir +steps: + kallisto_quant: + run: ../../workflows/kallisto_sleuth/workflow.cwl + in: + in_sleuth: in_sleuth + out_folder: out_folder + out: [outdir] diff --git a/workflows/kallisto_sleuth/kallisto_sleuth.R b/workflows/kallisto_sleuth/kallisto_sleuth.R index ec3a84afe7aec0e9bab0b621c113e23e177a83bd..e4c895eafb330000101e141b808463c7e786dbbf 100644 --- a/workflows/kallisto_sleuth/kallisto_sleuth.R +++ b/workflows/kallisto_sleuth/kallisto_sleuth.R @@ -1,5 +1,4 @@ #!/usr/bin/env Rscript - ################################################ ### Diff. gene expression with sleuth ########## ################################################ @@ -15,30 +14,27 @@ ################################################ #### Load required library ################################################ - library(sleuth) - ################################################ #### Read arguments from CLI ################################################ args <- commandArgs(trailingOnly = T) -arc_root <- args[1] -in_sleuth <- args[2] -out_folder <- args[3] +in_sleuth <- args[1] +out_folder <- args[2] ################################################ #### If it does not exist, create out dir ################################################ -dir.create(paste(arc_root, out_folder, sep = "/"), recursive = T, showWarnings = F) +dir.create(out_folder, recursive = T, showWarnings = F) ################################################ #### Load sleuth object ################################################ -load(file = paste(arc_root, in_sleuth, sep = "/")) +load(file = in_sleuth) ################################################ #### Run sleuth fit @@ -55,4 +51,4 @@ sleuth_table <- sleuth_results(so, "reduced:full", "lrt", show_all = FALSE) #### write to file ################################################ -write.csv(sleuth_table, paste(arc_root, out_folder, "sleuth_dge.csv", sep = "/"), row.names = F) +write.csv(sleuth_table, paste(out_folder, "sleuth_dge.csv", sep = "/"), row.names = F) diff --git a/workflows/kallisto_sleuth/workflow.cwl b/workflows/kallisto_sleuth/workflow.cwl index 6f427261e5ec6da3dce2b916d2fcfc25659eff7a..009ea5333f5ed49aa04e7e8aadf5e748b62e434e 100644 --- a/workflows/kallisto_sleuth/workflow.cwl +++ b/workflows/kallisto_sleuth/workflow.cwl @@ -1,26 +1,27 @@ #!/usr/bin/env cwl-runner -cwlVersion: v1.2 +cwlVersion: v1.2.0-dev1 class: CommandLineTool - +hints: + DockerRequirement: + dockerPull: zimmera95/rnaseq:latest +requirements: + - class: InitialWorkDirRequirement + listing: + - class: File + location: kallisto_sleuth.R +arguments: + - position: 0 + valueFrom: kallisto_sleuth.R inputs: -- id: r_script - type: File - inputBinding: - position: 0 -- id: arc_root - type: string - inputBinding: - position: 1 -- id: in_sleuth - type: string - inputBinding: - position: 2 -- id: out_folder - type: string - inputBinding: - position: 3 - + - id: in_sleuth + type: File + inputBinding: + position: 1 + - id: out_folder + type: string + inputBinding: + position: 2 outputs: - id: outdir type: