diff --git a/runs/shiny_prep/README.md b/runs/shiny_prep/README.md index 05639e7e53b53e81a9f51f01627e43af130fec9c..e96585792fa1a4cfc2b8a1517f7a8068c8e5d6a4 100644 --- a/runs/shiny_prep/README.md +++ b/runs/shiny_prep/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 shiny_prep.yml ``` diff --git a/runs/shiny_prep/out/shiny_prep.RData b/runs/shiny_prep/out/shiny_prep.RData new file mode 100644 index 0000000000000000000000000000000000000000..05ad3fdef0add3ebd7bb6a027e4f7b575e33bb22 Binary files /dev/null and b/runs/shiny_prep/out/shiny_prep.RData differ diff --git a/runs/shiny_prep/run.cwl b/runs/shiny_prep/run.cwl new file mode 100644 index 0000000000000000000000000000000000000000..13e324a958e89a75f567c5f3e9f6634de3b5442a --- /dev/null +++ b/runs/shiny_prep/run.cwl @@ -0,0 +1,21 @@ +#!/usr/bin/env cwl-runner +cwlVersion: v1.2.0-dev1 +class: Workflow +inputs: + out_folder: + type: string + in_kallisto_df: + type: File +outputs: + out_dir: + type: + type: array + items: Directory + outputSource: shiny_prep/outdir +steps: + shiny_prep: + run: ../../workflows/shiny_prep/workflow.cwl + in: + in_kallisto_df: in_kallisto_df + out_folder: out_folder + out: [outdir] diff --git a/runs/shiny_prep/shiny_prep.RData b/runs/shiny_prep/shiny_prep.RData deleted file mode 100644 index 258a091981fee5ee5389d9e76ca25e2a237768b8..0000000000000000000000000000000000000000 Binary files a/runs/shiny_prep/shiny_prep.RData and /dev/null differ diff --git a/runs/shiny_prep/shiny_prep.yml b/runs/shiny_prep/shiny_prep.yml index a8fec1d28132c8b86ab7e4264eae03acf7d79e2d..60c9636bed76b7f71ec8609c0c6c05cd0ed41085 100644 --- a/runs/shiny_prep/shiny_prep.yml +++ b/runs/shiny_prep/shiny_prep.yml @@ -1,7 +1,5 @@ cores: 1 -r_script: +in_kallisto_df: class: File - path: ../../workflows/shiny_prep.R -in_kallisto_df: runs/kallisto_collect/kallisto_df.csv -out_folder: runs/shiny_prep -arc_root: /Users/dominikbrilhaus/gitlab_dataplant/samplearc_rnaseq + path: ../kallisto_collect/kallisto_df.csv +out_folder: out diff --git a/workflows/install_dependencies/install_cwl.md b/workflows/install_dependencies/install_cwl.md deleted file mode 100644 index d812962a3932a710221301d08205e47345bc95a2..0000000000000000000000000000000000000000 --- a/workflows/install_dependencies/install_cwl.md +++ /dev/null @@ -1,13 +0,0 @@ - -# CWL Installation (MacOS) - -Docs: https://www.commonwl.org/ -GitHub: https://github.com/common-workflow-language/cwltool - -## Install CWL via conda - -> requires conda installation, which is a whole different story. Good luck. - -```bash -conda install -c conda-forge cwltool -``` diff --git a/workflows/install_dependencies/install_kallisto.md b/workflows/install_dependencies/install_kallisto.md deleted file mode 100644 index 121b9f229d207352c3529e572286b3bd34b3f2f9..0000000000000000000000000000000000000000 --- a/workflows/install_dependencies/install_kallisto.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Kallisto Installation - -- Docs: http://pachterlab.github.io/kallisto/manual.html -- GitHub: https://github.com/pachterlab/kallisto - -## MacOS Installation via conda - -see: https://anaconda.org/bioconda/kallisto - -```bash -conda install -c bioconda kallisto -``` diff --git a/workflows/install_dependencies/install_r_packages.R b/workflows/install_dependencies/install_r_packages.R deleted file mode 100644 index fdb1eb1afb2ded3fb31d9f59a4487ce6a028163b..0000000000000000000000000000000000000000 --- a/workflows/install_dependencies/install_r_packages.R +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env Rscript - -################################################ -### Installation of R dependencies ############# -################################################ - -### Default (CRAN) - -if(!"tidyverse" %in% row.names(installed.packages())){install.packages("tidyverse")} -if(!"jsonlite" %in% row.names(installed.packages())){install.packages("jsonlite")} -if(!"openxlsx" %in% row.names(installed.packages())){install.packages("openxlsx")} -if(!"kableExtra" %in% row.names(installed.packages())){install.packages("kableExtra")} -if(!"shiny" %in% row.names(installed.packages())){install.packages("shiny")} -if(!"RColorBrewer" %in% row.names(installed.packages())){install.packages("RColorBrewer")} - -### From BiocManager - -if (!requireNamespace("BiocManager", quietly = TRUE)){install.packages("BiocManager")} -if(!"BiocManager" %in% row.names(installed.packages())){BiocManager::install()} -if(!"devtools" %in% row.names(installed.packages())){BiocManager::install("devtools")} -if(!"sleuth" %in% row.names(installed.packages())){BiocManager::install("pachterlab/sleuth")} - -### Test load packages - -library(tidyverse) -library(jsonlite) -library(openxlsx) -library(sleuth) -library(kableExtra) -library(shiny) -library(RColorBrewer) diff --git a/workflows/shiny_prep/shiny_prep.R b/workflows/shiny_prep/shiny_prep.R index a44796250a409d286eb330862a7cdb6c4b473036..c46afba5da52cf85ff3cdb17830a8b0b5da49945 100644 --- a/workflows/shiny_prep/shiny_prep.R +++ b/workflows/shiny_prep/shiny_prep.R @@ -20,22 +20,21 @@ args <- commandArgs(trailingOnly = T) -arc_root <- args[1] -out_folder <- args[2] -in_kallisto_df <- args[3] +out_folder <- args[1] +in_kallisto_df <- 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) ################################################ #### Prep data for shiny app ################################################ -expression_data <- read.csv(file = paste(arc_root, in_kallisto_df, sep = "/")) +expression_data <- read.csv(file = in_kallisto_df) available_genes <- unique(expression_data$target_id) -save(expression_data, available_genes, file = paste(arc_root, out_folder, 'shiny_prep.RData', sep = "/")) +save(expression_data, available_genes, file = paste(out_folder, 'shiny_prep.RData', sep = "/")) diff --git a/workflows/shiny_prep/workflow.cwl b/workflows/shiny_prep/workflow.cwl index 918aaa0aefa401caed518703a64ac7fd6c333e3b..db3ff8b98e4f4cde7429b22c9a29b73afc56009f 100644 --- a/workflows/shiny_prep/workflow.cwl +++ b/workflows/shiny_prep/workflow.cwl @@ -1,25 +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: shiny_prep.R +arguments: + - position: 0 + valueFrom: shiny_prep.R inputs: -- id: r_script - type: File - inputBinding: - position: 0 -- id: arc_root - type: string - inputBinding: - position: 1 - id: out_folder type: string inputBinding: - position: 2 + position: 1 - id: in_kallisto_df - type: string + type: File inputBinding: - position: 3 + position: 2 outputs: - id: outdir