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 
16 namespace bpp
17 {
26  public std::enable_shared_from_this<OneProcessSequenceSubstitutionMapping>
27 {
28 private:
29  std::shared_ptr<OneProcessSequencePhyloLikelihood> pOPSP_;
30 
35  void setBranchedModelSet_();
36 
37 public:
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  {
61  return new OneProcessSequenceSubstitutionMapping(*this);
62  }
63 
68  double threshold = -1, bool verbose = true) override
69  {
73  getWeights(),
74  getDistances(),
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 AlphabetIndex2 > getWeights() const
std::shared_ptr< const SubstitutionRegisterInterface > getSubstitutionRegister() const
std::shared_ptr< const AlphabetIndex2 > getDistances() const
std::unique_ptr< ProbabilisticSubstitutionMapping > counts_
The OneProcessSequenceSubstitutionMapping class: substitution mapping linked with a OneProcessSequenc...
void setBranchedModelSet_()
Set the models of the BranchedModelSet to the adhoc branches, for normalization.
OneProcessSequenceSubstitutionMapping(std::shared_ptr< OneProcessSequencePhyloLikelihood > spp, std::shared_ptr< SubstitutionRegisterInterface > reg, std::shared_ptr< const AlphabetIndex2 > weights, std::shared_ptr< const AlphabetIndex2 > distances)
OneProcessSequenceSubstitutionMapping * clone() const override
OneProcessSequenceSubstitutionMapping(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
LikelihoodCalculationSingleProcess & getLikelihoodCalculationSingleProcess()
OneProcessSequenceSubstitutionMapping & operator=(const OneProcessSequenceSubstitutionMapping &sppm)
std::shared_ptr< OneProcessSequencePhyloLikelihood > pOPSP_
const LikelihoodCalculationSingleProcess & getLikelihoodCalculationSingleProcess() const
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.