-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_snakemake.sh
51 lines (45 loc) · 1.42 KB
/
run_snakemake.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
#!/bin/bash
#SBATCH -p compute
#SBATCH -N 1
#SBATCH -n 1
#SBATCH --cpus-per-task 4
#SBATCH -o cluster_logs/slurm-%x-%j-%N.out
umask 002
BATCH=$1
BIOSAMPLES=$2
CCSREADS=$3
TARGETS=$4
PROBES=${5:-None}
if [ -z $3 ] || [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
echo -e "\nUsage: sbatch $(basename $0) <batch_name> <biosample_csv> <hifi_reads> <target_bed> [<probe_bed>]\n"
exit 0
fi
mkdir -p "batches/${BATCH}/"
LOCKFILE="batches/${BATCH}/process_batch.lock"
# add lockfile to directory to prevent multiple simultaneous jobs
lockfile -r 0 "${LOCKFILE}" || exit 1
trap "rm -f ${LOCKFILE}; exit" SIGINT SIGTERM ERR EXIT
# execute snakemake
snakemake --reason \
--rerun-incomplete \
--keep-going \
--printshellcmds \
--configfile workflow/config.yaml \
--config batch="${BATCH}" \
biosamples="${BIOSAMPLES}" \
ccsReads="${CCSREADS}" \
targets="${TARGETS}" \
probes="${PROBES}" \
scripts=workflow/scripts \
--nolock \
--local-cores 4 \
--jobs 750 \
--max-jobs-per-second 1 \
--use-conda --conda-frontend mamba \
--use-singularity --singularity-args '--nv ' \
--latency-wait 300 \
--cluster-config workflow/cluster.yaml \
--cluster "sbatch --partition={cluster.partition} \
--cpus-per-task={cluster.cpus} \
--output={cluster.out} {cluster.extra} " \
--snakefile workflow/Snakefile