Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in systematics #419

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
updated GetPhylogenticDiversity() function
  • Loading branch information
abbywlsn committed Jun 2, 2021
commit e5c154b223d71274fe0804b13494facc098a3396
116 changes: 116 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions include/emp/Evolve/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions include/emp/Evolve/.idea/Evolve.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions include/emp/Evolve/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions include/emp/Evolve/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions include/emp/Evolve/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions include/emp/Evolve/Systematics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,21 +924,21 @@ namespace emp {
* origination of parent and origination of offspring
* - Enable a paleontology compatibility mode where only branching points are calculated
*/
int GetPhylogeneticDiversity() const {
// As shown on page 5 of Faith 1992, when all branch lengths are equal the phylogenetic
// diversity is the number of internal nodes plus the number of extant taxa - 1.
//int phylodiversity = ancestor_taxa.size() + active_taxa.size() -1;
// int GetPhylogeneticDiversity() const {
// // As shown on page 5 of Faith 1992, when all branch lengths are equal the phylogenetic
// // diversity is the number of internal nodes plus the number of extant taxa - 1.
// //int phylodiversity = ancestor_taxa.size() + active_taxa.size() -1;

return ancestor_taxa.size() + active_taxa.size() - 1;
}
// return ancestor_taxa.size() + active_taxa.size() - 1;
// }


/// @returns phylogenetic diversity if used without any arguments .
/// If you want to receive normalized data, you need to include the number of generations
/// your tree has (multiples of 10 from 10 to 100 are allowed)
/// you also need to specify a file with which to normalize your data.
/// If value is outside of the values in the file, 100th percentile will be returned
int GetPhylogeneticDiversityNormalize(int generation = 0, std::string filename = "") const;
int GetPhylogeneticDiversity(int generation = 0, std::string filename = "") const;


/** This is a metric of how distinct \c tax is from the rest of the population.
Expand Down Expand Up @@ -1858,7 +1858,7 @@ namespace emp {
}

template <typename ORG, typename ORG_INFO, typename DATA_STRUCT>
int Systematics<ORG, ORG_INFO, DATA_STRUCT>::GetPhylogeneticDiversityNormalize(int generation, std::string filename) const {
int Systematics<ORG, ORG_INFO, DATA_STRUCT>::GetPhylogeneticDiversity(int generation, std::string filename) const {
int gen_value = ((generation / 10) - 1); //indexes from 0, 100 generations would correspond to the 10th line in the csv
bool percent_found = false;
int phylogenetic_diversity = ancestor_taxa.size() + active_taxa.size() - 1;
Expand Down
2 changes: 1 addition & 1 deletion third-party/Catch
Submodule Catch updated 481 files
2 changes: 1 addition & 1 deletion third-party/cereal
Submodule cereal updated 161 files