-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunArray
More file actions
executable file
·24 lines (21 loc) · 910 Bytes
/
runArray
File metadata and controls
executable file
·24 lines (21 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
GROUP=$1
TOTAL_SAMPLES=$(wc -l /scratch.global/neis/bakeoff/${GROUP}/samples.txt | awk '{print $1}')
CHUNKSIZE=10
DONE_SAMPLES=$(find /scratch.global/neis/bakeoff/${GROUP}/ -name "*FINAL.vcf.gz.tbi" | wc -l)
REMAINING_SAMPLES=$((${TOTAL_SAMPLES} - ${DONE_SAMPLES}))
if [[ -n $2 ]]; then
NUM_CHUNKS=$2
else
NUM_CHUNKS=$(((REMAINING_SAMPLES + CHUNKSIZE - 1) / CHUNKSIZE))
fi
if [[ -n $3 ]]; then
partition=$3
else
partition="amd2tb"
fi
CUR_BATCH=$(sbatch --array=1-${CHUNKSIZE} --parsable -p ${partition} --export=TOTAL_SAMPLES=${REMAINING_SAMPLES},GROUP=${GROUP} rufus_docker.slrm)
for ((i=1; i<NUM_CHUNKS; i++)); do
CUR_BATCH=$(sbatch --array=1-${CHUNKSIZE} --parsable --dependency=aftercorr:${CUR_BATCH} -p ${partition} --export=TOTAL_SAMPLES=${REMAINING_SAMPLES},GROUP=${GROUP} rufus_docker.slrm)
done
sbatch -p pankratz --dependency=afterany:${CUR_BATCH} backup_rufus.slrm