-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain-germline-model-production-window-size.sh
71 lines (58 loc) · 2.33 KB
/
train-germline-model-production-window-size.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
#SBATCH --time=8:00:00
#SBATCH --account=quinlan-rw
#SBATCH --partition=quinlan-shared-rw
# https://devhints.io/bash#miscellaneous
# put option-fetching before "set -o nounset" so that we can detect flags without arguments
while [[ "$1" =~ ^- ]]; do
case $1 in
--constraint-tools-directory ) shift; [[ ! $1 =~ ^- ]] && CONSTRAINT_TOOLS=$1;;
--window-size ) shift; [[ ! $1 =~ ^- ]] && window_size=$1;;
*) error "$0: " "$1 is an invalid flag"; exit 1;;
esac
shift
done
set -o errexit
set -o pipefail
set -o nounset
# set -o noclobber
# set -o xtrace
CONSTRAINT_TOOLS_DATA="/scratch/ucgd/lustre-work/quinlan/data-shared/constraint-tools"
PATH=${CONSTRAINT_TOOLS}:$PATH
PATH=${CONSTRAINT_TOOLS}/utilities:$PATH
PATH=${CONSTRAINT_TOOLS}/bin:$PATH
genome="/scratch/ucgd/lustre-work/quinlan/data-shared/constraint-tools/reference/grch38/hg38.analysisSet.fa.gz"
build="hg38"
mutations="/scratch/ucgd/lustre-work/quinlan/data-shared/constraint-tools/gnomad/v3/variants/gnomad_v3.sorted.tsv.gz"
number_chromosomes_min="130000"
kmer_size="7"
progress_bars="disk"
# progress_bars="stdout"
work_directory="work-train-germline-model-production.windowSize-${window_size}"
work_directory_should_be_clean="true"
work="${CONSTRAINT_TOOLS_DATA}/${work_directory}" # path to directory to store intermediate work and logs
if [[ ${work_directory_should_be_clean} == "true" && -d ${work} ]]; then
error "the following work directory already exists:" ${work}
exit 1
else
mkdir --parents ${work}
fi
trustworthy_noncoding_regions_train="${CONSTRAINT_TOOLS}/dist/trustworthy-noncoding-regions-germline-grch38-train.bed.gz"
model="${CONSTRAINT_TOOLS}/dist/model-germline-grch38.windowSize-${window_size}.json"
fetch_subset_of_trustworthy_noncoding_regions_train () {
less ${trustworthy_noncoding_regions_train} | head -10000
}
constraint-tools train-germline-model \
--genome ${genome} \
--build ${build} \
--mutations ${mutations} \
--number-chromosomes-min ${number_chromosomes_min} \
--kmer-size ${kmer_size} \
--model ${model} \
--work ${work} \
--progress-bars ${progress_bars} \
--window-size ${window_size} \
--trustworthy-noncoding-regions ${trustworthy_noncoding_regions_train}
# TESTING:
# --trustworthy-noncoding-regions <(fetch_subset_of_trustworthy_noncoding_regions_train | bgzip) \
# --number-of-jobs 5