StochHMM
v0.34
Flexible Hidden Markov Model C++ Library and Application
|
#include <emm.h>
Public Member Functions | |
emm () | |
Create an emission. | |
emm (std::string &) | |
Constructs an empty emission. | |
~emm () | |
Constructs emission from a string;. | |
bool | parse (std::string &, tracks &, weights *, StateFuncs *) |
bool | parse (std::string &txt, track *trk) |
void | setRealNumber () |
Set the emission to a Real Number. | |
void | setComplement () |
Set the emission to be the complement 1-P of given value. | |
void | setLexicalFunction (emissionFunc *) |
bool | isReal () |
bool | isComplement () |
Check to see if emission will return the complement (1-P) value of emission. | |
double | get_emission (sequences &, size_t) |
double | get_emission (sequence &, size_t) |
emissionFuncParam * | getExtFunction () |
void | print () |
Print the string representation of the emission to stdout. | |
std::string | stringify () |
lexicalTable * | getTables () |
bool | isSimple () |
bool | isComplex () |
Private Member Functions | |
bool | _processTags (std::string &, tracks &, weights *, StateFuncs *) |
Parses the Emission Function Tag information from the text model definition. |
Private Attributes | |
bool | real_number |
bool | continuous |
bool | multi_continuous |
bool | complement |
track * | realTrack |
lexicalTable | scores |
bool | function |
emissionFuncParam * | lexFunc |
pdfFunc * | |
std::string | pdfName |
std::vector< double > * | dist_parameters |
multiPdfFunc * | multiPdf |
std::string | multiPdfName |
size_t | number_of_tracks |
std::vector< track * > * | trcks |
std::vector< size_t > * | track_indices |
std::vector< double > * | pass_values |
emissionFuncParam * | tagFunc |
Friends | |
class | state |
class | model |
Emissions for model Contains the emission definition. Each emissions contains the probability, the log(p(x), and counts Counts are used for calculating lower order emissions from higher order. This is only applicable at the beginning of the sequence. Each emission depends on some track or function, an emission can have multiple tracks. Or in other words output a single character from each track it is associated with. Tracks can be either alphabetic, real numbers values. Emissions can also call an external function that is user defined. If ambiguity is defined in the alphabet, the emission score can be defined as such If ambiguity is not defined the returned value will be -INFINITY
StochHMM::emm::emm | ( | ) |
Create an emission.
Definition at line 31 of file emm.cpp.
References complement, continuous, dist_parameters, lexFunc, multi_continuous, multiPdf, number_of_tracks, pass_values, pdf, real_number, realTrack, tagFunc, track_indices, and trcks.
StochHMM::emm::emm | ( | std::string & | ) |
Constructs an empty emission.
StochHMM::emm::~emm | ( | ) |
|
private |
Parses the Emission Function Tag information from the text model definition.
Definition at line 640 of file emm.cpp.
References StochHMM::extractTag(), StochHMM::emissionFuncParam::getTrackName(), StochHMM::tracks::isTrackDefined(), StochHMM::emissionFuncParam::parse(), StochHMM::stringList::size(), StochHMM::stringList::stringify(), and tagFunc.
Referenced by parse().
double StochHMM::emm::get_emission | ( | sequences & | seqs, |
size_t | pos | ||
) |
Calculate the emission value given a position in the sequence *If emission is a real number it will return the value from the real number track *If emission is a sequence then it will get the value and return it
seqs | Sequences to use |
iter | Position within the sequences |
Definition at line 681 of file emm.cpp.
References complement, continuous, dist_parameters, StochHMM::emissionFuncParam::evaluate(), StochHMM::track::getIndex(), StochHMM::lexicalTable::getValue(), lexFunc, multi_continuous, number_of_tracks, pass_values, real_number, realTrack, StochHMM::sequences::realValue(), scores, tagFunc, and track_indices.
Referenced by StochHMM::matrixPosition::getEmissionValue().
double StochHMM::emm::get_emission | ( | sequence & | seq, |
size_t | pos | ||
) |
Calculate the emission value given a position in the sequence If emission is a real number it will return the value from the real number track *If emission is a sequence then it will get the value and return it
seqs | Sequences to use |
iter | Position within the sequences |
Definition at line 733 of file emm.cpp.
References complement, continuous, dist_parameters, StochHMM::emissionFuncParam::evaluate(), StochHMM::lexicalTable::getValue(), lexFunc, multi_continuous, number_of_tracks, pass_values, real_number, StochHMM::sequence::realValue(), scores, and tagFunc.
|
inline |
|
inline |
|
inline |
Check to see if emission will return the complement (1-P) value of emission.
Definition at line 85 of file emm.h.
References complement.
|
inline |
bool StochHMM::emm::isReal | ( | ) |
Is the emission from a real Number track
Definition at line 783 of file emm.cpp.
References StochHMM::track::getAlphaType(), StochHMM::REAL, real_number, and realTrack.
|
inline |
bool StochHMM::emm::parse | ( | std::string & | txt, |
tracks & | trks, | ||
weights * | wts, | ||
StateFuncs * | funcs | ||
) |
Parse an emission from text model file
txt | String representation of emission |
trks | Tracks used by the model |
wts | Weights used by the model |
funcs | State functions used by the model |
Definition at line 69 of file emm.cpp.
References _processTags(), StochHMM::lexicalTable::addTrack(), StochHMM::AVERAGE_SCORE, complement, StochHMM::stringList::contains(), continuous, StochHMM::COUNTS, StochHMM::DEFINED_SCORE, dist_parameters, StochHMM::expVector(), StochHMM::lexicalTable::getAlphaSize(), StochHMM::lexicalTable::getCountsTable(), StochHMM::lexicalTable::getLogProbabilityTable(), StochHMM::StateFuncs::getMultivariatePdfFunction(), StochHMM::lexicalTable::getNumberOfAlphabets(), StochHMM::lexicalTable::getOrder(), StochHMM::StateFuncs::getPDFFunction(), StochHMM::lexicalTable::getProbabilityTable(), StochHMM::tracks::getTrack(), StochHMM::HIGHEST_SCORE, StochHMM::stringList::indexOf(), StochHMM::lexicalTable::initialize_emission_table(), StochHMM::int_to_string(), lexFunc, StochHMM::LOG_PROB, StochHMM::logVector(), StochHMM::LOWEST_SCORE, multi_continuous, multiPdf, multiPdfName, number_of_tracks, pass_values, pdf, pdfName, StochHMM::stringList::pop_ith(), StochHMM::POWER, StochHMM::PROBABILITY, StochHMM::probVector(), StochHMM::stringList::push_back(), real_number, realTrack, scores, StochHMM::lexicalTable::setUnkScore(), StochHMM::lexicalTable::setUnkScoreType(), StochHMM::stringList::size(), SIZE_MAX, StochHMM::stringList::splitString(), StochHMM::stringToDouble(), StochHMM::stringToInt(), StochHMM::stringList::toVecDouble(), track_indices, and trcks.
Referenced by StochHMM::PWM::_parseBackground(), StochHMM::state::_parseEmission(), and StochHMM::matrixPosition::parse().
bool StochHMM::emm::parse | ( | std::string & | txt, |
track * | trk | ||
) |
Parse an emission from text
txt | String representation of emission |
trks | Tracks used by the model |
wts | Weights used by the model |
funcs | State functions used by the model |
Definition at line 427 of file emm.cpp.
References StochHMM::lexicalTable::addTrack(), StochHMM::AVERAGE_SCORE, StochHMM::stringList::contains(), StochHMM::COUNTS, StochHMM::DEFINED_SCORE, StochHMM::expVector(), StochHMM::lexicalTable::getAlphaSize(), StochHMM::lexicalTable::getCountsTable(), StochHMM::lexicalTable::getLogProbabilityTable(), StochHMM::lexicalTable::getNumberOfAlphabets(), StochHMM::lexicalTable::getOrder(), StochHMM::lexicalTable::getProbabilityTable(), StochHMM::HIGHEST_SCORE, StochHMM::stringList::indexOf(), StochHMM::lexicalTable::initialize_emission_table(), StochHMM::int_to_string(), StochHMM::LOG_PROB, StochHMM::logVector(), StochHMM::LOWEST_SCORE, StochHMM::stringList::pop_ith(), StochHMM::POWER, StochHMM::PROBABILITY, StochHMM::probVector(), StochHMM::stringList::push_back(), scores, StochHMM::lexicalTable::setUnkScore(), StochHMM::lexicalTable::setUnkScoreType(), StochHMM::stringList::size(), StochHMM::stringList::splitString(), StochHMM::stringToDouble(), StochHMM::stringToInt(), tagFunc, and StochHMM::stringList::toVecDouble().
|
inline |
Print the string representation of the emission to stdout.
Definition at line 95 of file emm.h.
References stringify().
|
inline |
Set the emission to be the complement 1-P of given value.
Definition at line 76 of file emm.h.
References complement.
void StochHMM::emm::setLexicalFunction | ( | emissionFunc * | ) |
|
inline |
Set the emission to a Real Number.
Definition at line 73 of file emm.h.
References real_number.
std::string StochHMM::emm::stringify | ( | ) |
Definition at line 795 of file emm.cpp.
References StochHMM::AVERAGE_SCORE, complement, continuous, dist_parameters, StochHMM::double_to_string(), StochHMM::lexicalTable::getAmbDefinedScore(), StochHMM::lexicalTable::getAmbScoringType(), StochHMM::track::getName(), StochHMM::emissionFuncParam::getName(), StochHMM::lexicalTable::getOrder(), StochHMM::lexicalTable::getTrack(), StochHMM::emissionFuncParam::getTrack(), StochHMM::HIGHEST_SCORE, StochHMM::int_to_string(), StochHMM::join(), lexFunc, StochHMM::LOWEST_SCORE, multi_continuous, StochHMM::NO_SCORE, number_of_tracks, pdfName, real_number, realTrack, scores, StochHMM::lexicalTable::stringify(), StochHMM::emissionFuncParam::stringify(), tagFunc, and StochHMM::lexicalTable::trackSize().
Referenced by print(), StochHMM::PWM::stringify(), and StochHMM::matrixPosition::stringify().
|
private |
Definition at line 116 of file emm.h.
Referenced by emm(), get_emission(), isComplement(), parse(), setComplement(), and stringify().
|
private |
Definition at line 114 of file emm.h.
Referenced by emm(), get_emission(), parse(), and stringify().
|
private |
Definition at line 132 of file emm.h.
Referenced by emm(), get_emission(), parse(), and stringify().
|
private |
Definition at line 125 of file emm.h.
Referenced by emm(), get_emission(), parse(), stringify(), and ~emm().
|
private |
Definition at line 115 of file emm.h.
Referenced by emm(), get_emission(), parse(), and stringify().
|
private |
|
private |
|
private |
Definition at line 139 of file emm.h.
Referenced by emm(), get_emission(), parse(), and stringify().
|
private |
Definition at line 142 of file emm.h.
Referenced by emm(), get_emission(), and parse().
|
private |
|
private |
Definition at line 129 of file emm.h.
Referenced by parse(), and stringify().
|
private |
Definition at line 113 of file emm.h.
Referenced by emm(), get_emission(), isReal(), parse(), setRealNumber(), and stringify().
|
private |
Definition at line 118 of file emm.h.
Referenced by emm(), get_emission(), isReal(), parse(), and stringify().
|
private |
Definition at line 121 of file emm.h.
Referenced by get_emission(), getTables(), parse(), and stringify().
|
private |
Definition at line 145 of file emm.h.
Referenced by _processTags(), emm(), get_emission(), getExtFunction(), isComplex(), isSimple(), parse(), stringify(), and ~emm().
|
private |
Definition at line 141 of file emm.h.
Referenced by emm(), get_emission(), and parse().
|
private |