sbatch.sh 823 Bytes
Newer Older
Valentina Galata's avatar
Valentina Galata committed
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash -l

# slurm settings if called using sbatch
#SBATCH -J ONT_SMK
#SBATCH -N 1
#SBATCH -n 1
#SBATCH -c 1
#SBATCH --time=5-00:00:00
#SBATCH -p batch
#SBATCH -q long

# conda env name or path
Valentina Galata's avatar
Valentina Galata committed
13
SMK_ENV=$1
14
15
# where to create snakemake's conda env.s (path)
SMK_CONDA=$2
Valentina Galata's avatar
Valentina Galata committed
16
# config files
Valentina Galata's avatar
Valentina Galata committed
17
18
SMK_CONFIG="config/aquifer/config.yaml"
SMK_SLURM="config/aquifer/slurm.yaml"
Valentina Galata's avatar
Valentina Galata committed
19
20
21
22
23
# slurm cluster call
SMK_CLUSTER="sbatch --partition {cluster.partition} {cluster.qos} {cluster.explicit} --nodes {cluster.nodes} \
--ntasks {cluster.ntasks} --cpus-per-task {threads} --time {cluster.time} --job-name={cluster.job-name}"

conda activate ${SMK_ENV} && \
24
snakemake -s workflow/Snakefile -rp --jobs 7 --local-cores 1 \
Valentina Galata's avatar
Valentina Galata committed
25
--configfile ${SMK_CONFIG} --use-conda --conda-prefix ${SMK_CONDA} \
Valentina Galata's avatar
Valentina Galata committed
26
--cluster-config ${SMK_SLURM} --cluster "${SMK_CLUSTER}"