-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinstall
More file actions
executable file
·40 lines (31 loc) · 1.11 KB
/
install
File metadata and controls
executable file
·40 lines (31 loc) · 1.11 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
#!/bin/bash
function set_script_dir() {
local ORIG_DIR="$(pwd)" || return 1
local REL_SCRIPT_DIR="$(dirname ${BASH_SOURCE[0]})" || return 1
cd "${REL_SCRIPT_DIR}" || return 1
SCRIPT_DIR="$(pwd)" || return 1
cd "${ORIG_DIR}" || return 1
}
function install_conda() {
conda create --prefix "${CONDA_ENV_PREFIX}" || return 1
conda activate "${CONDA_ENV_PREFIX}" || return 1
conda install --override-channels -c conda-forge -c bioconda --file \
"${SCRIPT_DIR}/conda_requirements.txt" || return 1
# The CFLAGS and CPPFLAGS environment variables will be used when compiling.
# The compile commands can be seen with:
# python -m pip install --verbose .
python -m pip install . || return 1
conda deactivate || return 1
}
function write_conda_wrapper_config() {
local CONFIG_PATH="${SCRIPT_DIR}/snakemake_config.yaml"
echo "conda_wrapper: '${SCRIPT_DIR}/conda_wrapper'" \
>> "${CONFIG_PATH}" || return 1
}
function main() {
set_script_dir || return 1
source "${SCRIPT_DIR}/set_env_vars.sh" || return 1
install_conda || return 1
write_conda_wrapper_config || return 1
}
main "$@"