-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathrun_snakemake.sh
executable file
·30 lines (24 loc) · 1.08 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
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Config file is required."
exit 1
fi
LOG_FOLDER=$(grep log_folder "$1" | awk -F":" '{print $2}')
mkdir -p "$LOG_FOLDER"
WD=$(grep wd "$1" | awk -F":" '{print $2}')
GENOME=$(grep genome_path "$1" | awk -F":" '{print $2}' |xargs dirname)
BISMARK_IDX=$(grep bismark_index_path "$1" | awk -F":" '{print $2}' |xargs dirname)
ANNOTATION=$(grep annotation_file "$1" | awk -F":" '{print $2}' |xargs dirname)
TMP_FOLDER=$(grep tmp_folder "$1" | awk -F":" '{print $2}')
PATHS="$WD,$ANNOTATION,$GENOME,$BISMARK_IDX,$TMP_FOLDER"
PATHS=$(echo $PATHS |sed 's/ //g')
SBATCH="sbatch -J {cluster.jobname} --partition={cluster.partition} --mem={cluster.mem} --time={cluster.time} --cpus-per-task={cluster.cpus} -e ${LOG_FOLDER%/}/{cluster.log} -o ${LOG_FOLDER%/}/{cluster.log}"
snakemake -r -p -j 100 --configfile "$1" \
--cluster "$SBATCH" \
--cluster-config cluster-config/cluster.json \
--latency-wait 120 \
--rerun-incomplete \
--use-singularity \
--singularity-args "--bind $PATHS" \
--rerun-incomplete
# --jobscript jobscripts/narvi.sh \