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

wrapped in workflow, moved outputs

parent c6a391d7
No related branches found
No related tags found
No related merge requests found
########################
# Prep data for shiny app
########################
install.packages("openxlsx",dependencies=TRUE, lib='./lib',repos='http://cran.rstudio.com/')
library(openxlsx, lib.loc = "./lib")
options <- commandArgs(trailingOnly = TRUE)
wd <- getwd()
expression_data <- read.csv(file = options[1])
available_genes <- unique(expression_data$target_id)
save(expression_data, available_genes, file = paste0(wd, "/05_shinyPrep.RData"))
#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: CommandLineTool
hints:
DockerRequirement:
dockerPull: rocker/tidyverse:4.1
requirements:
- class: NetworkAccess
networkAccess: true
- class: InlineJavascriptRequirement
- class: InitialWorkDirRequirement
listing:
- entry: "$({class: 'Directory', listing: []})"
entryname: "./lib"
writable: true
baseCommand: Rscript
inputs:
rScript:
type: File
inputBinding:
position: 1
kallistoResults:
type: File
inputBinding:
position: 2
outputs:
outFile:
type: File
outputBinding:
glob: "*05_shinyPrep.RData"
\ No newline at end of file
rScript:
class: File
path: ./05_plot_shinyPrep.R
kallistoResults:
class: File
path: ./../../runs/run1/03_kallisto_df.csv
\ No newline at end of file
File moved
...@@ -6,20 +6,22 @@ ...@@ -6,20 +6,22 @@
# This is supposed to wrap the workflow from kallisto quantification to sleuth diff gene expression # This is supposed to wrap the workflow from kallisto quantification to sleuth diff gene expression
# Execute within <ARC root>/workflows: # Execute within <ARC root>/workflows:
## change rights: `chmod a+x _workflow_wrapper.sh` ## change rights: `chmod a+x kallisto_sleuth_wrapper.sh`
## execute script: `./_workflow_wrapper.sh <run_name> <arc_root>` ## execute script: `./kallisto_sleuth_wrapper.sh <run_name> <arc_root>`
## Example: ./_workflow_wrapper.sh "run1" "~/03DataPLANT_gitlab/samplearc_rnaseq/" ## Example: ./kallisto_sleuth_wrapper.sh "run2" "~/03DataPLANT_gitlab/samplearc_rnaseq/"
run_name=$1 run_name='kallisto_sleuth/'$1
arc_root=$2 arc_root=$2
mkdir $arc_root'/workflows/'$run_name
# chmod a+x 01_KallistoQuant.sh # chmod a+x 01_KallistoQuant.sh
# ./01_KallistoQuant.sh $run_name $arc_root # ./01_KallistoQuant.sh $run_name $arc_root
Rscript 02_InstallPackages.R # Rscript 02_InstallPackages.R
Rscript 03_KallistoCollect.R $run_name $arc_root # Rscript 03_KallistoCollect.R $run_name $arc_root
Rscript 04_Sleuth.R $run_name $arc_root # Rscript 04_Sleuth.R $run_name $arc_root
Rscript 05_plot_shinyPrep.R $run_name $arc_root # Rscript 05_plot_shinyPrep.R $run_name $arc_root
# store variables for test runs in R # store variables for test runs in R
# run_name="run1" # run_name="run1"
......
...@@ -14,8 +14,7 @@ knitr::opts_chunk$set(echo = TRUE) ...@@ -14,8 +14,7 @@ knitr::opts_chunk$set(echo = TRUE)
# Load data # Load data
ARC_root="~/03_DataPLANT_gitlab/samplearc_rnaseq/" load(file = "../runs/run1/05_shinyPrep.RData")
load(file = paste0(ARC_root, 'runs/05_shinyPrep.RData'))
``` ```
...@@ -24,9 +23,9 @@ load(file = paste0(ARC_root, 'runs/05_shinyPrep.RData')) ...@@ -24,9 +23,9 @@ load(file = paste0(ARC_root, 'runs/05_shinyPrep.RData'))
# Setup plot environment # Setup plot environment
required.packages <- c('knitr', 'kableExtra', ## RMarkdown, required.packages <- c('kableExtra', ## RMarkdown,
"shiny", "tidyverse", ## data loading and shaping "shiny", "tidyverse", ## data loading and shaping
"RColorBrewer", "shiny" ## plotting "RColorBrewer" ## plotting
) )
for(package in required.packages) for(package in required.packages)
...@@ -51,7 +50,7 @@ current_selection <- sample(expression_data$target_id, 10) ...@@ -51,7 +50,7 @@ current_selection <- sample(expression_data$target_id, 10)
plot_set <- subset(expression_data, target_id %in% current_selection) plot_set <- subset(expression_data, target_id %in% current_selection)
ggplot(plot_set, aes(x = Group, y = tpm, group = Group)) + ggplot(plot_set, aes(x = Photosynthesis.mode, y = tpm, group = Photosynthesis.mode)) +
stat_summary(fun = 'mean', geom = 'bar') + stat_summary(fun = 'mean', geom = 'bar') +
geom_point(size = 0.5) + geom_point(size = 0.5) +
facet_wrap(~ target_id , scales = "free") + facet_wrap(~ target_id , scales = "free") +
...@@ -87,7 +86,7 @@ sidebarLayout( ...@@ -87,7 +86,7 @@ sidebarLayout(
## Facetted by gene only ## Facetted by gene only
ggplot(plot_set, aes(x = Group, y = tpm)) + ggplot(plot_set, aes(x = Photosynthesis.mode, y = tpm)) +
stat_summary(fun = 'mean', geom = 'bar') + stat_summary(fun = 'mean', geom = 'bar') +
geom_point(size = 0.5) + geom_point(size = 0.5) +
facet_wrap( ~ target_id, scales = "free") + facet_wrap( ~ target_id, scales = "free") +
......
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