-
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.
refactor: setup bin/redirect to match other pipelines
- Loading branch information
1 parent
454ef34
commit a7bc184
Showing
2 changed files
with
51 additions
and
0 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 @@ | ||
./redirect |
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,50 @@ | ||
#!/usr/bin/env bash | ||
# This is a wrapper for the pipeline script | ||
# It: | ||
# - loads require modules and conda environments | ||
# - parses the variables directly to the python script | ||
|
||
SCRIPTDIRNAME=$(readlink -f $(dirname "$BASH_SOURCE")) | ||
|
||
# add "bin" to PATH | ||
if [[ ":$PATH:" != *":${SCRIPTDIRNAME}:"* ]];then | ||
export PATH=${PATH}:${SCRIPTDIRNAME} | ||
fi | ||
|
||
TOOLDIR=$(dirname "$SCRIPTDIRNAME") | ||
|
||
# find out if you are running on biowulf or frce | ||
hpc_name=$(scontrol show config | grep ClusterName | sed "s/^.*= //") | ||
# load conda | ||
if [[ $hpc_name == biowulf ]]; then | ||
. "/data/CCBR_Pipeliner/db/PipeDB/Conda/etc/profile.d/conda.sh" | ||
conda activate py311 | ||
elif [[ $hpc_name == fnlcr ]]; then | ||
. "/mnt/projects/CCBR-Pipelines/resources/miniconda3/etc/profile.d/conda.sh" | ||
conda activate py311 | ||
else | ||
echo "You are NOT running on BIOWULF or on FRCE" | ||
echo "Please make sure that:" | ||
echo " - py311 conda environment is activated" | ||
echo " - singularity is in PATH" | ||
echo " - snakemake is in PATH" | ||
fi | ||
# if not on biowulf or frce then | ||
# use py311.environment.yml in resources folder to create the py311 conda environment | ||
# and load py311 | ||
|
||
# load required modules | ||
# if running somewhere other than biowulf or frce, then ensure that | ||
# - singularity | ||
# - snakemake | ||
# are in PATH | ||
if [[ $hpc_name == biowulf ]];then | ||
module load singularity snakemake/7 | ||
elif [[ $hpc_name == fnlcr ]];then | ||
# snakemake module on FRCE does not work as expected | ||
# use the conda installed version of snakemake instead | ||
module load singularity | ||
export PATH="/mnt/projects/CCBR-Pipelines/bin:$PATH" | ||
fi | ||
|
||
${TOOLDIR}/charlie "$@" || true |