10 #ifndef EMP_EVO_SYSTEMATICS_ANALYSIS_H 11 #define EMP_EVO_SYSTEMATICS_ANALYSIS_H 27 template <
typename taxon_t>
33 taxon = taxon->GetParent();
43 template <
typename taxon_t>
48 count += (int)(taxon->GetData().mut_counts[type] > 0);
49 taxon = taxon->GetParent();
59 template <
typename taxon_t>
64 for (std::string type : types) {
65 count += (int)(taxon->GetData().mut_counts[type] > 0);
67 taxon = taxon->GetParent();
75 template <
typename taxon_t>
80 count += taxon->GetData().mut_counts[type];
81 taxon = taxon->GetParent();
89 template <
typename taxon_t>
94 for (std::string type : types) {
95 count += taxon->GetData().mut_counts[type];
97 taxon = taxon->GetParent();
107 template <
typename taxon_t>
113 if (taxon->GetData().GetFitness() < parent->GetData().GetFitness()) {
117 parent = taxon->GetParent();
125 template <
typename taxon_t>
131 if (taxon->GetData().phenotype != parent->GetData().phenotype) {
135 parent = taxon->GetParent();
143 template <
typename taxon_t>
146 std::set<decltype(taxon->GetData().phenotype)> seen;
149 if (!
Has(seen, taxon->GetData().phenotype)) {
151 seen.insert(taxon->GetData().phenotype);
153 taxon = taxon->GetParent();
int CountDeleteriousSteps(Ptr< taxon_t > taxon)
Definition: SystematicsAnalysis.h:108
int LineageLength(Ptr< taxon_t > taxon)
Definition: SystematicsAnalysis.h:28
int CountUniquePhenotypes(Ptr< taxon_t > taxon)
Definition: SystematicsAnalysis.h:144
bool Has(const MAP_T &in_map, const KEY_T &key)
Take any map type, and run find to determine if a key is present.
Definition: map_utils.h:21
int CountPhenotypeChanges(Ptr< taxon_t > taxon)
Definition: SystematicsAnalysis.h:126
If we are in emscripten, make sure to include the header.
Definition: array.h:37
int CountMuts(Ptr< taxon_t > taxon, std::string type="substitution")
Definition: SystematicsAnalysis.h:76
int CountMutSteps(Ptr< taxon_t > taxon, std::string type="substitution")
Definition: SystematicsAnalysis.h:44
Track genotypes, species, clades, or lineages of organisms in a world.