21 #ifndef _biomcmc_distance_matrix_h_ 22 #define _biomcmc_distance_matrix_h_ 62 spdist_matrix new_spdist_matrix (
int n_species);
64 void finalise_spdist_matrix (spdist_matrix dist);
65 void finalise_spdist_matrix_with_rescaling (spdist_matrix dist,
double scale);
66 void complete_missing_spdist_from_global_spdist (spdist_matrix local, spdist_matrix global);
67 void copy_spdist_matrix_to_distance_matrix_upper (spdist_matrix spd, distance_matrix dist,
bool use_means);
68 void del_spdist_matrix (spdist_matrix dist);
76 int prepare_spdistmatrix_from_gene_species_map (spdist_matrix spdist,
int *sp_id,
int n_sp_id);
77 void fill_spdistmatrix_from_gene_dists (spdist_matrix spdist, distance_matrix gendist,
int *sp_id,
bool use_upper_gene);
80 void update_spdistmatrix_from_spdistmatrix (spdist_matrix global, spdist_matrix local);
int ref_counter
boolean marking if species is present at all in this matrix
Definition: distance_matrix.h:50
void zero_lower_distance_matrix(distance_matrix dist)
specially in gene/sptree distance methods (GLASS, STEAC, etc.) lower is used for means and upper for ...
Definition: distance_matrix.c:44
bool * species_present
how many times this pairwise comparison appears (between or within loci)
Definition: distance_matrix.h:49
double mean_JC_dist
variance in pairwise distance from K2P model
Definition: distance_matrix.h:32
double mean_K2P_dist
pairwise distance matrix (upper) and ti/tv rate ratio (lower triangle) for K2P formula for alignments...
Definition: distance_matrix.h:32
double var_R
average K2P transition/transversion ratio from pairwise distances
Definition: distance_matrix.h:32
void del_distance_matrix(distance_matrix dist)
releases memory allocated to distance_matrix (this structure has no smart ref_counter) ...
Definition: distance_matrix.c:66
distance_matrix new_distance_matrix(int nseqs)
creates new matrix of pairwise distances
Definition: distance_matrix.c:18
double ** d
number of sequences to calculate distances
Definition: distance_matrix.h:32
double mean_R
average pairwise distance from JC model
Definition: distance_matrix.h:32
double freq[20]
variance in K2P transition/transversion ratio from pairwise distances
Definition: distance_matrix.h:32
void fill_species_dists_from_gene_dists(distance_matrix spdist, distance_matrix gendist, int *sp_id, bool use_upper_gene)
updates distances between species based on genes and gene-to-species mapping, with min on upper and m...
Definition: distance_matrix.c:215
void transpose_distance_matrix(distance_matrix dist)
invert lower and upper diagonals of matrix (since some functions like upgma expect upper...
Definition: distance_matrix.c:54
void zero_all_spdist_matrix(spdist_matrix dist)
Definition: distance_matrix.c:104
double var_K2P_dist
average pairwise distance from K2P model
Definition: distance_matrix.h:32
int * idx
distance from root (used to calculate distance between tree leaves)
Definition: distance_matrix.h:40
void fill_spdistmatrix_from_gene_dist_vector(spdist_matrix spdist, double *gdist, int n_gdist, int *sp_id)
initialise spdist_matrix with patristic distances from gdist vector of size n_gdist (1D) ...
Definition: distance_matrix.c:295
double * fromroot
empirical equilibrium frequencies
Definition: distance_matrix.h:39
void update_species_dists_from_spdist(distance_matrix global, distance_matrix local, int *spexist)
update global (over loci) species distances besed on local (within locus) species distances ...
Definition: distance_matrix.c:246
Definition: distance_matrix.h:44
Definition: distance_matrix.h:29
int * count
mean or min distances across possibilities (within loci)
Definition: distance_matrix.h:48
int ref_counter
aux vectors for finding leaves spanned by subtrees on any node
Definition: distance_matrix.h:41
double hashing open-address hash table using strings as key – also has distance matrix, that can be used in alignments and trees