-
Notifications
You must be signed in to change notification settings - Fork 67
/
run-pipe.sh
executable file
·32 lines (26 loc) · 1.39 KB
/
run-pipe.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# Wrappers around Snakemake for use on the Broad UGER cluster
# determine the directory of this script
SCRIPT_DIRECTORY=$(dirname $(readlink --canonicalize-existing $0))
# load necessary Broad dotkits
source /broad/software/scripts/useuse
reuse -q UGER
reuse -q Python-3.4
# load config dirs from config.yaml. After using the conda dotkit, we should have PyYAML
CONDAENVDIR=`python -c "import yaml, os;f=open(\"config.yaml\");print(os.path.realpath(yaml.safe_load(f)['conda_env_dir']));f.close()"`
MINICONDADIR=`python -c 'import yaml; import os; f=open("config.yaml");print(os.path.realpath(yaml.safe_load(f)["miniconda_dir"]));f.close()'`
BINDIR=`python -c "import yaml, os;f=open(\"config.yaml\");print(os.path.realpath(yaml.safe_load(f)['bin_dir']));f.close()"`
DATADIR=`python -c "import yaml, os; f=open(\"config.yaml\");print(os.path.realpath(yaml.safe_load(f)['data_dir']));f.close()"`
unuse Python-3.4
export PATH="$MINICONDADIR/bin:$PATH"
# load conda environment
source activate "$CONDAENVDIR"
# invoke Snakemake in cluster mode with custom wrapper scripts
snakemake --timestamp --rerun-incomplete --keep-going --nolock \
--jobs 90 --immediate-submit \
--latency-wait 60 \
--config mode=UGER \
--directory . \
--jobscript "$BINDIR/pipes/Broad_UGER/jobscript.sh" \
--cluster $BINDIR'/pipes/Broad_UGER/cluster-submitter.py {dependencies} {config[log_dir]}' \
"$@"