biomcmc-lib  0.1
low level library for phylogenetic analysis
parsimony.h
Go to the documentation of this file.
1 /*
2  * This file is part of biomcmc-lib, a low-level library for phylogenomic analysis.
3  * Copyright (C) 2019-today Leonardo de Oliveira Martins [ leomrtns at gmail.com; http://www.leomartins.org ]
4  *
5  * biomcmc is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6  * License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7  * version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
10  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
11  * details (file "COPYING" or http://www.gnu.org/copyleft/gpl.html).
12  */
13 
19 #ifndef _biomcmc_parsimony_
20 #define _biomcmc_parsimony_
21 
22 #include "topology_distance.h"
23 
26 
29  int ntax, nchar, i;
30  bool **s;
31  int *freq, freq_sum;
32  int *occupancy;
33  uint32_t *col_hash;
35 };
36 
38  int *score;
39  binary_parsimony_datamatrix external, internal;
40  double costs[4];
42 };
43 
44 binary_parsimony_datamatrix new_binary_parsimony_datamatrix (int n_sequences);
45 binary_parsimony_datamatrix new_binary_parsimony_datamatrix_fixed_length (int n_sequences, int n_sites);
46 void del_binary_parsimony_datamatrix (binary_parsimony_datamatrix mrp);
47 binary_parsimony new_binary_parsimony (int n_sequences);
48 binary_parsimony new_binary_parsimony_fixed_length (int n_sequences, int n_sites);
49 void del_binary_parsimony (binary_parsimony pars);
51 void update_binary_parsimony_from_topology (binary_parsimony pars, topology t, int *map, int n_species);
52 int binary_parsimony_score_of_topology (binary_parsimony pars, topology t);
53 void pairwise_distances_from_binary_parsimony_datamatrix (binary_parsimony_datamatrix mrp, double **dist, int n_dist);
54 
55 #endif
Definition: parsimony.h:37
branch length operations on topologies, including patristic distances
int i
number of taxa, distinct sites (patterns), and index to current (last) column
Definition: parsimony.h:29
used by matrix representation with parsimony (01 10 11 sequences)
Definition: parsimony.h:28
void update_binary_parsimony_from_topology(binary_parsimony pars, topology t, int *map, int n_species)
given a map[] with location in sptree of gene tree leaves, update binary matrix with splits from gene...
Definition: parsimony.c:114
int freq_sum
frequency of pattern.
Definition: parsimony.h:31
int * score
parsimony score per pattern
Definition: parsimony.h:38
uint32_t * col_hash
hash value of each column, to speed up comparisons
Definition: parsimony.h:33
int * occupancy
how many species represented by each bipartition
Definition: parsimony.h:32
int ref_counter
how many places have a pointer to this instance
Definition: parsimony.h:41
int ref_counter
how many places have a pointer to this instance
Definition: parsimony.h:34
bool ** s
1 (01) and 2 (10) are the two binary states, with 3 (11) being undetermined
Definition: parsimony.h:30
Binary unrooted topology (rooted at leaf with ID zero)
Definition: topology_common.h:47