Skip to content

Commit

Permalink
Merge pull request #259 from ryneches/master
Browse files Browse the repository at this point in the history
User warning when induced root not found in gCF
  • Loading branch information
bqminh authored Jul 30, 2024
2 parents 74da454 + e875c33 commit 97238da
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion tree/discordance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,13 @@ void PhyloTree::computeGeneConcordance(MTreeSet &trees, map<string,string> &mean
// create the map from taxa between 2 trees
Split taxa_mask(leafNum);
for (StrVector::iterator it = taxname.begin(); it != taxname.end(); it++) {
if (name_map.find(*it) == name_map.end())
if (name_map.find(*it) == name_map.end()) {
if (*it == "__root__") {
cout << "WARNING : By default, trees without a multifurcation at the root are treated as rooted." << endl;
cout << " You may need to change your tree structure." << endl;
}
outError("Taxon not found in full tree: ", *it);
}
taxa_mask.addTaxon(name_map[*it]);
}
// make the taxa ordering right before converting to split system
Expand Down
9 changes: 7 additions & 2 deletions tree/mtree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2635,8 +2635,13 @@ void MTree::computeRFDist(istream &in, DoubleVector &dist, int assign_sup, bool
// create the map from taxa between 2 trees
Split taxa_mask(leafNum);
for (StrVector::iterator it = taxname.begin(); it != taxname.end(); it++) {
if (name_index.find(*it) == name_index.end())
outError("Taxon not found in full tree: ", *it);
if (name_index.find(*it) == name_index.end()) {
if (*it == "__root__") {
cout << "WARNING : By default, trees without a multifurcation at the root are treated as rooted." << endl;
cout << " You may need to change your tree structure." << endl;
}
outError("Taxon not found in full tree: ", *it);
}
taxid = name_index[*it];
taxa_mask.addTaxon(taxid);
}
Expand Down

0 comments on commit 97238da

Please sign in to comment.