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

Dockerize merge_isa_metadata

parent 66ed13b5
No related branches found
No related tags found
No related merge requests found
...@@ -9,15 +9,6 @@ cd /Users/dominikbrilhaus/gitlab_dataplant/samplearc_rnaseq/runs/merged_isa_meta ...@@ -9,15 +9,6 @@ cd /Users/dominikbrilhaus/gitlab_dataplant/samplearc_rnaseq/runs/merged_isa_meta
## 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" merge_isa_metadata.yml
### run with cwltool ### run with cwltool
cwltool ../../workflows/merge_isa_metadata.cwl merge_isa_metadata.yml cwltool --enable-dev run.cwl merge_isa_metadata.yml
``` ```
cores: 1 cores: 1
r_script: in_isa_study:
class: File class: File
path: ../../workflows/merge_isa_metadata.R path: ../../studies/TalinumFacultativeCAM/isa.study.xlsx
in_isa_study: studies/TalinumFacultativeCAM/isa.study.xlsx:plant_growth in_isa_assay:
in_isa_assay: assays/Talinum_RNASeq_minimal/isa.assay.xlsx:2EXT01_RNA:3ASY01_RNASeq class: File
out_folder: runs/merged_isa_metadata path: ../../assays/Talinum_RNASeq_minimal/isa.assay.xlsx
arc_root: /Users/dominikbrilhaus/gitlab_dataplant/samplearc_rnaseq out_folder: out
\ No newline at end of file \ No newline at end of file
#!/usr/bin/env cwl-runner
cwlVersion: v1.2.0-dev1
class: Workflow
inputs:
in_isa_study:
type: File
in_isa_assay:
type: File
out_folder:
type: string
outputs:
out_dir:
type:
type: array
items: Directory
outputSource: merge_isa_metadata/outdir
steps:
merge_isa_metadata:
run: ../../workflows/merge_isa_metadata/workflow.cwl
in:
in_isa_study: in_isa_study
in_isa_assay: in_isa_assay
out_folder: out_folder
out: [outdir]
...@@ -21,17 +21,18 @@ library(openxlsx) ...@@ -21,17 +21,18 @@ library(openxlsx)
args <- commandArgs(trailingOnly = T) args <- commandArgs(trailingOnly = T)
arc_root <- args[1] in_isa_study <- paste(args[1], ":plant_growth", sep="")
in_isa_study <- args[2] print(in_isa_study)
in_isa_assay <- args[3] in_isa_assay <- paste(args[2], ":2EXT01_RNA:3ASY01_RNASeq", sep="")
out_folder <- args[4] print(in_isa_assay)
out_folder <- args[3]
################################################ ################################################
#### Read metadata from isa excel workbooks #### Read metadata from isa excel workbooks
################################################ ################################################
isa_study <- unlist(strsplit(paste(arc_root, in_isa_study, sep = "/"), split = ":")) isa_study <- unlist(strsplit(in_isa_study, split = ":"))
isa_assay <- unlist(strsplit(paste(arc_root, in_isa_assay, sep = "/"), split = ":")) isa_assay <- unlist(strsplit(in_isa_assay, split = ":"))
isa_sheets <- list() isa_sheets <- list()
for (i in 2:length(isa_study)) for (i in 2:length(isa_study))
...@@ -76,12 +77,10 @@ isa_merged <- isa_merged[, !apply(isa_merged, 2, function(x) { ...@@ -76,12 +77,10 @@ isa_merged <- isa_merged[, !apply(isa_merged, 2, function(x) {
#### If it does not exist, create out dir #### If it does not exist, create out dir
################################################ ################################################
dir.create(out_folder, recursive = T, showWarnings = F)
dir.create(paste(arc_root, out_folder, sep = "/"), recursive = T, showWarnings = F)
################################################ ################################################
#### Write table to file #### Write table to file
################################################ ################################################
write.table(isa_merged, file = paste(arc_root, out_folder, "merged_isa.tsv", sep = "/"), sep = "\t") write.table(isa_merged, file = paste(out_folder, "merged_isa.tsv", sep = "/"), sep = "\t")
#!/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: merge_isa_metadata.R
arguments:
- position: 0
valueFrom: merge_isa_metadata.R
inputs: inputs:
- id: r_script - id: in_isa_study
type: File type: File
inputBinding:
position: 0
- id: arc_root
type: string
inputBinding: inputBinding:
position: 1 position: 1
- id: in_isa_study
type: string
inputBinding:
position: 2
- id: in_isa_assay - id: in_isa_assay
type: string type: File
inputBinding: inputBinding:
position: 3 position: 2
- id: out_folder - id: out_folder
type: string type: string
inputBinding: inputBinding:
position: 4 position: 3
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