forked from youngjun0827/assembly_qc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruncluster
executable file
·31 lines (23 loc) · 985 Bytes
/
runcluster
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
#!/usr/bin/env bash
# Usage: ./runsnake 30
# Get directory where the script is located
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
SOURCE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# Load miniconda
module load miniconda/4.12.0
# Init
mkdir -p log
# Get jobs
JOB_COUNT=$1
shift
# Run
snakemake --jobname "{rulename}.{jobid}" --drmaa " -V -cwd -j y -o ./log -e ./log -l h_rt={resources.hrs}:00:00 -l mfree={resources.mem}G -pe serial {threads} -w n -S /bin/bash" -w 60 \
-s ${SOURCE_DIR}/Snakefile -j ${JOB_COUNT} \
--printshellcmds --keep-going --rerun-incomplete --latency-wait 30 \
--use-singularity --singularity-args "--bind /net:/net" \
"$@"