bpp-phyl3 3.0.0
OneProcessSequenceSubstitutionMapping.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: The Bio++ Development Group
2//
3// SPDX-License-Identifier: CECILL-2.1
4
5#ifndef BPP_PHYL_MAPPING_PHYLOMAPPINGS_ONEPROCESSSEQUENCESUBSTITUTIONMAPPING_H
6#define BPP_PHYL_MAPPING_PHYLOMAPPINGS_ONEPROCESSSEQUENCESUBSTITUTIONMAPPING_H
7
8
9#include "../../Likelihood/PhyloLikelihoods/OneProcessSequencePhyloLikelihood.h"
10#include "../SubstitutionMappingTools.h"
11
13
15
16namespace bpp
17{
26 public std::enable_shared_from_this<OneProcessSequenceSubstitutionMapping>
27{
28private:
29 std::shared_ptr<OneProcessSequencePhyloLikelihood> pOPSP_;
30
36
37public:
39 std::shared_ptr<OneProcessSequencePhyloLikelihood> spp,
40 std::shared_ptr<SubstitutionRegisterInterface> reg,
41 std::shared_ptr<const AlphabetIndex2> weights,
42 std::shared_ptr<const AlphabetIndex2> distances);
43
46 pOPSP_(sppm.pOPSP_)
47 {}
48
50 {
52 pOPSP_ = sppm.pOPSP_;
53
54 return *this;
55 }
56
58
60 {
62 }
63
68 double threshold = -1, bool verbose = true) override
69 {
73 getWeights(),
75 unresolvedOption,
76 threshold,
77 verbose);
78 }
79
80 /*
81 * @param nullParams parameters values used for normalization
82 * @param unresolvedOption mgmt of gaps in the counts (default: counted as zeros)
83 * @param verbose
84 */
85
86 void computeNormalizations(const ParameterList& nullParams,
87 short unresolvedOption = SubstitutionMappingTools::UNRESOLVED_ZERO,
88 bool verbose = true) override;
89
90
91 size_t getNumberOfModels() const override
92 {
93 return pOPSP_->substitutionProcess().getNumberOfModels();
94 }
95
96 std::vector<size_t> getModelNumbers() const override
97 {
98 return pOPSP_->substitutionProcess().getModelNumbers();
99 }
100
102 {
103 return *pOPSP_->getLikelihoodCalculationSingleProcess();
104 }
105
107 {
108 return *pOPSP_->getLikelihoodCalculationSingleProcess();
109 }
110};
111} // end of namespace bpp.
112#endif // BPP_PHYL_MAPPING_PHYLOMAPPINGS_ONEPROCESSSEQUENCESUBSTITUTIONMAPPING_H
The AbstractSinglePhyloSubstitutionMapping class: substitution mapping linked with a Single Process P...
AbstractSinglePhyloSubstitutionMapping & operator=(const AbstractSinglePhyloSubstitutionMapping &sppm)
std::shared_ptr< const SubstitutionRegisterInterface > getSubstitutionRegister() const
std::shared_ptr< const AlphabetIndex2 > getWeights() const
std::unique_ptr< ProbabilisticSubstitutionMapping > counts_
std::shared_ptr< const AlphabetIndex2 > getDistances() const
The OneProcessSequenceSubstitutionMapping class: substitution mapping linked with a OneProcessSequenc...
void setBranchedModelSet_()
Set the models of the BranchedModelSet to the adhoc branches, for normalization.
const LikelihoodCalculationSingleProcess & getLikelihoodCalculationSingleProcess() const
OneProcessSequenceSubstitutionMapping(std::shared_ptr< OneProcessSequencePhyloLikelihood > spp, std::shared_ptr< SubstitutionRegisterInterface > reg, std::shared_ptr< const AlphabetIndex2 > weights, std::shared_ptr< const AlphabetIndex2 > distances)
OneProcessSequenceSubstitutionMapping(const OneProcessSequenceSubstitutionMapping &sppm)
LikelihoodCalculationSingleProcess & getLikelihoodCalculationSingleProcess()
OneProcessSequenceSubstitutionMapping & operator=(const OneProcessSequenceSubstitutionMapping &sppm)
void computeCounts(short unresolvedOption=SubstitutionMappingTools::UNRESOLVED_ZERO, double threshold=-1, bool verbose=true) override
ComputeCounts.
void computeNormalizations(const ParameterList &nullParams, short unresolvedOption=SubstitutionMappingTools::UNRESOLVED_ZERO, bool verbose=true) override
compute Normalizations
OneProcessSequenceSubstitutionMapping * clone() const override
std::shared_ptr< OneProcessSequencePhyloLikelihood > pOPSP_
static const short UNRESOLVED_ZERO
Constants describing how unresolved characters are counted:
static std::unique_ptr< ProbabilisticSubstitutionMapping > computeCounts(LikelihoodCalculationSingleProcess &rltc, SubstitutionCountInterface &substitutionCount, short unresolvedOption=UNRESOLVED_ZERO, double threshold=-1, bool verbose=true)
Methods to compute mapping Trees.
Defines the basic types of data flow nodes.