forked from ThibaultLatrille/bayescode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
218 lines (198 loc) · 10.8 KB
/
Makefile
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# ==============================================================================================================
# COMPILATION
# ==============================================================================================================
.PHONY: all # Requires: cmake 3.1.0 or better
all: bin
@cd bin ; make --no-print-directory -j 8
bin: CMakeLists.txt # default mode is release
@rm -rf bin
@mkdir bin
@cd bin ; cmake ..
.PHONY: coverage
coverage:
@rm -rf bin
@mkdir bin
@cd bin ; cmake -DCOVERAGE_MODE=ON ..
@make --no-print-directory test
.PHONY: debug
debug:
@rm -rf bin
@mkdir bin
@cd bin ; cmake -DDEBUG_MODE=ON ..
@make --no-print-directory
.PHONY: release
release:
@rm -rf bin
@mkdir bin
@cd bin ; cmake ..
@make --no-print-directory
@rm -rf bin/CMakeCache.txt
@rm -rf bin/cmake_install.cmake
@rm -rf bin/CMakeFiles
@rm -rf bin/Makefile
@rm -rf bin/*.a
.PHONY: tiny
tiny:
@rm -rf bin
@mkdir bin
@cd bin ; cmake -DTINY=ON ..
@make --no-print-directory
.PHONY: clean
clean:
@rm -rf bin
@rm -rf bin_coverage
@rm -rf _test
@rm -rf _build
@rm -rf _aamutsel
@rm -rf _mutseldm5
@rm -rf _mutselomega
@rm -rf _dated
@rm -rf _traits
# ==============================================================================================================
# CODE QUALITY
# ==============================================================================================================
.PHONY: format # Requires: clang-format
format:
@clang-format -i `find -name *.*pp`
# ==============================================================================================================
# TESTING
# ==============================================================================================================
POINTS=2
.PHONY: run-unit-tests
run-unit-tests: all
@echo "\n\e[35m\e[1m== Tree test ==================================================================\e[0m"
bin/tree_test
.PHONY: run-unit-tests-mpi
run-unit-tests-mpi: all
@echo "\n\n\e[35m\e[1m== MPI par test ===============================================================\e[0m"
mpirun -np 3 bin/mpi_par_test
.PHONY: run-app-tests
run-app-tests: all
@rm -rf _test
@mkdir _test
@echo "\n\e[35m\e[1m== Globom run ===============================================================\e[0m"
@bin/globom -a data/polymorphism/gal4.ali -t data/polymorphism/gal4.newick -u ${POINTS} _test/globom_gal4
@echo "\n\e[35m\e[1m== Globom restart ===========================================================\e[0m"
bin/globom _test/globom_gal4
@echo "\n\e[35m\e[1m== Globom read ==============================================================\e[0m"
bin/readglobom _test/globom_gal4
@echo "\n\e[35m\e[1m== CodonM2a run =============================================================\e[0m"
bin/codonm2a -a data/polymorphism/gal4.ali -t data/polymorphism/gal4.newick -u ${POINTS} _test/codonM2a_gal4
@echo "\n\e[35m\e[1m== CodonM2a restart =========================================================\e[0m"
bin/codonm2a _test/codonM2a_gal4
@echo "\n\e[35m\e[1m== CodonM2a read ============================================================\e[0m"
bin/readcodonm2a _test/codonM2a_gal4 -u ${POINTS}
@echo "\n\e[35m\e[1m== MutSel run ===============================================================\e[0m"
bin/aamutsel -a data/polymorphism/gal4.ali -t data/polymorphism/gal4.newick -u ${POINTS} _test/aamutsel_gal4
@echo "\n\e[35m\e[1m== MutSel restart ===========================================================\e[0m"
bin/aamutsel _test/aamutsel_gal4
@echo "\n\e[35m\e[1m== MutSel read ==============================================================\e[0m"
bin/readaamutsel _test/aamutsel_gal4 -u ${POINTS}
@echo "\n\e[35m\e[1m== MutSel read site-profiles ================================================\e[0m"
bin/readaamutsel --ss --output _test/aamutsel_gal4_ss.tsv _test/aamutsel_gal4
@echo "\n\e[35m\e[1m== MutSel with polymorphism run =============================================\e[0m"
bin/aamutsel -a data/polymorphism/gal4.ali -t data/polymorphism/gal4.newick -p -u ${POINTS} _test/aamutsel_gal4_poly
@echo "\n\e[35m\e[1m== MutSel Multiple omega run ================================================\e[0m"
bin/mutselomega -a data/polymorphism/gal4.ali -t data/polymorphism/gal4.newick --freeomega --omegancat 3 -u ${POINTS} _test/mutselomega_gal4
@echo "\n\e[35m\e[1m== MutSel Multiple omega restart ============================================\e[0m"
bin/mutselomega _test/mutselomega_gal4
@echo "\n\e[35m\e[1m== MutSel Multiple omega read ===============================================\e[0m"
bin/readmutselomega _test/mutselomega_gal4
@echo "\n\e[35m\e[1m== Diffsel double sparse ====================================================\e[0m"
@make --no-print-directory diffseldsparse
@echo "\n\e[35m\e[1m== Node Omega run ===========================================================\e[0m"
bin/nodeomega -a data/polymorphism/gal4.ali -t data/polymorphism/gal4.newick -u ${POINTS} _test/nodeomega_gal4
@echo "\n\e[35m\e[1m== Node Omega restart =======================================================\e[0m"
bin/nodeomega _test/nodeomega_gal4
@echo "\n\e[35m\e[1m== Read Node Omega =========================================================\e[0m"
bin/readnodeomega --newick --output _test/nodeomega_gal4_trees _test/nodeomega_gal4
@echo "\n\e[35m\e[1m== Node MutSel run ==========================================================\e[0m"
bin/nodemutsel --ncat 3 -a data/polymorphism/gal4.ali -t data/polymorphism/gal4.newick -u ${POINTS} _test/nodemutsel_gal4
@echo "\n\e[35m\e[1m== Node MutSel restart ======================================================\e[0m"
bin/nodemutsel _test/nodemutsel_gal4
@echo "\n\e[35m\e[1m== Node MutSel read =========================================================\e[0m"
bin/readnodemutsel --ss --output _test/nodemutsel_gal4_ss.tsv _test/nodemutsel_gal4
# @make --no-print-directory run-multigeneglobom-test
.PHONY: run-multigeneglobom-test
run-multigeneglobom-test: all
@echo "\n\e[35m\e[1m== Multigene Single Omega ===================================================\e[0m"
cd data/small_multigene && mpirun -np 2 ../../bin/multigeneglobom -t tree.nwk -a verysmall.list -u ${POINTS} tmp
.PHONY: test
test: bin
@make --no-print-directory run-unit-tests
@make --no-print-directory run-unit-tests-mpi
@make --no-print-directory run-app-tests
.PHONY: aamutsel
aamutsel: bin
@cd bin ; make --no-print-directory -j8 aamutsel readaamutsel
@rm -rf _aamutsel
@mkdir _aamutsel
bin/aamutsel -a data/polymorphism/gal4.ali -t data/polymorphism/gal4.newick -u 10 _aamutsel/gal4
bin/aamutsel _aamutsel/gal4
bin/readaamutsel _aamutsel/gal4 -u 10
bin/readaamutsel --ss --output _aamutsel/gal4_ss.tsv _aamutsel/gal4
bin/aamutsel -a data/polymorphism/gal4.ali -t data/polymorphism/gal4.newick -u 10 -p _aamutsel/gal4_poly
bin/aamutsel _aamutsel/gal4_poly
bin/readaamutsel _aamutsel/gal4_poly -u 10
bin/readaamutsel --ss --output _aamutsel/gal4_poly_ss.tsv _aamutsel/gal4_poly
.PHONY: mutselomega
mutselomega: tiny
@cd bin ; make --no-print-directory -j8 mutselomega readmutselomega
@rm -rf _mutselomega
@mkdir _mutselomega
bin/mutselomega -a data/bglobin/bglobin.phy -t data/bglobin/bglobin.tre --ncat 30 -u 30 _mutselomega/mutsel_bglobin
bin/mutselomega _mutselomega/mutsel_bglobin
bin/readmutselomega -b 10 _mutselomega/mutsel_bglobin
bin/readmutselomega -b 10 --ss --output _mutselomega/mutsel_bglobin_ss.tsv _mutselomega/mutsel_bglobin
bin/readmutselomega -b 10 --omega_0 --output _mutselomega/mutsel_bglobin_omega_0.tsv _mutselomega/mutsel_bglobin
bin/readmutselomega -b 10 --nuc --output _mutselomega/mutsel_bglobin_nuc.tsv _mutselomega/mutsel_bglobin
bin/mutselomega -a data/bglobin/bglobin.phy -t data/bglobin/bglobin.tre --freeomega --omegancat 3 -u 30 --flatfitness _mutselomega/MGM3_bglobin
bin/mutselomega _mutselomega/MGM3_bglobin
bin/readmutselomega -b 10 --omega --output _mutselomega/MGM3_bglobin_omega.tsv _mutselomega/MGM3_bglobin
bin/readmutselomega -b 10 --chain_omega _mutselomega/MGM3_bglobin _mutselomega/mutsel_bglobin
bin/mutselomega -a data/bglobin/bglobin.phy -t data/bglobin/bglobin.tre --profiles _mutselomega/mutsel_bglobin_ss.tsv --omegaarray data/bglobin/omegaarray.csv -u 30 _mutselomega/clamped_bglobin
bin/mutselomega _mutselomega/clamped_bglobin
bin/readmutselomega -b 10 _mutselomega/clamped_bglobin
bin/mutselomega -a data/bglobin/bglobin.phy -t data/bglobin/bglobin.tre --freeomega --omegancat 3 --ncat 30 -u 30 _mutselomega/mutselM3_bglobin
bin/mutselomega _mutselomega/mutselM3_bglobin
bin/readmutselomega -b 10 --omega_threshold 1.0 --output _mutselomega/mutselM3_bglobin_omega_pp.tsv _mutselomega/mutselM3_bglobin
.PHONY: DM5
DM5: bin
@cd bin ; make --no-print-directory -j8 mutseldm5 readmutseldm5
@rm -rf _mutseldm5
@mkdir _mutseldm5
bin/mutseldm5 -a data/bglobin/bglobin.phy -t data/bglobin/bglobin.tre --freeomega --omegancat 10 --flatfitness --fixp0 --p0 0.0 -u 30 --hypermean_threshold 0.0 --hyperinvshape_threshold 10.0 _mutseldm5/MGM3_bglobin
bin/readmutseldm5 _mutseldm5/MGM3_bglobin
bin/mutseldm5 _mutseldm5/MGM3_bglobin
bin/readmutseldm5 --ss _mutseldm5/MGM3_bglobin
bin/mutseldm5 -a data/bglobin/bglobin.phy -t data/bglobin/bglobin.tre --omegashift 1.0 --freeomega --omegancat 10 --ncat 30 -u 30 _mutseldm5/bglobin
bin/readmutseldm5 _mutseldm5/bglobin
bin/mutseldm5 _mutseldm5/bglobin
.PHONY: dated
dated: tiny
@cd bin ; make --no-print-directory -j8 nodemutsel
@rm -rf _dated
@mkdir _dated
bin/nodeomega -a data/polymorphism/gal4.ali -t data/polymorphism/gal4.newick -u 20 _dated/nodeomega_gal4
bin/nodeomega _dated/nodeomega_gal4
bin/readnodeomega --newick -b 10 -u 20 _dated/nodeomega_gal4
bin/readnodeomega --cov -b 10 -u 20 _dated/nodeomega_gal4
bin/nodemutsel -a data/polymorphism/gal4.ali -t data/polymorphism/gal4.newick --ncat 3 -u ${POINTS} _dated/node_gal4
bin/nodemutsel _dated/node_gal4
bin/readnodemutsel _dated/node_gal4
# bin/nodemutsel -a data/polymorphism/gal4.ali -t data/polymorphism/gal4.newick --ncat 3 -u ${POINTS} -p _dated/node_poly_gal4
# bin/nodemutsel _dated/node_poly_gal4
.PHONY: traits
traits: tiny
@cd bin ; make --no-print-directory -j8 nodetraits readnodetraits
@rm -rf _traits
@mkdir _traits
python3 utils/neutrality_index.py --tree data/body_size/mammals.male.tree --traitsfile data/body_size/mammals.male.traits.tsv --var_within data/body_size/mammals.male.var_within.tsv --output _traits/mammals.male.ML.tsv
bin/nodetraits --tree data/body_size/mammals.male.tree --traitsfile data/body_size/mammals.male.traits.tsv -u 100 _traits/mammals.male
bin/nodetraits _traits/mammals.male
bin/readnodetraits -b 50 -u 100 --var_within data/body_size/mammals.male.var_within.tsv --output _traits/mammals.male.Bayesian.tsv _traits/mammals.male
bin/readnodetraits -b 50 -u 100 --cov --output _traits/mammals.male.cov _traits/mammals.male
.PHONY: diffseldsparse
diffseldsparse: all
@rm -f delme*.*
bin/diffseldsparse -a data/besnard/cyp_small.phy -t data/besnard/cyp_coding.Chrysithr_root.nhx -e 1 -u 3 tmp