Skip to content
Snippets Groups Projects
Commit f4b0b741 authored by Adrian Zimmer's avatar Adrian Zimmer
Browse files

Dockerize shiny_prep

parent 14e17ca6
No related branches found
No related tags found
No related merge requests found
...@@ -8,14 +8,6 @@ cd /Users/dominikbrilhaus/gitlab_dataplant/samplearc_rnaseq/runs/kallisto_sleuth ...@@ -8,14 +8,6 @@ cd /Users/dominikbrilhaus/gitlab_dataplant/samplearc_rnaseq/runs/kallisto_sleuth
## Let it flow ## Let it flow
```bash ```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 ### run with cwltool
cwltool ../../workflows/kallisto_sleuth.cwl kallisto_sleuth.yml cwltool --enable-dev run.cwl shiny_prep.yml
``` ```
No preview for this file type
#!/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]
cores: 1 cores: 1
r_script: in_kallisto_df:
class: File class: File
path: ../../workflows/shiny_prep.R path: ../kallisto_collect/kallisto_df.csv
in_kallisto_df: runs/kallisto_collect/kallisto_df.csv out_folder: out
out_folder: runs/shiny_prep
arc_root: /Users/dominikbrilhaus/gitlab_dataplant/samplearc_rnaseq
# 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
```
# 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
```
#!/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)
...@@ -20,22 +20,21 @@ ...@@ -20,22 +20,21 @@
args <- commandArgs(trailingOnly = T) args <- commandArgs(trailingOnly = T)
arc_root <- args[1] out_folder <- args[1]
out_folder <- args[2] in_kallisto_df <- args[2]
in_kallisto_df <- args[3]
################################################ ################################################
#### If it does not exist, create out dir #### 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 #### 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) 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 = "/"))
#!/usr/bin/env cwl-runner #!/usr/bin/env cwl-runner
cwlVersion: v1.2 cwlVersion: v1.2.0-dev1
class: CommandLineTool 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: inputs:
- id: r_script
type: File
inputBinding:
position: 0
- id: arc_root
type: string
inputBinding:
position: 1
- id: out_folder - id: out_folder
type: string type: string
inputBinding: inputBinding:
position: 2 position: 1
- id: in_kallisto_df - id: in_kallisto_df
type: string type: File
inputBinding: inputBinding:
position: 3 position: 2
outputs: outputs:
- id: outdir - id: outdir
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment