Skip to content

Commit

Permalink
refactor: simplify bin/redirect (#179)
Browse files Browse the repository at this point in the history
* refactor: simplify bin/redirect

* fix: remove newline at head of file

the shebang needs to be the first line
  • Loading branch information
kelly-sovacool authored Dec 2, 2024
1 parent 308d82d commit ee1a9e4
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions bin/redirect
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,18 @@ TOOLDIR=$(dirname "$SCRIPTDIRNAME")
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
. "/data/CCBR_Pipeliner/db/PipeDB/Conda/etc/profile.d/conda.sh" && conda activate py311
module load singularity snakemake/7
elif [[ $hpc_name == fnlcr ]]; then
. "/mnt/projects/CCBR-Pipelines/resources/miniconda3/etc/profile.d/conda.sh"
conda activate py311
. "/mnt/projects/CCBR-Pipelines/resources/miniconda3/etc/profile.d/conda.sh" && conda activate py311
module load singularity
export PATH="/mnt/projects/CCBR-Pipelines/bin:$PATH"
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}/main.py "$@" || true

0 comments on commit ee1a9e4

Please sign in to comment.