bpp-phyl3
3.0.0
HmmPhyloEmissionProbabilities.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_LIKELIHOOD_PHYLOLIKELIHOODS_HMMPHYLOEMISSIONPROBABILITIES_H
6
#define BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_HMMPHYLOEMISSIONPROBABILITIES_H
7
8
#include <
Bpp/Numeric/AbstractParametrizable.h
>
9
10
#include "../DataFlow/DataFlowCWise.h"
11
#include "../HmmEmissionProbabilities_Eigen.h"
12
#include "
HmmPhyloAlphabet.h
"
13
14
namespace
bpp
15
{
16
using
EmissionLogk
=
CWiseCompound<MatrixLik, ReductionOf<RowLik>
>;
17
23
class
HmmPhyloEmissionProbabilities
:
24
public
virtual
HmmEmissionProbabilities_Eigen
,
25
public
AbstractParametrizable
26
{
27
private
:
28
Context
&
context_
;
29
30
std::shared_ptr<HmmPhyloAlphabet>
phylAlph_
;
31
32
/*
33
*@brief Emission likelihoods are stored in a Matrix from a set of
34
* RowVectors.
35
*
36
*/
37
38
ValueRef<MatrixLik>
emProb_
;
39
40
size_t
nbSites_
;
41
42
public
:
43
HmmPhyloEmissionProbabilities
(std::shared_ptr<HmmPhyloAlphabet> alphabet);
44
45
HmmPhyloEmissionProbabilities
(
const
HmmPhyloEmissionProbabilities
& hEP) :
46
AbstractParametrizable
(hEP),
47
context_
(hEP.
context_
),
48
phylAlph_
(hEP.
phylAlph_
),
49
emProb_
(hEP.
emProb_
),
50
nbSites_
(hEP.
nbSites_
)
51
{}
52
53
HmmPhyloEmissionProbabilities
*
clone
()
const
{
return
new
HmmPhyloEmissionProbabilities
(*
this
);}
54
55
const
HmmStateAlphabet
*
getHmmStateAlphabet
()
const
56
{
57
return
phylAlph_
.get();
58
}
59
60
size_t
getNumberOfStates
()
const
61
{
62
return
phylAlph_
->getNumberOfStates();
63
}
64
65
size_t
getNumberOfSites
()
const
66
{
67
return
nbSites_
;
68
}
69
76
void
setHmmStateAlphabet
(std::shared_ptr<HmmStateAlphabet> stateAlphabet);
77
88
DataLik
operator()
(
size_t
pos,
size_t
state)
const
89
{
90
return
(
emProb_
->targetValue())(Eigen::Index(state), Eigen::Index(pos));
91
}
92
93
ValueRef<MatrixLik>
getEmissionProbabilities
()
94
{
95
return
emProb_
;
96
}
97
107
VectorLik
operator()
(
size_t
pos)
const
108
{
109
return
emProb_
->targetValue().col(Eigen::Index(pos));
110
}
111
115
size_t
getNumberOfPositions
()
const
116
{
117
return
nbSites_
;
118
}
119
};
120
}
// end of namespace bpp.
121
#endif
// BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_HMMPHYLOEMISSIONPROBABILITIES_H
AbstractParametrizable.h
HmmPhyloAlphabet.h
bpp::AbstractParametrizable
bpp::CWiseCompound
Definition:
DataFlowCWise.h:80
bpp::Context
Context for dataflow node construction.
Definition:
DataFlow.h:527
bpp::ExtendedFloatEigen
Definition:
ExtendedFloatEigen.h:68
bpp::ExtendedFloat
Definition:
ExtendedFloat.h:38
bpp::HmmEmissionProbabilities_Eigen
Interface for computing emission probabilities in a Hidden Markov Model.
Definition:
HmmEmissionProbabilities_Eigen.h:31
bpp::HmmPhyloEmissionProbabilities
Emission probabilities in the context of DF phylolikeihoods.
Definition:
HmmPhyloEmissionProbabilities.h:26
bpp::HmmPhyloEmissionProbabilities::operator()
VectorLik operator()(size_t pos) const
Operator access to the emission probabilities.
Definition:
HmmPhyloEmissionProbabilities.h:107
bpp::HmmPhyloEmissionProbabilities::emProb_
ValueRef< MatrixLik > emProb_
Definition:
HmmPhyloEmissionProbabilities.h:38
bpp::HmmPhyloEmissionProbabilities::context_
Context & context_
Definition:
HmmPhyloEmissionProbabilities.h:28
bpp::HmmPhyloEmissionProbabilities::operator()
DataLik operator()(size_t pos, size_t state) const
Operator access to the emission probabilities.
Definition:
HmmPhyloEmissionProbabilities.h:88
bpp::HmmPhyloEmissionProbabilities::getEmissionProbabilities
ValueRef< MatrixLik > getEmissionProbabilities()
Definition:
HmmPhyloEmissionProbabilities.h:93
bpp::HmmPhyloEmissionProbabilities::HmmPhyloEmissionProbabilities
HmmPhyloEmissionProbabilities(std::shared_ptr< HmmPhyloAlphabet > alphabet)
Definition:
HmmPhyloEmissionProbabilities.cpp:10
bpp::HmmPhyloEmissionProbabilities::HmmPhyloEmissionProbabilities
HmmPhyloEmissionProbabilities(const HmmPhyloEmissionProbabilities &hEP)
Definition:
HmmPhyloEmissionProbabilities.h:45
bpp::HmmPhyloEmissionProbabilities::setHmmStateAlphabet
void setHmmStateAlphabet(std::shared_ptr< HmmStateAlphabet > stateAlphabet)
Set the new hidden state alphabet.
Definition:
HmmPhyloEmissionProbabilities.cpp:21
bpp::HmmPhyloEmissionProbabilities::getNumberOfPositions
size_t getNumberOfPositions() const
Definition:
HmmPhyloEmissionProbabilities.h:115
bpp::HmmPhyloEmissionProbabilities::clone
HmmPhyloEmissionProbabilities * clone() const
Definition:
HmmPhyloEmissionProbabilities.h:53
bpp::HmmPhyloEmissionProbabilities::getNumberOfSites
size_t getNumberOfSites() const
Definition:
HmmPhyloEmissionProbabilities.h:65
bpp::HmmPhyloEmissionProbabilities::phylAlph_
std::shared_ptr< HmmPhyloAlphabet > phylAlph_
Definition:
HmmPhyloEmissionProbabilities.h:30
bpp::HmmPhyloEmissionProbabilities::getNumberOfStates
size_t getNumberOfStates() const
Definition:
HmmPhyloEmissionProbabilities.h:60
bpp::HmmPhyloEmissionProbabilities::getHmmStateAlphabet
const HmmStateAlphabet * getHmmStateAlphabet() const
Definition:
HmmPhyloEmissionProbabilities.h:55
bpp::HmmPhyloEmissionProbabilities::nbSites_
size_t nbSites_
Definition:
HmmPhyloEmissionProbabilities.h:40
bpp::HmmStateAlphabet
bpp
Defines the basic types of data flow nodes.
bpp::ValueRef
std::shared_ptr< Value< T > > ValueRef
Shared pointer alias for Value<T>.
Definition:
DataFlow.h:84
Bpp
Phyl
Likelihood
PhyloLikelihoods
HmmPhyloEmissionProbabilities.h
Generated on Fri Jul 19 2024 11:49:21 for bpp-phyl3 by
1.9.1