From a75819671005a95e8b48a656144637d0bdcf5414 Mon Sep 17 00:00:00 2001 From: Adrian Zimmer <z.adrian1995@gmail.com> Date: Fri, 12 Aug 2022 15:42:14 +0200 Subject: [PATCH] Upeate structure, dockerize kallisto_index --- .gitattributes | 2 +- runs/kallisto_index/README.md | 10 +------ runs/kallisto_index/kallisto_index.yml | 8 +++--- runs/kallisto_index/{ => out}/kallisto_index | 0 runs/kallisto_index/run.cwl | 21 +++++++++++++++ .../{ => kallisto_collect}/kallisto_collect.R | 0 .../workflow.cwl} | 0 .../{ => kallisto_index}/kallisto_index.sh | 10 +++---- .../workflow.cwl} | 26 ++++++++++--------- .../{ => kallisto_quant}/kallisto_quant.sh | 0 .../workflow.cwl} | 0 .../{ => kallisto_sleuth}/kallisto_sleuth.R | 0 .../workflow.cwl} | 0 .../merge_isa_metadata.R | 0 .../workflow.cwl} | 0 workflows/{ => shiny_prep}/shiny_plots.Rmd | 0 workflows/{ => shiny_prep}/shiny_prep.R | 0 .../workflow.cwl} | 0 18 files changed, 44 insertions(+), 33 deletions(-) rename runs/kallisto_index/{ => out}/kallisto_index (100%) create mode 100644 runs/kallisto_index/run.cwl rename workflows/{ => kallisto_collect}/kallisto_collect.R (100%) rename workflows/{kallisto_collect.cwl => kallisto_collect/workflow.cwl} (100%) rename workflows/{ => kallisto_index}/kallisto_index.sh (85%) mode change 100755 => 100644 rename workflows/{kallisto_index.cwl => kallisto_index/workflow.cwl} (55%) rename workflows/{ => kallisto_quant}/kallisto_quant.sh (100%) mode change 100755 => 100644 rename workflows/{kallisto_quant.cwl => kallisto_quant/workflow.cwl} (100%) rename workflows/{ => kallisto_sleuth}/kallisto_sleuth.R (100%) rename workflows/{kallisto_sleuth.cwl => kallisto_sleuth/workflow.cwl} (100%) rename workflows/{ => merge_isa_metadata}/merge_isa_metadata.R (100%) rename workflows/{merge_isa_metadata.cwl => merge_isa_metadata/workflow.cwl} (100%) rename workflows/{ => shiny_prep}/shiny_plots.Rmd (100%) rename workflows/{ => shiny_prep}/shiny_prep.R (100%) rename workflows/{shiny_prep.cwl => shiny_prep/workflow.cwl} (100%) diff --git a/.gitattributes b/.gitattributes index 9992776..7c3cf77 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,4 +5,4 @@ /assays/Talinum_RNASeq_minimal/dataset/DB_103_CAMMD_AGTCAA_L001_R1_001.fastq.gz filter=lfs diff=lfs merge=lfs -text /assays/Talinum_RNASeq_minimal/dataset/DB_161_reC3MD_GTCCGC_L001_R1_001.fastq.gz filter=lfs diff=lfs merge=lfs -text /assays/Talinum_RNASeq_minimal/dataset/DB_165_re-C3MD_GTGAAA_L002_R1_001.fastq.gz filter=lfs diff=lfs merge=lfs -text -/runs/kallisto_index/kallisto_index filter=lfs diff=lfs merge=lfs -text +/runs/kallisto_index/out/kallisto_index filter=lfs diff=lfs merge=lfs -text diff --git a/runs/kallisto_index/README.md b/runs/kallisto_index/README.md index 16475f8..577a1e4 100644 --- a/runs/kallisto_index/README.md +++ b/runs/kallisto_index/README.md @@ -8,14 +8,6 @@ cd /Users/dominikbrilhaus/gitlab_dataplant/samplearc_rnaseq/runs/kallisto_index ## 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_index.yml - ### run with cwltool -cwltool ../../workflows/kallisto_index.cwl kallisto_index.yml - +cwltool --enable-dev run.cwl kallisto_index.yml ``` diff --git a/runs/kallisto_index/kallisto_index.yml b/runs/kallisto_index/kallisto_index.yml index 60f3a27..37c6681 100644 --- a/runs/kallisto_index/kallisto_index.yml +++ b/runs/kallisto_index/kallisto_index.yml @@ -1,7 +1,5 @@ cores: 1 -sh_script: +in_genome_ref: class: File - path: ../../workflows/kallisto_index.sh -in_genome_ref: studies/TalinumGenomeDraft/resources/Talinum.gm.CDS.nt.fa -out_folder: runs/kallisto_index -arc_root: /Users/dominikbrilhaus/gitlab_dataplant/samplearc_rnaseq + path: ../../studies/TalinumGenomeDraft/resources/Talinum.gm.CDS.nt.fa +out_folder: ./out diff --git a/runs/kallisto_index/kallisto_index b/runs/kallisto_index/out/kallisto_index similarity index 100% rename from runs/kallisto_index/kallisto_index rename to runs/kallisto_index/out/kallisto_index diff --git a/runs/kallisto_index/run.cwl b/runs/kallisto_index/run.cwl new file mode 100644 index 0000000..efca83d --- /dev/null +++ b/runs/kallisto_index/run.cwl @@ -0,0 +1,21 @@ +#!/usr/bin/env cwl-runner +cwlVersion: v1.2.0-dev1 +class: Workflow +inputs: + in_genome_ref: + type: File + out_folder: + type: string +outputs: + out_dir: + type: + type: array + items: Directory + outputSource: kallisto_index/outdir +steps: + kallisto_index: + run: ../../workflows/kallisto_index/workflow.cwl + in: + in_genome_ref: in_genome_ref + out_folder: out_folder + out: [outdir] \ No newline at end of file diff --git a/workflows/kallisto_collect.R b/workflows/kallisto_collect/kallisto_collect.R similarity index 100% rename from workflows/kallisto_collect.R rename to workflows/kallisto_collect/kallisto_collect.R diff --git a/workflows/kallisto_collect.cwl b/workflows/kallisto_collect/workflow.cwl similarity index 100% rename from workflows/kallisto_collect.cwl rename to workflows/kallisto_collect/workflow.cwl diff --git a/workflows/kallisto_index.sh b/workflows/kallisto_index/kallisto_index.sh old mode 100755 new mode 100644 similarity index 85% rename from workflows/kallisto_index.sh rename to workflows/kallisto_index/kallisto_index.sh index 6cd3e17..c7cb12d --- a/workflows/kallisto_index.sh +++ b/workflows/kallisto_index/kallisto_index.sh @@ -16,9 +16,8 @@ #### Read arguments from CLI ################################################ -arc_root=$1 -in_genome_ref=$2 -out_folder=$3 +in_genome_ref=$1 +out_folder=$2 ################################################ #### Print version and citation to test kallisto @@ -31,11 +30,10 @@ kallisto cite #### If it does not exist, create out dir ################################################ -mkdir -p "$arc_root/$out_folder/" - +mkdir -p $out_folder ################################################ #### Build kallisto index ################################################ -kallisto index -i "$arc_root/$out_folder/kallisto_index" "$arc_root/$in_genome_ref" +kallisto index -i $out_folder/kallisto_index $in_genome_ref diff --git a/workflows/kallisto_index.cwl b/workflows/kallisto_index/workflow.cwl similarity index 55% rename from workflows/kallisto_index.cwl rename to workflows/kallisto_index/workflow.cwl index a6389de..a91a17c 100644 --- a/workflows/kallisto_index.cwl +++ b/workflows/kallisto_index/workflow.cwl @@ -1,25 +1,27 @@ #!/usr/bin/env cwl-runner -cwlVersion: v1.2 +cwlVersion: v1.2.0-dev1 class: CommandLineTool - +hints: + DockerRequirement: + dockerPull: zlskidmore/kallisto:0.48.0 +requirements: + - class: InitialWorkDirRequirement + listing: + - class: File + location: kallisto_index.sh +arguments: + - position: 0 + valueFrom: ./kallisto_index.sh inputs: -- id: sh_script +- id: in_genome_ref type: File - inputBinding: - position: 0 -- id: arc_root - type: string inputBinding: position: 1 -- id: in_genome_ref - type: string - inputBinding: - position: 2 - id: out_folder type: string inputBinding: - position: 3 + position: 2 outputs: - id: outdir diff --git a/workflows/kallisto_quant.sh b/workflows/kallisto_quant/kallisto_quant.sh old mode 100755 new mode 100644 similarity index 100% rename from workflows/kallisto_quant.sh rename to workflows/kallisto_quant/kallisto_quant.sh diff --git a/workflows/kallisto_quant.cwl b/workflows/kallisto_quant/workflow.cwl similarity index 100% rename from workflows/kallisto_quant.cwl rename to workflows/kallisto_quant/workflow.cwl diff --git a/workflows/kallisto_sleuth.R b/workflows/kallisto_sleuth/kallisto_sleuth.R similarity index 100% rename from workflows/kallisto_sleuth.R rename to workflows/kallisto_sleuth/kallisto_sleuth.R diff --git a/workflows/kallisto_sleuth.cwl b/workflows/kallisto_sleuth/workflow.cwl similarity index 100% rename from workflows/kallisto_sleuth.cwl rename to workflows/kallisto_sleuth/workflow.cwl diff --git a/workflows/merge_isa_metadata.R b/workflows/merge_isa_metadata/merge_isa_metadata.R similarity index 100% rename from workflows/merge_isa_metadata.R rename to workflows/merge_isa_metadata/merge_isa_metadata.R diff --git a/workflows/merge_isa_metadata.cwl b/workflows/merge_isa_metadata/workflow.cwl similarity index 100% rename from workflows/merge_isa_metadata.cwl rename to workflows/merge_isa_metadata/workflow.cwl diff --git a/workflows/shiny_plots.Rmd b/workflows/shiny_prep/shiny_plots.Rmd similarity index 100% rename from workflows/shiny_plots.Rmd rename to workflows/shiny_prep/shiny_plots.Rmd diff --git a/workflows/shiny_prep.R b/workflows/shiny_prep/shiny_prep.R similarity index 100% rename from workflows/shiny_prep.R rename to workflows/shiny_prep/shiny_prep.R diff --git a/workflows/shiny_prep.cwl b/workflows/shiny_prep/workflow.cwl similarity index 100% rename from workflows/shiny_prep.cwl rename to workflows/shiny_prep/workflow.cwl -- GitLab