Skip to content

Commit

Permalink
refactor: use bin/redirect from xavier
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool committed Sep 10, 2024
1 parent 228d5cd commit ad46fdf
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 8 deletions.
8 changes: 0 additions & 8 deletions bin/carlisle

This file was deleted.

1 change: 1 addition & 0 deletions bin/carlisle
50 changes: 50 additions & 0 deletions bin/redirect
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}/main.py "$@" || true

0 comments on commit ad46fdf

Please sign in to comment.