-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from Phil9S/dev
development branch - issue resolutions
- Loading branch information
Showing
11 changed files
with
119 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
logs/* | ||
.snakemake/ | ||
profile/slurm/__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ dependencies: | |
- r-foreach=1.5.0 | ||
- bioconductor-qdnaseq | ||
- bioconductor-qdnaseq.hg19 | ||
- r-remotes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,104 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
script="install_env" | ||
# VARS | ||
INSTALL_BIN="mamba" | ||
CONDA_VERSION=4.8.2 | ||
MICROMAMBA_VERSION=1.3.1 | ||
CONDA_VERSION_N=$(sed 's/\.//g' <<< "${CONDA_VERSION}") | ||
MICROMAMBA_VERSION_N=$(sed 's/\.//g' <<< "${MICROMAMBA_VERSION}") | ||
INSTALLED_CONDA_VERSION=$(conda -V | sed 's/conda //' | sed 's/\.//g') | ||
INSTALLED_MICROMAMBA_VERSION=$(micromamba --version | sed 's/conda //' | sed 's/\.//g') | ||
|
||
# Check conda available | ||
if ! [ -x "$(command -v conda)" ]; then | ||
echo -e "[${script}] Error: conda has not been installed or is not available on PATH" | ||
## Default behaviour | ||
if [[ $# -eq 0 ]]; then | ||
echo -e "[${script}] No arguments given. Specify a environment bin; mamba or conda." | ||
exit 1 | ||
fi | ||
|
||
# Check conda version (rudamentary) | ||
if [ "${INSTALLED_CONDA_VERSION}" -lt "${CONDA_VERSION_N}" ]; then | ||
echo -e "[${script}] Error - conda/miniconda is older than the required version" | ||
echo -e "[${script}] Required: conda ${CONDA_VERSION} / Installed: $(conda -V)" | ||
exit | ||
fi | ||
#echo -e "${MICROMAMBA_VERSION}" | ||
#echo -e "${MICROMAMBA_VERSION_N}" | ||
#echo -e "${INSTALLED_MICROMAMBA_VERSION}" | ||
|
||
if [ $1 == "mamba" ]; then | ||
# Check MICROMAMBA available | ||
if ! [ -x "$(command -v micromamba)" ]; then | ||
echo -e "[${script}] Error: micromamba has not been installed or is not available on \$PATH" | ||
exit 1 | ||
fi | ||
|
||
# Check micromamba version (rudamentary) | ||
if [ "${INSTALLED_MICROMAMBA_VERSION}" -lt "${MICROMAMBA_VERSION_N}" ]; then | ||
echo -e "[${script}] Error - micromamba is older than the required version" | ||
echo -e "[${script}] Required: ${MICROMAMBA_VERSION} / Installed: $(micromamba --version)" | ||
exit 1 | ||
fi | ||
|
||
echo -e "[${script}] Creating env" | ||
# micromamba install | ||
micromamba env create -y -f config/conda.yaml | ||
eval "$(micromamba shell hook --shell=bash)" | ||
micromamba activate swgs-abscn | ||
|
||
elif [ $1 == "conda" ]; then | ||
# Check conda available | ||
if ! [ -x "$(command -v conda)" ]; then | ||
echo -e "[${script}] Error: conda has not been installed or is not available on PATH" | ||
exit 1 | ||
fi | ||
|
||
# Check provided conda directory | ||
if [ "$#" -lt 1 ]; then | ||
echo -e "[${script}] Error - conda/miniconda directory missing" | ||
echo -e "[${script}] Usage example './install_env.sh /home/user/miniconda3/'" | ||
# Check conda version (rudamentary) | ||
if [ "${INSTALLED_CONDA_VERSION}" -lt "${CONDA_VERSION_N}" ]; then | ||
echo -e "[${script}] Error - conda/miniconda is older than the required version" | ||
echo -e "[${script}] Required: ${CONDA_VERSION} / Installed: $(conda -V)" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
# Check provided conda directory | ||
if [ "$#" -lt 2 ]; then | ||
echo -e "[${script}] Error - conda/miniconda directory missing" | ||
echo -e "[${script}] Usage example './install_env.sh /home/user/miniconda3/'" | ||
exit 1 | ||
fi | ||
|
||
# Set conda directory | ||
CONDA_DIR=$1 | ||
# conda install | ||
# Set conda directory | ||
if ! [ -d "$2" ]; then | ||
echo -e "[${script}] Error - conda/miniconda directory not correct" | ||
echo -e "[${script}] Usage example './install_env.sh conda /home/user/miniconda3/'" | ||
exit 1 | ||
else | ||
CONDA_DIR=$2 | ||
fi | ||
conda env create -f config/conda.yaml | ||
DIR=${CONDA_DIR}etc/profile.d/conda.sh | ||
if [ -f "${DIR}" ]; then | ||
echo -e "[${script}] Initialising conda env" | ||
source ${CONDA_DIR}etc/profile.d/conda.sh | ||
else | ||
echo -e "[${script}] Error: Unable to find conda intialisation script" | ||
echo -e "[${script}] Error: Make sure to provide the miniconda directory - e.g. '/home/user/miniconda3/'" | ||
echo -e "[${script}] Usage example './install_env.sh /home/user/miniconda3/'" | ||
exit 1 | ||
fi | ||
conda activate swgs-abscn | ||
|
||
echo -e "[${script}] Creating conda env" | ||
conda env create -f config/conda.yaml | ||
DIR=${CONDA_DIR}etc/profile.d/conda.sh | ||
if [ -f "${DIR}" ]; then | ||
echo -e "[${script}] Initialising conda env" | ||
source ${CONDA_DIR}etc/profile.d/conda.sh | ||
else | ||
echo -e "[${script}] Error: Unable to find conda intialisation script" | ||
echo -e "[${script}] Error: Make sure to provide the miniconda directory - e.g. '/home/user/miniconda3/'" | ||
echo -e "[${script}] Usage example './install_env.sh /home/user/miniconda3/'" | ||
exit | ||
echo -e "[${script}] Error - neither mamba or conda specified" | ||
exit 1 | ||
fi | ||
|
||
echo -e "[${script}] Activating conda env" | ||
conda activate swgs-abscn | ||
echo -e "[${script}] Adding modified QDNAseq package" | ||
R_LIB_PATH=$(Rscript resources/libpath.R) | ||
cp -r resources/packages/QDNAseqmod/ ${R_LIB_PATH} | ||
echo -e "[${script}] Installing modified QDNAseq package" | ||
Rscript -e 'remotes::install_github(repo = "markowetzlab/QDNAseqmod",quiet=TRUE,upgrade=FALSE)' | ||
echo -e "[${script}] Testing package installation" | ||
Rscript resources/package_load.R | ||
echo -e "[${script}] conda env ready and all packages installed!" | ||
echo -e "[${script}] env ready and all packages installed!" | ||
if [ $1 == "mamba" ]; then | ||
echo -e "[${script}] activate with 'micromamba activate swgs-abscn'" | ||
else | ||
echo -e "[${script}] activate with 'conda activate swgs-abscn'" | ||
fi | ||
|
||
# END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
jobs: 200 | ||
jobs: 100 | ||
jobscript: slurm-jobscript.sh | ||
cluster: slurm-submit.py | ||
local-cores: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters