-
Notifications
You must be signed in to change notification settings - Fork 0
/
intogen.sh
74 lines (63 loc) · 1.55 KB
/
intogen.sh
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
#!/usr/bin/env bash
set -e
# This helper script is meant to be used by BBGLab member only
SRC_FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
function run() {
nextflow run {SRC_FOLDER}/intogen.nf --input "$@" --output intogen_{today} --debug true -profile bbglab -resume --containers {SRC_FOLDER}/containers --datasets {SRC_FOLDER}/datasets --annotations ${PWD}/annotations.txt
}
function test() {
# Must be executed within this directory
nextflow run intogen.nf --input ${PWD}/test/pipeline/input/cbioportal_prad_broad --output test/output --debug true -profile bbglab -resume
}
function clean() {
rm -r .nextflow*
rm -r work
rm trace.txt*
rm timeline.html*
}
function prepare() {
folder=${1:-.} # use current folder if not present
mkdir -p ${folder}
cp ${SRC_FOLDER}/config/annotations.txt ${folder}
cp ${SRC_FOLDER}/intogen.sh ${folder}
sed -e "s@{SRC_FOLDER}@${SRC_FOLDER}@g" -i ${folder}/intogen.sh
today=`date +%Y%m%d`
sed -e "s@{today}@${today}@g" -i ${folder}/intogen.sh
}
function usage()
{
echo "-h | --help"
echo ""
echo "clean|run|test|prepare"
}
while (( "$#" ))
do
case "$1" in
-h | --help)
usage
exit
;;
run)
run "${@:2}"
exit
;;
test)
test
exit
;;
clean)
clean
exit
;;
prepare)
prepare "${@:2}"
exit
;;
*)
echo "ERROR: unknown parameter \"$1\""
usage
exit 1
;;
esac
shift
done