7 #include "../PatternTools.h"
8 #include "../Tree/TreeTemplateTools.h"
16 std::shared_ptr<const SiteContainerInterface> data,
19 treePtr_(std::move(tree)),
21 alphabet_(data->getAlphabet()),
33 std::shared_ptr<const SiteContainerInterface> data,
34 std::shared_ptr<const StateMapInterface> statesMap,
36 treePtr_(std::move(tree)),
38 alphabet_(data->getAlphabet()),
39 statesMap_(statesMap),
40 nbStates_(statesMap->getNumberOfModelStates())
57 data_ = dynamic_pointer_cast<const SiteContainerInterface>(tmp);
59 throw Exception(
"AbstractTreeParsimonyScore::init_ : Data must be plain alignments.");
61 if (
data_->getNumberOfSequences() == 1)
62 throw Exception(
"Error, only 1 sequence!");
63 if (
data_->getNumberOfSequences() == 0)
65 if (
data_->getAlphabet()->getSize() > 20)
66 throw Exception(
"Error, only alphabet with size <= 20 are supported. See the source file of AbstractTreeParsimonyScore.");
71 vector<unsigned int> scores(
data_->getNumberOfSites());
72 for (
size_t i = 0; i < scores.size(); i++)
void init_(std::shared_ptr< const SiteContainerInterface > data, bool verbose)
std::shared_ptr< TreeTemplate< Node > > treePtr_
std::vector< unsigned int > getScorePerSite() const override
Get the score for each site for the current tree, i.e. the total minimum number of changes in the tre...
std::shared_ptr< const SiteContainerInterface > data_
std::shared_ptr< const Alphabet > alphabet_
std::shared_ptr< const StateMapInterface > statesMap_
AbstractTreeParsimonyScore(std::shared_ptr< TreeTemplate< Node >> tree, std::shared_ptr< const SiteContainerInterface > data, bool verbose, bool includeGaps)
virtual unsigned int getScoreForSite(size_t site) const =0
Get the score for a given site for the current tree, i.e. the total minimum number of changes in the ...
The phylogenetic tree class.
Defines the basic types of data flow nodes.