forked from ljdursi/consensus_call_docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wrapper.sh
executable file
·62 lines (53 loc) · 1.55 KB
/
wrapper.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
#!/bin/bash
readonly COMMAND=$1
readonly SUBCOMMAND=$2
readonly EXECUTABLE_PATH=${USE_EXECUTABLE_PATH:-"/usr/local/bin"}
function usage {
echo >&2 "$0: execute a command from the docker. "
echo >&2 " options: "
echo >&2 " consensus snv [opts]: make consensus SNV calls"
echo >&2 " consensus indel [opts]: make consensus indel calls"
echo >&2 " filter {type} [opts]: filter consensus calls"
echo >&2 " download reference /dbs/path: download, install pancan reference"
echo >&2 " download annotations /dbs/path: download, install annotations"
exit 1
}
###
### Make sure options are valid
###
if [[ -z "${COMMAND}" ]] || [[ -z "${SUBCOMMAND}" ]]
then
echo >&2 "Missing arguments."
usage
fi
if [[ "${COMMAND}" != "consensus" ]] && [[ "${COMMAND}" != "filter" ]] && [[ "${COMMAND}" != "download" ]]
then
echo >&2 "Invalid command ${COMMAND}."
usage
fi
###
### if $COMMAND is consensus, run consensus step:
###
if [[ "${COMMAND}" == "consensus" ]]
then
if [[ "${SUBCOMMAND}" != "snv" ]] && [[ "${SUBCOMMAND}" != "indel" ]]
then
echo >&2 "Invalid variant type ${SUBCOMMAND}"
usage
fi
"${EXECUTABLE_PATH}/consensus_${SUBCOMMAND}.sh" "${@:3}"
fi
###
### if $COMMAND is download, download the data
###
if [[ "${COMMAND}" == "download" ]]
then
"${EXECUTABLE_PATH}/build_dbs.sh" "${@:2}"
fi
###
### if $COMMAND is filter, run the appropriate filter step
###
if [[ "${COMMAND}" == "filter" ]]
then
"${EXECUTABLE_PATH}/filter/additional_filters.sh" "${@:2}"
fi