-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·93 lines (76 loc) · 2.07 KB
/
Copy pathrun.sh
File metadata and controls
executable file
·93 lines (76 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/env bash
set -euo pipefail
# ================================================
# Constants and Variables
# ================================================
CONDA_NEXTFLOW_ENV="nextflow"
CONDA_R_ENV="P06-r-renv"
rnaseq=""
analysis=""
# ================================================
# Functions
# ================================================
tar_make() {
conda run -n $CONDA_R_ENV Rscript -e 'targets::tar_make()'
}
nextflow_bin() {
conda run -n $CONDA_NEXTFLOW_ENV nextflow "$@"
}
help() {
echo "Usage: ${0} [subcomand]"
echo "subcomands: rnaseq, analysis, help"
echo "subcomands can be stacked"
}
# ================================================
# Parse arguments
# ================================================
if [[ $# == 0 ]]; then
help
exit 1
fi
while [[ $# -gt 0 ]]; do
case $1 in
rnaseq)
rnaseq="true"
shift
;;
analysis)
analysis="true"
shift
;;
help)
help
exit 0
;;
*)
help
exit 1
;;
esac
done
# ================================================
# RNA-seq processing pipeline
# ================================================
# Implemented as Nextflow pipeline
if [[ -n $rnaseq ]]; then
nextflow run . -resume -params-file ./params.yml --rnaseq
fi
# ================================================
# Analysis pipeline
# ================================================
# Mix of R targets workflows and Nextflow pipelines
if [[ -n $analysis ]]; then
TAR_PROJECT=preprocessing tar_make
TAR_PROJECT=transformation tar_make
TAR_PROJECT=loess_residuals tar_make
TAR_PROJECT=shannon_entropy tar_make
TAR_PROJECT=measures_comparison tar_make
TAR_PROJECT=principal_components tar_make
TAR_PROJECT=gene_sets tar_make
TAR_PROJECT=functional_enrichment tar_make
nextflow run . -resume -profile local --chromatin
TAR_PROJECT=chromatin_states tar_make
TAR_PROJECT=gene_features tar_make
nextflow_bin run . -resume -profile local --motifs
TAR_PROJECT=motifs tar_make
fi