41 #include "../PatternTools.h" 42 #include "../TreeTemplateTools.h" 44 #include <Bpp/App/ApplicationTools.h> 51 const SiteContainer& data,
57 alphabet_(data.getAlphabet()),
62 nbStates_ = statesMap_->getNumberOfModelStates();
69 const SiteContainer& data,
75 alphabet_(data.getAlphabet()),
76 statesMap_(statesMap),
77 nbStates_(statesMap->getNumberOfModelStates())
84 if (tree_->isRooted())
87 ApplicationTools::displayWarning(
"Tree has been unrooted.");
94 if (data_->getNumberOfSequences() == 1)
throw Exception(
"Error, only 1 sequence!");
95 if (data_->getNumberOfSequences() == 0)
throw Exception(
"Error, no sequence!");
96 if (data_->getAlphabet()->getSize() > 20)
throw Exception(
"Error, only alphabet with size <= 20 are supported. See the source file of AbstractTreeParsimonyScore.");
101 vector<unsigned int> scores(data_->getNumberOfSites());
102 for (
size_t i = 0; i < scores.size(); i++)
104 scores[i] = getScoreForSite(i);
This class implements a state map where all resolved states are modeled.
AbstractTreeParsimonyScore(const Tree &tree, const SiteContainer &data, bool verbose, bool includeGaps)
The phylogenetic tree class.
Interface for phylogenetic tree objects.
void init_(const SiteContainer &data, bool verbose)
virtual std::vector< unsigned int > getScoreForEachSite() const
Get the score for each site for the current tree, i.e. the total minimum number of changes in the tre...
Map the states of a given alphabet which have a model state.