bpp-phyl3 3.0.0
SingleProcessSubstitutionMapping.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_SINGLEPROCESSSUBSTITUTIONMAPPING_H
6#define BPP_PHYL_MAPPING_PHYLOMAPPINGS_SINGLEPROCESSSUBSTITUTIONMAPPING_H
7
8
9#include "../../Likelihood/PhyloLikelihoods/SingleProcessPhyloLikelihood.h"
10#include "../ProbabilisticSubstitutionMapping.h"
11#include "../SubstitutionMappingTools.h"
12
14
16
17namespace bpp
18{
27 public std::enable_shared_from_this<SingleProcessSubstitutionMapping>
28{
29private:
30 std::shared_ptr<SingleProcessPhyloLikelihood> pSPP_;
31
37
38public:
40 std::shared_ptr<SingleProcessPhyloLikelihood> spp,
41 std::shared_ptr<SubstitutionRegisterInterface> reg,
42 std::shared_ptr<const AlphabetIndex2> weights,
43 std::shared_ptr<const AlphabetIndex2> distances,
44 double threshold = -1,
45 bool verbose = true);
46
49 pSPP_(sppm.pSPP_)
50 {}
51
53 {
55 pSPP_ = sppm.pSPP_;
56 return *this;
57 }
58
60
62
63 /*
64 * @brief ComputeCounts
65 *
66 * @param unresolvedOption mgmt of gaps in the counts (default: counted as zeros)
67 * @param threshold
68 * @param verbose
69 */
70 void computeCounts(short unresolvedOption = SubstitutionMappingTools::UNRESOLVED_ZERO, double threshold = -1, bool verbose = true)
71 {
75 getWeights(),
77 unresolvedOption,
78 threshold,
79 verbose);
80 }
81
82 /*
83 * @brief compute Normalization
84 *
85 * @param nullParams parameters values used for normalization
86 * @param unresolvedOption mgmt of gaps in the counts (default: counted as zeros)
87 * @param verbose
88 */
89
90 void computeNormalizations(const ParameterList& nullParams,
91 short unresolvedOption = SubstitutionMappingTools::UNRESOLVED_ZERO,
92 bool verbose = true);
93
94 /*
95 * @brief Return the tree of counts
96 *
97 */
98 size_t getNumberOfModels() const
99 {
100 return pSPP_->substitutionProcess().getNumberOfModels();
101 }
102
103 std::vector<size_t> getModelNumbers() const
104 {
105 return pSPP_->substitutionProcess().getModelNumbers();
106 }
107
109 {
110 return pSPP_->likelihoodCalculationSingleProcess();
111 }
112
114 {
115 return pSPP_->likelihoodCalculationSingleProcess();
116 }
117};
118} // end of namespace bpp.
119#endif // BPP_PHYL_MAPPING_PHYLOMAPPINGS_SINGLEPROCESSSUBSTITUTIONMAPPING_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 SingleProcessSubstitutionMapping class: substitution mapping linked with a SingleProcessPhyloLike...
SingleProcessSubstitutionMapping(std::shared_ptr< SingleProcessPhyloLikelihood > spp, std::shared_ptr< SubstitutionRegisterInterface > reg, std::shared_ptr< const AlphabetIndex2 > weights, std::shared_ptr< const AlphabetIndex2 > distances, double threshold=-1, bool verbose=true)
SingleProcessSubstitutionMapping * clone() const
LikelihoodCalculationSingleProcess & getLikelihoodCalculationSingleProcess()
const LikelihoodCalculationSingleProcess & getLikelihoodCalculationSingleProcess() const
SingleProcessSubstitutionMapping & operator=(const SingleProcessSubstitutionMapping &sppm)
std::shared_ptr< SingleProcessPhyloLikelihood > pSPP_
void computeCounts(short unresolvedOption=SubstitutionMappingTools::UNRESOLVED_ZERO, double threshold=-1, bool verbose=true)
ComputeCounts.
void setBranchedModelSet_()
Set the models of the BranchedModelSet to the adhoc branches, for normalization.
void computeNormalizations(const ParameterList &nullParams, short unresolvedOption=SubstitutionMappingTools::UNRESOLVED_ZERO, bool verbose=true)
compute Normalizations
SingleProcessSubstitutionMapping(const SingleProcessSubstitutionMapping &sppm)
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.