-
Notifications
You must be signed in to change notification settings - Fork 7
/
dadicli_run_readme.sh
165 lines (143 loc) · 7.97 KB
/
dadicli_run_readme.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#!/bin/bash -l
#SBATCH --account=rgutenk
#SBATCH --qos=user_qos_rgutenk
#SBATCH --partition=high_priority
#SBATCH --job-name="test_readme_full"
#SBATCH --output=%x-%j.out
#SBATCH --nodes=1
#SBATCH --ntasks=5
###SBATCH --ntasks-per-node=50
#SBATCH --time=24:00:00
rm -r ./examples/results/*
mkdir ./examples/results/fs
mkdir ./examples/results/fs/bootstrapping_syn
mkdir ./examples/results/fs/bootstrapping_non
mkdir ./examples/results/demo
mkdir ./examples/results/caches
mkdir ./examples/results/dfe
mkdir ./examples/results/plots
mkdir ./examples/results/stat
#
echo Generate synonymous SFS
#
time dadi-cli GenerateFs --vcf ./examples/data/1KG.YRI.CEU.biallelic.synonymous.snps.withanc.strict.vcf.gz \
--pop-info ./examples/data/1KG.YRI.CEU.popfile.txt --pop-ids YRI CEU --projections 20 20 --polarized \
--output ./examples/results/fs/1KG.YRI.CEU.20.synonymous.snps.unfold.fs
#
echo Generate nonsynonymous SFS
#
time dadi-cli GenerateFs --vcf ./examples/data/1KG.YRI.CEU.biallelic.nonsynonymous.snps.withanc.strict.vcf.gz \
--pop-info ./examples/data/1KG.YRI.CEU.popfile.txt --pop-ids YRI CEU --projections 20 20 --polarized \
--output ./examples/results/fs/1KG.YRI.CEU.20.nonsynonymous.snps.unfold.fs
#
echo Infer split migration demographic model
#
time dadi-cli InferDM --fs ./examples/results/fs/1KG.YRI.CEU.20.synonymous.snps.unfold.fs --model split_mig --misid \
--p0 1 1 .5 1 .5 --ubounds 10 10 1 10 1 --lbounds 10e-3 10e-3 10e-3 10e-3 10e-5 --grids 60 70 80 \
--output ./examples/results/demo/1KG.YRI.CEU.20.split_mig.demo.params --optimizations 100 --maxeval 200 \
--global-optimization
#
echo Command to make .bestfits file
#
time dadi-cli BestFit --input-prefix ./examples/results/demo/1KG.YRI.CEU.20.split_mig.demo.params.InferDM \
--model split_mig --misid
#
echo Generate cache with shared population-scaled selection coefficients
#
time dadi-cli GenerateCache --model split_mig --single-gamma \
--demo-popt ./examples/results/demo/1KG.YRI.CEU.20.split_mig.demo.params.InferDM.bestfits \
--misid --sample-size 20 20 --grids 60 70 80 --gamma-pts 10 --gamma-bounds 1e-4 200 \
--output ./examples/results/caches/1KG.YRI.CEU.20.split_mig.sel.single.gamma.spectra.bpkl --mp
#
echo Generate cache with independent population-scaled selection coefficients
#
time dadi-cli GenerateCache --model split_mig \
--demo-popt ./examples/results/demo/1KG.YRI.CEU.20.split_mig.demo.params.InferDM.bestfits \
--misid --sample-size 20 20 --grids 60 70 80 --gamma-pts 10 --gamma-bounds 1e-4 200 \
--output ./examples/results/caches/1KG.YRI.CEU.20.split_mig.sel.spectra.bpkl --mp
#
echo Infer DFE that is a mixture of lognormal and bivariate lognormal
#
time dadi-cli InferDFE --fs ./examples/results/fs/1KG.YRI.CEU.20.nonsynonymous.snps.unfold.fs \
--cache1d ./examples/results/caches/1KG.YRI.CEU.20.split_mig.sel.single.gamma.spectra.bpkl \
--cache2d ./examples/results/caches/1KG.YRI.CEU.20.split_mig.sel.spectra.bpkl \
--misid --pdf1d lognormal --pdf2d biv_lognormal --p0 1 1 0 .5 .5 \
--lbounds 0 0.01 -1 0 0 --ubounds 10 10 -1 0 1 --constants -1 -1 0 -1 -1 \
--demo-popt ./examples/results/demo/1KG.YRI.CEU.20.split_mig.demo.params.InferDM.bestfits \
--ratio 2.31 --output ./examples/results/dfe/1KG.YRI.CEU.20.split_mig.dfe.lognormal_mixture.params \
--optimizations 10 --maxeval 400 --check-convergence
#
echo Bootstrapping
#
time dadi-cli GenerateFs --vcf ./examples/data/1KG.YRI.CEU.biallelic.synonymous.snps.withanc.strict.vcf.gz \
--pop-info ./examples/data/1KG.YRI.CEU.popfile.txt --pop-ids YRI CEU --projections 20 20 --polarized --bootstrap 20 \
--chunk-size 1000000 --output ./examples/results/fs/bootstrapping_syn/1KG.YRI.CEU.20.synonymous.snps.unfold
time dadi-cli GenerateFs --vcf ./examples/data/1KG.YRI.CEU.biallelic.nonsynonymous.snps.withanc.strict.vcf.gz \
--pop-info ./examples/data/1KG.YRI.CEU.popfile.txt --pop-ids YRI CEU --projections 20 20 --polarized --bootstrap 20 \
--chunk-size 1000000 --output ./examples/results/fs/bootstrapping_non/1KG.YRI.CEU.20.nonsynonymous.snps.unfold
#
echo Godambe
#
time dadi-cli Stat --fs ./examples/results/fs/1KG.YRI.CEU.20.synonymous.snps.unfold.fs \
--model split_mig --demo-popt ./examples/results/demo/1KG.YRI.CEU.20.split_mig.demo.params.InferDM.bestfits \
--grids 60 80 100 --misid --bootstrapping-dir ./examples/results/fs/bootstrapping_syn/ \
--output ./examples/results/stat/1KG.YRI.CEU.20.split_mig.bestfit.demo.params.godambe.ci
time dadi-cli Stat --fs ./examples/results/fs/1KG.YRI.CEU.20.nonsynonymous.snps.unfold.fs \
--model split_mig --dfe-popt ./examples/results/dfe/1KG.YRI.CEU.20.split_mig.dfe.lognormal_mixture.params.InferDFE.bestfits \
--cache1d ./examples/results/caches/1KG.YRI.CEU.20.split_mig.sel.single.gamma.spectra.bpkl \
--cache2d ./examples/results/caches/1KG.YRI.CEU.20.split_mig.sel.spectra.bpkl \
--pdf1d lognormal --pdf2d biv_lognormal --grids 60 80 100 --misid --bootstrapping-dir ./examples/results/fs/bootstrapping_non/ \
--output ./examples/results/stat/1KG.YRI.CEU.20.split_mig.bestfit.dfe.lognormal_mixture.params.godambe.ci
#
echo Plot synonymous SFS
#
time dadi-cli Plot --fs ./examples/results/fs/1KG.YRI.CEU.20.synonymous.snps.unfold.fs \
--output ./examples/results/plots/1KG.YRI.CEU.20.synonymous.snps.unfold.fs.pdf \
--model split_mig
#
echo Plot nonsynonymous SFS
#
time dadi-cli Plot --fs ./examples/results/fs/1KG.YRI.CEU.20.nonsynonymous.snps.unfold.fs \
--output ./examples/results/plots/1KG.YRI.CEU.20.nonsynonymous.snps.unfold.fs.pdf \
--model split_mig
#
echo Plot comparison between synonymous and nonsynonymous SFS
#
time dadi-cli Plot --fs ./examples/results/fs/1KG.YRI.CEU.20.synonymous.snps.unfold.fs \
--fs2 ./examples/results/fs/1KG.YRI.CEU.20.nonsynonymous.snps.unfold.fs \
--output ./examples/results/plots/1KG.YRI.CEU.20.synonymous.vs.nonsynonymous.snps.unfold.fs.pdf \
--model None
#
echo Plot synonymous SFS vs infered split migration demographic model
#
time dadi-cli Plot --fs ./examples/results/fs/1KG.YRI.CEU.20.synonymous.snps.unfold.fs \
--demo-popt ./examples/results/demo/1KG.YRI.CEU.20.split_mig.demo.params.InferDM.bestfits \
--misid --output ./examples/results/plots/1KG.YRI.CEU.20.synonymous.snps.vs.split_mig.pdf \
--model split_mig
#
echo Plot nonsynonymous SFS vs infered mixture model
#
time dadi-cli Plot --fs ./examples/results/fs/1KG.YRI.CEU.20.nonsynonymous.snps.unfold.fs \
--misid --model split_mig \
--pdf1d lognormal --pdf2d biv_lognormal \
--dfe-popt ./examples/results/dfe/1KG.YRI.CEU.20.split_mig.dfe.lognormal_mixture.params.InferDFE.bestfits \
--cache1d ./examples/results/caches/1KG.YRI.CEU.20.split_mig.sel.single.gamma.spectra.bpkl \
--cache2d ./examples/results/caches/1KG.YRI.CEU.20.split_mig.sel.spectra.bpkl \
--output ./examples/results/plots/1KG.YRI.CEU.20.nonsynonymous.snps.vs.lognormal_mixture.pdf
# work_queue_factory -T local -M test-dm-two-epoch -P ./tests/mypwfile --workers-per-cycle=0 -t 10 --cores=1 -w 5 &
# dadi-cli InferDM --fs ./examples/results/fs/1KG.YRI.CEU.20.synonymous.snps.unfold.fs --model split_mig --misid \
# --p0 1 1 .5 1 .5 --ubounds 10 10 1 10 1 --lbounds 10e-3 10e-3 10e-3 10e-3 10e-5 --grids 60 80 100 \
# --output ./examples/results/demo/1KG.YRI.CEU.20.split_mig.demo.params --optimizations 5 --maxeval 200 \
# --force-convergence \
# --work-queue test-dm-two-epoch ./tests/mypwfile
# work_queue_factory -T local -M test-dfe-two-epoch -P ./tests/mypwfile --workers-per-cycle=0 -t 10 --cores=1 -W 30 &
# dadi-cli InferDFE --fs ./examples/results/fs/1KG.YRI.CEU.20.nonsynonymous.snps.unfold.fs \
# --cache1d ./examples/results/caches/1KG.YRI.CEU.20.split_mig.sel.single.gamma.spectra.bpkl \
# --cache2d ./examples/results/caches/1KG.YRI.CEU.20.split_mig.sel.spectra.bpkl \
# --misid --pdf1d lognormal --pdf2d biv_lognormal --p0 1 1 0 .5 .5 \
# --lbounds 0 0.01 -1 0 0 --ubounds 10 10 -1 0 1 --constants -1 -1 0 -1 -1 \
# --demo-popt ./examples/results/demo/1KG.YRI.CEU.20.split_mig.demo.params.InferDM.bestfits \
# --ratio 2.31 --output ./examples/results/dfe/1KG.YRI.CEU.20.split_mig.dfe.lognormal_mixture.params \
# --optimizations 5 --maxeval 400 \
# --force-convergence --delta-ll 0.1 \
# --work-queue test-dfe-two-epoch ./tests/mypwfile