-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.astra.sh
55 lines (46 loc) · 1.17 KB
/
run.astra.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
49
50
51
52
53
54
55
#!/usr/bin bash
#
# ASTRA launcher
#
usage="$(basename "$0") [-h] [-p \"parameters\"]
where:
-h show this help text
-p snakemake parameters as \"--rerun-incomplete --dryrun --keep-going --profile label_of_cluster_profile\"
"
while getopts ':h:p:' option; do
case "$option" in
h) echo "$usage"
exit
;;
p) SM_PARAMETERS=$OPTARG
;;
:) printf "missing argument for -%s\n" "$OPTARG" >&2
echo "$usage" >&2
exit 1
;;
\?) printf "illegal option: -%s\n" "$OPTARG" >&2
echo "$usage" >&2
exit 1
;;
*) echo "$usage"
exit
esac
done
shift $((OPTIND - 1))
WORKDIR=$(pwd)
CFGFILE="${WORKDIR}/config/config.yaml"
REFFILE=$(yq -Y '.resources.reference' "${CFGFILE}")
BEDFILE=$(yq -Y '.resources.regions' "${CFGFILE}")
OUTDIR=$(yq -Y '.paths.results_dir' "${CFGFILE}")
REFDIR=$(dirname "$REFFILE")
BEDDIR=$(dirname "$BEDFILE")
OUTDIR=$(dirname "$OUTDIR")
snakemake \
--use-conda \
--use-apptainer \
--apptainer-args " --bind ${OUTDIR} --bind ${REFDIR} --bind ${BEDDIR} " \
--printshellcmds \
--restart-times 1 \
--latency-wait 120 \
--jobname "astra.{rulename}.{jobid}" \
${SM_PARAMETERS}