-
Notifications
You must be signed in to change notification settings - Fork 5
/
init.sh
74 lines (58 loc) · 2.21 KB
/
init.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
#==================================
# This file defines necessary environment variables.
# Feel free to modify them if you know what you are doing.
# Comment out the line below to include RNA folding features and SilVA's
# dependency on UNAfold/ViennaRNA:
export EXCLUDE_RNA_FOLDING=1
if [[ ! -z "${EXCLUDE_RNA_FOLDING:-}" ]]; then
echo "EXCLUDE_RNA_FOLDING=${EXCLUDE_RNA_FOLDING}... excluding RNA folding features." >&2
controldir=control/no-folding
else
controldir=control/folding
fi
# Maximum number of threads to use
export SILVA_N_THREADS="${SILVA_N_THREADS:-8}"
# Path to the root of the SilVA directory.
export SILVA_PATH="${SILVA_PATH:-$(cd -P $(dirname $0); pwd)}"
# Control dataset to use
export SILVA_CONTROL="${SILVA_CONTROL:-$SILVA_PATH/$controldir/NA10851}"
# Directory of pre-trained models
export SILVA_TRAINED="${SILVA_TRAINED:-$SILVA_PATH/$controldir/models}"
# Directory to use for any temporary files. It's recommended that this point
# to somewhere on the local machine (such as /tmp).
export TMPDIR="${TMPDIR:-$(pwd)}"
# SilVA ignores variants with 1000 Genomes Project allele frequencies
# less than SILVA_AF_MIN or greater than SILVA_AF_MAX.
# Both should be in [0--1], suggested: MIN: 0 and MAX: 0.05, respectively
export SILVA_AF_MIN="${SILVA_AF_MIN:-0}"
export SILVA_AF_MAX="${SILVA_AF_MAX:-0.05}"
# Used to initialize the logging sensitivity of the python logger
# Set to "DEBUG" for more logs, "WARNING" for fewer
export SILVA_LOG_LEVEL="${SILVA_LOG_LEVEL:-INFO}"
#==================================
version="$(cat ${SILVA_PATH}/VERSION)"
function init_message {
cat >&2 <<EOF
SILVA $version
-----------
COMMAND: '$@'
SILVA_N_THREADS: '$SILVA_N_THREADS'
SILVA_CONTROL: '$SILVA_CONTROL'
SILVA_TRAINED: '$SILVA_TRAINED'
SILVA_AF_MIN: '$SILVA_AF_MIN'
SILVA_AF_MAX: '$SILVA_AF_MAX'
SILVA_LOG_LEVEL: '$SILVA_LOG_LEVEL'
TMPDIR: '$TMPDIR'
-----------
EOF
}
if [[ ! -e $SILVA_PATH/data/refGene.ucsc.gz ]]; then
cat >&2 <<EOF
Annotation databases seem to be missing.
File does note exist: $SILVA_PATH/data/refGene.ucsc.gz
Please run the setup.sh script in this tool's root directory
and make sure all necessary data files are in $SILVA_PATH/data/
EOF
exit 1
fi