Skip to content
Snippets Groups Projects
Commit c1eb7ee4 authored by Dominik Brilhaus's avatar Dominik Brilhaus
Browse files

cwl kallisto sleuth

parent 283b1086
No related branches found
No related tags found
No related merge requests found
# cwltool README
## First cd into the (runs) folder, with the .yml file
cd /Users/dominikbrilhaus/03_DataPLANT_gitlab/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
```
cores: 1
r_script:
class: File
path: ../../workflows/kallisto_sleuth.R
in_sleuth: runs/kallisto_collect/kallisto_sleuthObject.RData
out_folder: runs/kallisto_sleuth
arc_root: /Users/dominikbrilhaus/03_DataPLANT_gitlab/samplearc_rnaseq
\ No newline at end of file
This diff is collapsed.
#!/usr/bin/env Rscript
################################################
### Diff. gene expression with sleuth ##########
################################################
################################################
#### Test area (Within R)
################################################
# arc_root <- "~/03_DataPLANT_gitlab/samplearc_rnaseq/"
# in_sleuth <- "runs/kallisto_collect/kallisto_sleuthObject.RData"
# out_folder <- "runs/kallisto_sleuth"
################################################
#### 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]
################################################
#### If it does not exist, create out dir
################################################
dir.create(paste(arc_root, out_folder, sep = "/"), recursive = T, showWarnings = F)
################################################
#### Load sleuth object
################################################
load(file = paste(arc_root, in_sleuth, sep = "/"))
################################################
#### Run sleuth fit
################################################
so <- sleuth_fit(so)
so <- sleuth_fit(so, ~condition, "full")
so <- sleuth_fit(so, ~1, "reduced")
so <- sleuth_lrt(so, "reduced", "full")
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)
#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: CommandLineTool
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
outputs:
- id: outdir
type:
type: array
items: Directory
outputBinding:
glob: $(runtime.outdir)/$(inputs.out_folder)
baseCommand:
- Rscript
\ No newline at end of file
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