1 | /* |
---|
2 | |
---|
3 | PhyML: a program that computes maximum likelihood phylogenies from |
---|
4 | DNA or AA homologous sequences. |
---|
5 | |
---|
6 | Copyright (C) Stephane Guindon. Oct 2003 onward. |
---|
7 | |
---|
8 | All parts of the source except where indicated are distributed under |
---|
9 | the GNU public licence. See http://www.opensource.org for details. |
---|
10 | |
---|
11 | */ |
---|
12 | |
---|
13 | #include <config.h> |
---|
14 | |
---|
15 | #ifndef MCMC_H |
---|
16 | #define MCMC_H |
---|
17 | |
---|
18 | #include "spr.h" |
---|
19 | #include "utilities.h" |
---|
20 | #include "lk.h" |
---|
21 | #include "optimiz.h" |
---|
22 | #include "bionj.h" |
---|
23 | #include "models.h" |
---|
24 | #include "free.h" |
---|
25 | #include "help.h" |
---|
26 | #include "simu.h" |
---|
27 | #include "eigen.h" |
---|
28 | #include "pars.h" |
---|
29 | #include "alrt.h" |
---|
30 | #include "times.h" |
---|
31 | #include "m4.h" |
---|
32 | #include "draw.h" |
---|
33 | #include "rates.h" |
---|
34 | #include "stats.h" |
---|
35 | #include <stdlib.h> |
---|
36 | #include <unistd.h> |
---|
37 | #include <stdio.h> |
---|
38 | #include <signal.h> |
---|
39 | |
---|
40 | void MCMC_Lexp(t_tree *tree); |
---|
41 | void MCMC_Print_Param(t_mcmc *mcmc, t_tree *tree); |
---|
42 | t_mcmc *MCMC_Make_MCMC_Struct(); |
---|
43 | void MCMC_Free_MCMC(t_mcmc *mcmc); |
---|
44 | void MCMC_Init_MCMC_Struct(char *filename, option *io,t_mcmc *mcmc); |
---|
45 | void MCMC(t_tree *tree); |
---|
46 | void MCMC_Alpha(t_tree *tree); |
---|
47 | void MCMC_Randomize_Branch_Lengths(t_tree *tree); |
---|
48 | void MCMC_Randomize_Node_Times(t_tree *tree); |
---|
49 | void MCMC_Randomize_Node_Times_Pre(t_node *a, t_node *d, t_tree *tree); |
---|
50 | void MCMC_Randomize_Lexp(t_tree *tree); |
---|
51 | void MCMC_Randomize_Jumps(t_tree *tree); |
---|
52 | void MCMC_Randomize_Alpha(t_tree *tree); |
---|
53 | void MCMC_One_Rate(t_node *a, t_node *d, int traversal, t_tree *tree); |
---|
54 | void MCMC_No_Change(t_tree *tree); |
---|
55 | void MCMC_Nu(t_tree *tree); |
---|
56 | void MCMC_Randomize_Nu(t_tree *tree); |
---|
57 | t_node *MCMC_Select_Random_Node_Pair(phydbl t_sup, t_tree *tree); |
---|
58 | void MCMC_Modify_Rates(t_tree *tree); |
---|
59 | void MCMC_Modify_Subtree_Rate(t_node *a, t_node *d, phydbl new_rate, t_tree *tree); |
---|
60 | void MCMC_Randomize_Rates(t_tree *tree); |
---|
61 | void MCMC_Stick_Rates(t_tree *tree); |
---|
62 | void MCMC_Stick_Rates_Pre(t_node *a, t_node *d, t_tree *tree); |
---|
63 | void MCMC_Times_Global(t_tree *tree); |
---|
64 | void MCMC_Times_Local(t_tree *tree); |
---|
65 | void MCMC_One_Time(t_node *a, t_node *d, int traversal, t_tree *tree); |
---|
66 | void MCMC_Rates_Global(t_tree *tree); |
---|
67 | void MCMC_Rates_Local(t_tree *tree); |
---|
68 | void MCMC_Rates_Pre(t_node *a, t_node *d, t_tree *tree); |
---|
69 | void MCMC_Mixing_Step(t_tree *tree); |
---|
70 | void MCMC_Jumps_Local(t_tree *tree); |
---|
71 | void MCMC_Jumps_Pre(t_node *a, t_node *d, int local, t_tree *tree); |
---|
72 | void MCMC_Randomize_Clock_Rate(t_tree *tree); |
---|
73 | void MCMC_Clock_Rate(t_tree *tree); |
---|
74 | void MCMC_Time_Root(t_tree *tree); |
---|
75 | void MCMC_Randomize_Node_Times_Bottom_Up(t_node *a, t_node *d, t_tree *tree); |
---|
76 | void MCMC_Randomize_Node_Times_Top_Down(t_node *a, t_node *d, t_tree *tree); |
---|
77 | void MCMC_Randomize_Rates_Pre(t_node *a, t_node *d, t_tree *tree); |
---|
78 | void MCMC_Print_Means(t_mcmc *mcmc, t_tree *tree); |
---|
79 | void MCMC_Print_Last(t_mcmc *mcmc, t_tree *tree); |
---|
80 | void MCMC_Close_MCMC(t_mcmc *mcmc); |
---|
81 | void MCMC_Rates_Global(t_tree *tree); |
---|
82 | void MCMC_Omega(t_tree *tree); |
---|
83 | void MCMC_Adjust_Tuning_Parameter(int move, t_mcmc *mcmc); |
---|
84 | void MCMC_Copy_MCMC_Struct(t_mcmc *ori, t_mcmc *cpy, char *filename); |
---|
85 | void MCMC_Randomize_Node_Times_Bottom_Up(t_node *a, t_node *d, t_tree *tree); |
---|
86 | void MCMC_One_Length(t_edge *b, t_tree *tree); |
---|
87 | void MCMC_Br_Lens(t_tree *tree); |
---|
88 | void MCMC_Br_Lens_Pre(t_node *a, t_node *d, t_edge *b, t_tree *tree); |
---|
89 | void MCMC_Tree_Height(t_tree *tree); |
---|
90 | void MCMC_Subtree_Height(t_tree *tree); |
---|
91 | void MCMC_Swing(t_tree *tree); |
---|
92 | void MCMC_Single_Param_Generic(phydbl *val, |
---|
93 | phydbl lim_inf, |
---|
94 | phydbl lim_sup, |
---|
95 | int move_num, |
---|
96 | phydbl *lnPrior, |
---|
97 | phydbl *lnLike, |
---|
98 | phydbl (*prior_func)(t_edge *,t_tree *,supert_tree *), |
---|
99 | phydbl (*like_func)(t_edge *,t_tree *,supert_tree *), |
---|
100 | int move_type, int _log, |
---|
101 | t_edge *branch, t_tree *tree, supert_tree *stree); |
---|
102 | void MCMC_Scale_Br_Lens(t_tree *tree); |
---|
103 | void MCMC_Update_Mean_Br_Len(t_tree *tree); |
---|
104 | void MCMC_Update_Cov_Br_Len(t_tree *tree); |
---|
105 | void MCMC_Sim_Rate(t_node *a, t_node *d, t_tree *tree); |
---|
106 | void Fill_All_Param(t_mcmc *mcmc, t_rate *rate, t_tree *tree); |
---|
107 | int Get_Param_Num(t_mcmc *mcmc, phydbl *param); |
---|
108 | void MCMC_Complete_MCMC(t_mcmc *mcmc, t_tree *tree); |
---|
109 | void MCMC_Sample_Joint_Rates_Prior(t_tree *tree); |
---|
110 | void MCMC_Sample_Joint_Rates_Posterior(t_tree *tree); |
---|
111 | void MCMC_Pair_Rates_Constraint(t_node *a, t_node *d, int random, int traversal, t_tree *tree); |
---|
112 | void MCMC_Times_And_Rates(t_node *a, t_node *d, int random, int traversal, t_tree *tree); |
---|
113 | void MCMC_Tree_Rates(t_tree *tree); |
---|
114 | void MCMC_Pause(t_mcmc *mcmc); |
---|
115 | void MCMC_Print_Param_Stdin(t_mcmc *mcmc, t_tree *tree); |
---|
116 | void MCMC_Subtree_Rates(t_tree *tree); |
---|
117 | void MCMC_Get_Acc_Rates(t_mcmc *mcmc); |
---|
118 | void MCMC_Update_Effective_Sample_Size(int move_num, t_mcmc *mcmc, t_tree *tree); |
---|
119 | void MCMC_Initialize_Param_Val(t_mcmc *mcmc, t_tree *tree); |
---|
120 | void MCMC_Terminate(); |
---|
121 | void MCMC_Copy_To_New_Param_Val(t_mcmc *mcmc, t_tree *tree); |
---|
122 | void MCMC_Randomize_Node_Rates(t_tree *tree); |
---|
123 | void MCMC_One_Node_Rate(t_node *a, t_node *d, int traversal, t_tree *tree); |
---|
124 | void MCMC_Tree_Rates_Bis(t_tree *tree); |
---|
125 | void MCMC_Slice_One_Rate(t_node *a, t_node *d, int traversal, t_tree *tree); |
---|
126 | void MCMC_Updown_Nu_Cr(t_tree *tree); |
---|
127 | void MCMC_All_Rates(t_tree *tree); |
---|
128 | void MCMC_Alpha(t_tree *tree); |
---|
129 | void MCMC_Kappa(t_tree *tree); |
---|
130 | void MCMC_Rate_Across_Sites(t_tree *tree); |
---|
131 | void MCMC_Free_Mixt_Rate(t_tree *tree); |
---|
132 | void MCMC_Make_Move(phydbl *cur, phydbl *new, phydbl inf, phydbl sup, phydbl *loghr, phydbl tune, int move_type); |
---|
133 | void MCMC_Randomize_Rate_Across_Sites(t_tree *tree); |
---|
134 | void MCMC_Randomize_Kappa(t_tree *tree); |
---|
135 | void MCMC_Updown_T_Cr(t_tree *tree); |
---|
136 | void MCMC_Linreg_Par(t_tree *tree); |
---|
137 | void MCMC_Covarion_Rates(t_tree *tree); |
---|
138 | void MCMC_Covarion_Switch(t_tree *tree); |
---|
139 | void MCMC_Randomize_Covarion_Rates(t_tree *tree); |
---|
140 | void MCMC_Randomize_Covarion_Switch(t_tree *tree); |
---|
141 | void MCMC_Read_Param_Vals(t_tree *tree); |
---|
142 | void MCMC_Birth_Rate(t_tree *tree); |
---|
143 | void MCMC_Randomize_Birth(t_tree *tree); |
---|
144 | void MCMC_Clock_R(t_tree *mixt_tree); |
---|
145 | void MCMC_Free_MCMC(t_mcmc *mcmc); |
---|
146 | void MCMC_Updown_T_Br(t_tree *tree); |
---|
147 | void MCMC_Root_Time(t_tree *tree); |
---|
148 | void MCMC_Jump_Calibration(t_tree *tree); |
---|
149 | void MCMC_Geo_Lbda(t_tree *mixt_tree); |
---|
150 | void MCMC_Geo_Sigma(t_tree *mixt_tree); |
---|
151 | void MCMC_Geo_Tau(t_tree *mixt_tree); |
---|
152 | void MCMC_Geo_Loc(t_tree *tree); |
---|
153 | |
---|
154 | #endif |
---|