-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnucleotide-transformer.2.inference.windows.sh
57 lines (43 loc) · 1.71 KB
/
nucleotide-transformer.2.inference.windows.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
52
53
54
55
56
#!/bin/bash
#SBATCH --time=1:00:00
#SBATCH --account=quinlan-rw
#SBATCH --partition=quinlan-shared-rw
#SBATCH --output=/scratch/ucgd/lustre-work/quinlan/data-shared/constraint-tools/benchmark-genome-wide-predictions/chen-et-al-2022/enhancer-characteristics-enrichment-subset-inference.log
set -o errexit
set -o pipefail
# set -o noclobber
# set -o xtrace
set -o nounset
source set-environment-variables.sh
filename_prefix="${CONSTRAINT_TOOLS_DATA}/benchmark-genome-wide-predictions/chen-et-al-2022/enhancer-characteristics-enrichment-subset"
windows_filename="${filename_prefix}.bed"
get-header () {
head -1 ${windows_filename}
}
get-body () {
cat ${windows_filename} | tail -n +2
}
window_index=0
while read -r window; do
echo "##############################################"
info "window index:" ${window_index}
directory="${filename_prefix}-inference"
window_filename="${directory}/window-${window_index}.bed"
(
get-header
echo "${window}"
) > ${window_filename}
info "Wrote:" ${window_filename}
info "Submitting job to infer using nucleotide transformer..."
# %j indicates job number (JOBID) and %N indicates first node
# use "sacct -o reqmem,maxrss,averss,elapsed -j JOBID" to determine memory usage over lifetime of job
log_file="${directory}/window-${window_index}-%j-%N.log"
job_name="nucleotide-transformer.window-${window_index}"
sbatch \
--output=${log_file} \
--job-name=${job_name} \
experiments/germline-model/chen-et-al-2022/nucleotide-transformer.2.inference.window.sh \
--directory ${directory} \
--window-index ${window_index}
((++window_index)) # increment before evaluating so that expression never evaluates to zero
done < <(get-body)