3
PHYML : a program that computes maximum likelihood phylogenies from
4
DNA or AA homologous sequences
6
Copyright (C) Stephane Guindon. Oct 2003 onward
8
All parts of the source except where indicated are distributed under
9
the GNU public licence. See http://www.opensource.org for details.
18
#include "utilities.h"
25
void Init_Tips_At_One_Site_Nucleotides_Float(char state, int pos, phydbl *p_lk);
26
void Init_Tips_At_One_Site_AA_Float(char aa, int pos, phydbl *p_lk);
27
void Get_All_Partial_Lk(t_tree *tree,t_edge *b_fcus,t_node *a,t_node *d);
28
void Get_All_Partial_Lk_Scale(t_tree *tree,t_edge *b_fcus,t_node *a,t_node *d);
29
void Post_Order_Lk(t_node *pere, t_node *fils, t_tree *tree);
30
void Pre_Order_Lk(t_node *pere, t_node *fils, t_tree *tree);
31
phydbl Lk(t_edge *b, t_tree *tree);
32
void Site_Lk(t_tree *tree);
33
/* phydbl Lk_At_Given_Edge(t_edge *b_fcus,t_tree *tree); */
34
phydbl Return_Abs_Lk(t_tree *tree);
35
matrix *ML_Dist(calign *data, t_mod *mod);
36
phydbl Lk_Given_Two_Seq(calign *data, int numseq1, int numseq2, phydbl dist, t_mod *mod, phydbl *loglk);
37
void Unconstraint_Lk(t_tree *tree);
38
void Update_P_Lk(t_tree *tree,t_edge *b_fcus,t_node *n);
39
void Update_P_Lk_Generic(t_tree *tree,t_edge *b_fcus,t_node *n);
40
void Update_P_Lk_AA(t_tree *tree,t_edge *b_fcus,t_node *n);
41
void Update_P_Lk_Nucl(t_tree *tree,t_edge *b_fcus,t_node *n);
42
void Init_P_Lk_Tips_Double(t_tree *tree);
43
void Init_P_Lk_Tips_Int(t_tree *tree);
44
void Init_P_Lk_At_One_Node(t_node *a, t_tree *tree);
45
void Update_PMat_At_Given_Edge(t_edge *b_fcus, t_tree *tree);
46
void Sort_Sites_Based_On_Lk(t_tree *tree);
47
void Get_Partial_Lk_Scale(t_tree *tree, t_edge *b_fcus, t_node *a, t_node *d);
48
void Get_Partial_Lk(t_tree *tree, t_edge *b_fcus, t_node *a, t_node *d);
49
void Init_Tips_At_One_Site_Nucleotides_Int(char state, int pos, short int *p_pars);
50
void Init_Tips_At_One_Site_AA_Int(char aa, int pos, short int *p_pars);
51
void Update_P_Lk_Along_A_Path(t_node **path, int path_length, t_tree *tree);
52
phydbl Lk_Dist(phydbl *F, phydbl dist, t_mod *mod);
53
phydbl Update_Lk_At_Given_Edge(t_edge *b_fcus, t_tree *tree);
54
void Update_P_Lk_Greedy(t_tree *tree, t_edge *b_fcus, t_node *n);
55
void Get_All_Partial_Lk_Scale_Greedy(t_tree *tree, t_edge *b_fcus, t_node *a, t_node *d);
56
phydbl Lk_Core(int state, int ambiguity_check, t_edge *b, t_tree *tree);
57
phydbl Lk_Triplet(t_node *a, t_node *d, t_tree *tree);
58
void Print_Lk_Given_Edge_Recurr(t_node *a, t_node *d, t_edge *b, t_tree *tree);
59
phydbl *Post_Prob_Rates_At_Given_Edge(t_edge *b, phydbl *post_prob, t_tree *tree);
60
phydbl Lk_With_MAP_Branch_Rates(t_tree *tree);
61
void Init_Tips_At_One_Site_Generic_Int(char *state, int ns, int state_len, int pos, short int *p_pars);
62
void Init_Tips_At_One_Site_Generic_Float(char *state, int ns, int state_len, int pos, phydbl *p_lk);
63
void Alias_Subpatt(t_tree *tree);
64
void Alias_One_Subpatt(t_node *a, t_node *d, t_tree *tree);
65
void Alias_Subpatt_Post(t_node *a, t_node *d, t_tree *tree);
66
void Alias_Subpatt_Pre(t_node *a, t_node *d, t_tree *tree);
67
void Copy_P_Lk(phydbl *p_lk, int site_from, int site_to, t_tree *tree);
68
void Copy_Scale(int *scale, int site_from, int site_to, t_tree *tree);
69
void Init_P_Lk_Loc(t_tree *tree);
70
phydbl Lk_Normal_Approx(t_tree *tree);
71
phydbl Wrap_Lk(t_edge *b, t_tree *tree, supert_tree *stree);
72
phydbl Wrap_Lk_At_Given_Edge(t_edge *b, t_tree *tree, supert_tree *stree);
73
phydbl Wrap_Part_Lk_At_Given_Edge(t_edge *b, t_tree *tree, supert_tree *stree);
74
phydbl Wrap_Part_Lk(t_edge *b, t_tree *tree, supert_tree *stree);
75
phydbl Wrap_Geo_Lk(t_edge *b, t_tree *tree, supert_tree *stree);
76
phydbl Wrap_Diff_Lk_Norm_At_Given_Edge(t_edge *b, t_tree *tree, supert_tree *stree);
77
phydbl Wrap_Lk_Rates(t_edge *b, t_tree *tree, supert_tree *stree);
78
phydbl Wrap_Lk_Linreg(t_edge *b, t_tree *tree, supert_tree *stree);
79
void Sample_Ancestral_Seq(int mutmap, int fromprior, t_tree *tree);
80
void Map_Mutations(t_node *a, t_node *d, int sa, int sd, t_edge *b, int site, int rate_cat, int *muttype, phydbl *muttime, int *n_mut, t_tree *tree);
81
void Sample_Ancestral_Seq_Pre(t_node *a, t_node *d, t_edge *b,
82
int site, int rate_cat,
83
int *muttype, phydbl *muttime, int *n_mut,
84
int mutmap, int fromprior, t_tree *tree);
85
phydbl Wrap_Lk_Times(t_edge *b, t_tree *tree, supert_tree *stree);
86
phydbl Lk_LastFirst(t_tree *tree);
87
phydbl Invariant_Lk(int *fact_sum_scale, int site, int *num_prec_issue, t_tree *tree);
88
void Rate_Correction(int exponent, phydbl *site_lk_cat, t_tree *tree);
89
int Check_Lk_At_Given_Edge(int verbose, t_tree *tree);
90
void ML_Ancestral_Sequences_One_Node(t_node *mixt_d, t_tree *mixt_tree);
91
void ML_Ancestral_Sequences(t_tree *tree);