StochHMM
v0.34
Flexible Hidden Markov Model C++ Library and Application
|
#include <traceback_path.h>
Public Member Functions | |
traceback_path (model *) | |
void | push_back (int) |
Add state to traceback. | |
void | clear () |
Erase the traceback. | |
size_t | size () const |
Returns the size (ie. length) of the traceback_path. | |
int | val (size_t it) |
Returns the state index at a given position (it) within the traceback sequence. | |
model * | getModel () const |
void | setModel (model *mdl) |
void | fprint_path (std::ofstream &) |
Print the path to file stream. | |
void | label (std::vector< std::string > &) |
Get the label of the traceback_path and assigns to vector<string> ref. | |
void | label (std::string &) |
Get traceback as string of state labels. | |
void | gff (std::vector< gff_feature > &, std::string &) |
void | name (std::vector< std::string > &) |
void | path (std::vector< int > &) |
void | print_path () const |
Path numbers correspond to state index in model. | |
void | print_label () const |
Print traceback_path labels to stdout. | |
void | print_gff (std::string, double, int, int, double) const |
Outputs the gff formatted output for the traceback to stdout. | |
void | print_gff (std::string) const |
Outputs the gff formatted output for the traceback. | |
double | getScore () |
Get the score that is associated with the traceback. | |
void | setScore (double scr) |
Set the score for the traceback;. | |
int | operator[] (size_t val) const |
bool | operator== (const traceback_path &) const |
Check to see if paths are the same. | |
bool | operator< (const traceback_path &) const |
Comparison operators for path. | |
bool | operator> (const traceback_path &) const |
Comparison operators for path. | |
bool | operator<= (const traceback_path &) const |
Comparison operators for path. | |
bool | operator>= (const traceback_path &) const |
Comparison operators for path. |
Private Attributes | |
model * | hmm |
std::vector< int > | trace_path |
double | score |
Perform traceback of traceback table Stores one traceback path for a sequence
Definition at line 63 of file traceback_path.h.
StochHMM::traceback_path::traceback_path | ( | model * | modl | ) |
Create a traceback_path
modl | Pointer to model file |
Definition at line 35 of file traceback_path.cpp.
References hmm.
void StochHMM::traceback_path::clear | ( | ) |
Erase the traceback.
Clears all traceback path information.
Definition at line 51 of file traceback_path.cpp.
References trace_path.
void StochHMM::traceback_path::fprint_path | ( | std::ofstream & | file | ) |
Print the path to file stream.
Definition at line 202 of file traceback_path.cpp.
References size(), SIZE_MAX, and trace_path.
|
inline |
Get the model used for the decoding
Definition at line 88 of file traceback_path.h.
References hmm.
Referenced by StochHMM::trellis::traceback().
|
inline |
Get the score that is associated with the traceback.
Definition at line 138 of file traceback_path.h.
References score.
Referenced by print_output().
void StochHMM::traceback_path::gff | ( | std::vector< gff_feature > & | pth, |
std::string & | sequenceName | ||
) |
Get traceback as vector of gff_features
[out] | pth | reference to vector of gff_feature |
[in] | sequenceName | Name of Sequence to be used in GFF |
Get GFF output of traceback path
[out] | pth |
Definition at line 109 of file traceback_path.cpp.
References StochHMM::gff_feature::attribute, StochHMM::gff_feature::end, StochHMM::gff_feature::feature, StochHMM::gff_feature::frame, StochHMM::state::getGFF(), StochHMM::model::getName(), StochHMM::model::getState(), hmm, StochHMM::gff_feature::score, StochHMM::gff_feature::seqname, size(), SIZE_MAX, StochHMM::gff_feature::source, StochHMM::gff_feature::start, StochHMM::gff_feature::strand, and trace_path.
void StochHMM::traceback_path::label | ( | std::vector< std::string > & | pth | ) |
Get the label of the traceback_path and assigns to vector<string> ref.
Get traceback as vector of state labels
[out] | std::vector<std::string> | Vector of Labels |
Definition at line 65 of file traceback_path.cpp.
References StochHMM::state::getLabel(), StochHMM::model::getState(), hmm, SIZE_MAX, and trace_path.
void StochHMM::traceback_path::label | ( | std::string & | pth | ) |
Get traceback as string of state labels.
Get string of path label traceback
[out] | pth | std::string |
Definition at line 76 of file traceback_path.cpp.
References StochHMM::state::getLabel(), StochHMM::model::getState(), hmm, SIZE_MAX, and trace_path.
void StochHMM::traceback_path::name | ( | std::vector< std::string > & | pth | ) |
Get names of traceback path
[out] | pth | vector<string> |
Definition at line 92 of file traceback_path.cpp.
References StochHMM::state::getName(), StochHMM::model::getState(), hmm, SIZE_MAX, and trace_path.
bool StochHMM::traceback_path::operator< | ( | const traceback_path & | rhs | ) | const |
Comparison operators for path.
Definition at line 222 of file traceback_path.cpp.
References trace_path.
bool StochHMM::traceback_path::operator<= | ( | const traceback_path & | rhs | ) | const |
Comparison operators for path.
Definition at line 242 of file traceback_path.cpp.
References trace_path.
bool StochHMM::traceback_path::operator== | ( | const traceback_path & | rhs | ) | const |
Check to see if paths are the same.
Definition at line 212 of file traceback_path.cpp.
References trace_path.
bool StochHMM::traceback_path::operator> | ( | const traceback_path & | rhs | ) | const |
Comparison operators for path.
Definition at line 232 of file traceback_path.cpp.
References trace_path.
bool StochHMM::traceback_path::operator>= | ( | const traceback_path & | rhs | ) | const |
Comparison operators for path.
Definition at line 252 of file traceback_path.cpp.
References trace_path.
|
inline |
void StochHMM::traceback_path::path | ( | std::vector< int > & | pth | ) |
Get the path to std::vector<int>
[out] | pth | std::vector<int> that represents path |
Definition at line 58 of file traceback_path.cpp.
References trace_path.
void StochHMM::traceback_path::print_gff | ( | std::string | sequence_name, |
double | score, | ||
int | ranking, | ||
int | times, | ||
double | posterior | ||
) | const |
Outputs the gff formatted output for the traceback to stdout.
Outputs the gff formatted output for the traceback to stdout *Allows user to provide additional information, that may be *pertinent to stochastic tracebacks
[in] | sequence_name | Name of sequence used |
[in] | score | score to use in the GFF output |
[in] | ranking | Rank of traceback |
[in] | times | Number of times that traceback occurred |
[in] | posterior | Posterior probability score |
Definition at line 285 of file traceback_path.cpp.
References StochHMM::state::getGFF(), StochHMM::model::getState(), hmm, size(), SIZE_MAX, and trace_path.
Referenced by print_output().
void StochHMM::traceback_path::print_gff | ( | std::string | sequence_name | ) | const |
Outputs the gff formatted output for the traceback.
outputs the gff formatted output for the traceback
Definition at line 331 of file traceback_path.cpp.
References StochHMM::state::getGFF(), StochHMM::model::getState(), hmm, size(), SIZE_MAX, and trace_path.
void StochHMM::traceback_path::print_label | ( | ) | const |
Print traceback_path labels to stdout.
Print the traceback path as state labels State labels
Definition at line 263 of file traceback_path.cpp.
References StochHMM::state::getLabel(), StochHMM::model::getState(), hmm, SIZE_MAX, and trace_path.
Referenced by print_output().
void StochHMM::traceback_path::print_path | ( | ) | const |
Path numbers correspond to state index in model.
Print the path to stdout.
Print the traceback path as path to stdout using cout
Definition at line 192 of file traceback_path.cpp.
References size(), SIZE_MAX, and trace_path.
Referenced by print_output().
void StochHMM::traceback_path::push_back | ( | int | state | ) |
Add state to traceback.
Pushes a state index onto the end of the path
state | Index of state to add |
Definition at line 41 of file traceback_path.cpp.
References trace_path.
Referenced by StochHMM::stochTable::traceback(), StochHMM::alt_simple_stochTable::traceback(), StochHMM::trellis::traceback(), StochHMM::trellis::traceback_nth(), StochHMM::trellis::traceback_posterior(), and StochHMM::trellis::traceback_stoch_posterior().
|
inline |
Definition at line 89 of file traceback_path.h.
References hmm.
Referenced by StochHMM::trellis::traceback().
|
inline |
Set the score for the traceback;.
Definition at line 143 of file traceback_path.h.
References score.
Referenced by StochHMM::trellis::traceback(), and StochHMM::trellis::traceback_nth().
size_t StochHMM::traceback_path::size | ( | void | ) | const |
Returns the size (ie. length) of the traceback_path.
Get the size of traceback
Definition at line 46 of file traceback_path.cpp.
References trace_path.
Referenced by fprint_path(), gff(), print_gff(), and print_path().
|
inline |
Returns the state index at a given position (it) within the traceback sequence.
Definition at line 78 of file traceback_path.h.
References trace_path.
Referenced by operator[]().
|
private |
Definition at line 156 of file traceback_path.h.
Referenced by getModel(), gff(), label(), name(), print_gff(), print_label(), setModel(), and traceback_path().
|
private |
Definition at line 158 of file traceback_path.h.
Referenced by getScore(), and setScore().
|
private |
Definition at line 157 of file traceback_path.h.
Referenced by clear(), fprint_path(), gff(), label(), name(), operator<(), operator<=(), operator==(), operator>(), operator>=(), operator[](), path(), print_gff(), print_label(), print_path(), push_back(), size(), and val().