-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_preprocessing.sh
executable file
·48 lines (41 loc) · 1.05 KB
/
run_preprocessing.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
# Copyright (C) 2022 Roberto Rossini <roberros@uio.no>
#
# SPDX-License-Identifier: MIT
set -e
set -u
set -o pipefail
set -x
function run_workflow() {
name="$1"
if [[ $HOSTNAME == *.saga* ]]; then
base_config='configs/base_saga.config'
args=("${@:2}"
--max_memory=400.G
--max_cpus=52
--max_time=336.h
--project="${SLURM_PROJECT_ID-changeme}")
else
base_config='configs/base_hovig.config'
args=("${@:2}")
fi
ln -sf ../configs/ configs
ln -sf ../containers/ containers
ln -sf ../data/ data
ln -sf ../scripts/ scripts
ln -sf ../workflows/ workflows
nextflow run \
"${args[@]}" \
-c "configs/$name.config" \
-c "$base_config" \
"workflows/$name.nf" \
-process.cache=deep \
-ansi-log \
-resume
}
step='preprocess_data'
echo 1>&2 "Running step $step..."
wd=".nextflow-$step-wd"
mkdir -p "$wd"
(cd "$wd" && run_workflow "$step")
echo 1>&2 "Workflow \"$step\" successfully completed!"