Skip to content

Commit

Permalink
Merge pull request #3 from RIVM-bioinformatics/hotfix_mamba_install
Browse files Browse the repository at this point in the history
Hotfix mamba install
  • Loading branch information
boasvdp authored Jun 9, 2023
2 parents 6491a0c + c0863e6 commit 3b204b7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
File renamed without changes.
41 changes: 25 additions & 16 deletions run_pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,34 @@ esac


#----------------------------------------------#
# Create/update necessary environments
PATH_MAMBA_YAML="envs/mamba.yaml"
PATH_MASTER_YAML="envs/juno_amr_master.yaml"
MAMBA_NAME=$(head -n 1 ${PATH_MAMBA_YAML} | cut -f2 -d ' ')
MASTER_NAME=$(head -n 1 ${PATH_MASTER_YAML} | cut -f2 -d ' ')
## make sure conda works

echo -e "\nUpdating necessary environments to run the pipeline..."

# Removing strict mode because it sometimes breaks the code for
# activating an environment and for testing whether some variables
# are set or not
set +euo pipefail
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/mnt/miniconda/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/mnt/miniconda/etc/profile.d/conda.sh" ]; then
. "/mnt/miniconda/etc/profile.d/conda.sh"
else
export PATH="/mnt/miniconda/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<export -f conda
export -f __conda_activate
export -f __conda_reactivate
export -f __conda_hashr

conda env update -f "${PATH_MAMBA_YAML}"
source activate "${MAMBA_NAME}"

mamba env update -f "${PATH_MASTER_YAML}"
#----------------------------------------------#
# Create the environment

source activate "${MASTER_NAME}"
# we can use the base installation of mamba to create the environment.
# Swapping to a parent env is not necessary anymore.
mamba env create -f envs/master_env.yaml --name pipeline_env
conda activate pipeline_env

#----------------------------------------------#
# Run the pipeline
Expand All @@ -85,7 +94,7 @@ fi

set -euo pipefail

python juno-amr.py --queue "${QUEUE}" -i "${input_dir}/clean_fastq/" -o "${output_dir}" -s "${GENUS_ALL}"
python juno_amr.py --queue "${QUEUE}" -i "${input_dir}/clean_fastq/" -o "${output_dir}" -s "${GENUS_ALL}"

result=$?

Expand Down

0 comments on commit 3b204b7

Please sign in to comment.