StochHMM
v0.34
Flexible Hidden Markov Model C++ Library and Application
|
#include <sequences.h>
Public Member Functions | |
sequences () | |
sequences (size_t sz) | |
sequences (tracks *tr) | |
sequences (const sequences &) | |
sequences & | operator= (const sequences &) |
Assignment Operator. | |
~sequences () | |
Destroy sequences. | |
double | realValue (int, size_t) |
double | realValue (size_t, size_t) |
short | seqValue (int, size_t) |
sequence * | getSeq (size_t) |
double | getAttrib (size_t iter) |
std::string & | getHeader () |
std::string & | getHeader (size_t iter) |
std::string * | getUndigitized (size_t iter) |
size_t | size () |
size_t | getLength (size_t iter) |
size_t | getLength () |
bool | exDefDefined (size_t) |
bool | exDefDefined (size_t, size_t) |
double | getWeight (size_t, size_t) |
bool | exDefDefined () |
Get Weight value for state at position. | |
void | print () |
Is External definition defined. | |
std::string | stringify () |
std::string | undigitize () |
Get string of sequences. | |
void | addSeq (sequence *sq) |
Get sequence based on alphabet. | |
void | addSeq (sequence *, size_t) |
void | addSeq (sequence *, track *) |
Add sequence for track. | |
void | setLength (size_t len) |
Set Length of sequences. | |
void | setExDef (ExDefSequence *ex) |
bool | isSameSize () |
sequence & | operator[] (size_t index) |
void | getFastas (const std::string &, track *) |
Private Attributes | |
ExDefSequence * | external |
std::vector< sequence * > | seq |
size_t | length |
size_t | num_of_sequences |
bool | related_sequences |
bool | same_length |
Container hold the track sequence(s) Each sequence have to be the same length Created to pass multiple sequence tracks of different datasets to the HMM If you need multiple unrelated sequences, use std::vector<sequence> instead.
Definition at line 51 of file sequences.h.
StochHMM::sequences::sequences | ( | ) |
Definition at line 35 of file sequences.cpp.
References external, length, num_of_sequences, related_sequences, and same_length.
StochHMM::sequences::sequences | ( | size_t | sz | ) |
Create an empty sequences
sz | Number of sequences |
Definition at line 46 of file sequences.cpp.
References external, length, num_of_sequences, related_sequences, and same_length.
StochHMM::sequences::sequences | ( | tracks * | tr | ) |
Create a sequences data t
sz | Number of sequences |
Definition at line 57 of file sequences.cpp.
References external, length, num_of_sequences, related_sequences, same_length, and StochHMM::tracks::size().
StochHMM::sequences::sequences | ( | const sequences & | rhs | ) |
Definition at line 66 of file sequences.cpp.
References external, length, num_of_sequences, related_sequences, same_length, and seq.
StochHMM::sequences::~sequences | ( | ) |
void StochHMM::sequences::addSeq | ( | sequence * | sq | ) |
Get sequence based on alphabet.
Add a sequence to the sequences *Sequence is added to a certain position based on the track used by the sequence
sq | Pointer to sequence |
Definition at line 262 of file sequences.cpp.
References StochHMM::track::getIndex(), StochHMM::sequence::getLength(), StochHMM::sequence::getTrack(), num_of_sequences, related_sequences, seq, and setLength().
Referenced by addSeq(), getFastas(), and StochHMM::seqTracks::getNext().
void StochHMM::sequences::addSeq | ( | sequence * | sq, |
size_t | iter | ||
) |
Add sequence in the track position
Add | a sequence to the sequences at a certain position *Sequence is added to a certain position based on the iterator |
sq | Pointer to sequence |
iter | Position in sequences to add sequence |
Definition at line 281 of file sequences.cpp.
References StochHMM::sequence::getLength(), num_of_sequences, related_sequences, seq, and setLength().
Add sequence for track.
Add a sequence to the sequences given a certain track *Sequence is added to a certain position based on the track
sq | Pointer to sequence |
tr | Track to use when adding sequence |
Definition at line 303 of file sequences.cpp.
References addSeq(), StochHMM::track::getIndex(), and related_sequences.
bool StochHMM::sequences::exDefDefined | ( | size_t | pos | ) |
Check to see if ther is an external definition defined for a certain position within the sequences
pos | Position within the sequence |
Definition at line 223 of file sequences.cpp.
References StochHMM::ExDefSequence::defs, and external.
Referenced by StochHMM::trellis::backward(), StochHMM::trellis::fast_complex_viterbi(), StochHMM::trellis::forward(), StochHMM::trellis::naive_nth_viterbi(), StochHMM::trellis::naive_stochastic_viterbi(), StochHMM::trellis::naive_viterbi(), StochHMM::trellis::posterior(), StochHMM::trellis::simple_backward(), StochHMM::trellis::simple_forward(), StochHMM::trellis::simple_nth_viterbi(), StochHMM::trellis::simple_posterior(), StochHMM::trellis::simple_simple_stochastic_viterbi(), StochHMM::trellis::simple_stochastic_forward(), StochHMM::trellis::simple_stochastic_viterbi(), StochHMM::trellis::simple_viterbi(), StochHMM::trellis::sparse_complex_viterbi(), StochHMM::trellis::stochastic_forward(), StochHMM::trellis::stochastic_viterbi(), StochHMM::trellis::trellis(), and StochHMM::trellis::viterbi().
bool StochHMM::sequences::exDefDefined | ( | size_t | pos, |
size_t | stateIter | ||
) |
Check to see if there is an external definition defined for a certain state at a certain position
pos | Position within the sequence |
Definition at line 235 of file sequences.cpp.
References StochHMM::ExDefSequence::defined(), StochHMM::ExDefSequence::defs, and external.
bool StochHMM::sequences::exDefDefined | ( | ) |
Get Weight value for state at position.
Check to see if there are any external definitions defined
Definition at line 247 of file sequences.cpp.
References external.
|
inline |
Get the attribute value for a particular sequence
iter | Sequence to get the attribute from |
Definition at line 79 of file sequences.h.
References num_of_sequences, and seq.
void StochHMM::sequences::getFastas | ( | const std::string & | filename, |
track * | tr | ||
) |
Definition at line 347 of file sequences.cpp.
References addSeq(), and StochHMM::sequence::getFasta().
Referenced by main().
|
inline |
Get the header for the first sequence
Definition at line 90 of file sequences.h.
References num_of_sequences, and seq.
Referenced by perform_nbest_decoding(), perform_posterior(), perform_stochastic_decoding(), perform_viterbi_decoding(), print_limited_posterior(), and print_posterior().
|
inline |
Get the header for the ith sequence
iter | size_t iterator for ith sequence |
Definition at line 102 of file sequences.h.
References num_of_sequences, and seq.
|
inline |
Get the length of the ith sequence
iter | size_t iterator |
Definition at line 135 of file sequences.h.
References num_of_sequences, and seq.
Referenced by StochHMM::trellis::backward(), StochHMM::trellis::forward(), StochHMM::seqTracks::getNext(), StochHMM::trellis::naive_stochastic_viterbi(), StochHMM::trellis::naive_viterbi(), StochHMM::trellis::posterior(), StochHMM::trellis::simple_backward(), StochHMM::trellis::simple_forward(), StochHMM::trellis::simple_posterior(), StochHMM::trellis::simple_simple_stochastic_viterbi(), StochHMM::trellis::simple_stochastic_viterbi(), StochHMM::trellis::simple_viterbi(), StochHMM::trellis::stochastic_forward(), StochHMM::trellis::stochastic_viterbi(), StochHMM::trellis::trellis(), and StochHMM::trellis::viterbi().
|
inline |
Get the length of sequences in general *All of the sequence(s) should be the same length
Definition at line 145 of file sequences.h.
References length.
sequence * StochHMM::sequences::getSeq | ( | size_t | iter | ) |
Get pointer to ith sequence from sequences
iter | Iterator to use for extracting sequence; |
Definition at line 174 of file sequences.cpp.
References seq.
Referenced by StochHMM::PWM::scoreSimple(), StochHMM::PWM::scoreUndefSpacer(), StochHMM::PWM::scoreVariableSpacer(), and StochHMM::trellis::transitionFuncTraceback().
|
inline |
Get the undigitized ith sequence from sequences
iter | size_t iterator for ith sequence |
Definition at line 116 of file sequences.h.
References seq.
Referenced by StochHMM::emissionFuncParam::evaluate(), StochHMM::seqTracks::getNext(), and StochHMM::trellis::transitionFuncTraceback().
double StochHMM::sequences::getWeight | ( | size_t | position, |
size_t | stateIter | ||
) |
Get the weight for the state at a certain position in the sequence
position | Position with the sequence |
stateIter | integer iterator of the state |
Definition at line 254 of file sequences.cpp.
References external, and StochHMM::ExDefSequence::getWeight().
Referenced by StochHMM::trellis::fast_complex_viterbi(), StochHMM::trellis::naive_forward(), StochHMM::trellis::naive_nth_viterbi(), StochHMM::trellis::naive_stochastic_forward(), StochHMM::trellis::naive_stochastic_viterbi(), StochHMM::trellis::naive_viterbi(), StochHMM::trellis::simple_backward(), StochHMM::trellis::simple_forward(), StochHMM::trellis::simple_nth_viterbi(), StochHMM::trellis::simple_posterior(), StochHMM::trellis::simple_simple_stochastic_viterbi(), StochHMM::trellis::simple_stochastic_forward(), StochHMM::trellis::simple_stochastic_viterbi(), StochHMM::trellis::simple_viterbi(), and StochHMM::trellis::sparse_complex_viterbi().
|
inline |
Assignment Operator.
Definition at line 107 of file sequences.cpp.
References external, length, num_of_sequences, related_sequences, same_length, and seq.
|
inline |
|
inline |
Is External definition defined.
Print the string representation of digitized sequencs to the stdout
Definition at line 160 of file sequences.h.
References stringify().
Referenced by main().
double StochHMM::sequences::realValue | ( | int | trck, |
size_t | position | ||
) |
Get the value from a real Number sequence for track trck at position
trck | Sequence track to use |
position | Position in sequence to get value from |
Definition at line 141 of file sequences.cpp.
References seq.
Referenced by StochHMM::emm::get_emission().
double StochHMM::sequences::realValue | ( | size_t | trck, |
size_t | position | ||
) |
Get the value from a real Number sequence for track trck at position
trck | Sequence track to use |
position | Position in sequence to get value from |
Definition at line 153 of file sequences.cpp.
References seq.
short StochHMM::sequences::seqValue | ( | int | trck, |
size_t | position | ||
) |
Get the digitized value from the sequence at trck at position
trck | Sequence track to use |
position | Position in sequence to get the value from |
Definition at line 166 of file sequences.cpp.
References seq.
|
inline |
Set external definition
ex | External definition to assign to the sequences |
Definition at line 183 of file sequences.h.
References external.
Referenced by StochHMM::seqTracks::getNext().
void StochHMM::sequences::setLength | ( | size_t | len | ) |
Set Length of sequences.
Set the length of the sequence(s) in sequence Because all the sequences should be the same size If there size differs when adding a sequence
sDifferentSizeSequences | thrown if the sizes differ |
Definition at line 329 of file sequences.cpp.
References length, StochHMM::max(), related_sequences, and same_length.
Referenced by addSeq(), and StochHMM::seqTracks::getNext().
|
inline |
Get the number of sequence type in sequences
Definition at line 130 of file sequences.h.
References num_of_sequences.
Referenced by StochHMM::PWM::scoreSimple(), StochHMM::PWM::scoreUndefSpacer(), StochHMM::PWM::scoreVariableSpacer(), stringify(), and undigitize().
std::string StochHMM::sequences::stringify | ( | ) |
Get std:string representation of all the digitized sequence(s) in sequences
Definition at line 184 of file sequences.cpp.
References StochHMM::track::getName(), StochHMM::int_to_string(), seq, and size().
Referenced by print().
std::string StochHMM::sequences::undigitize | ( | ) |
Get string of sequences.
Get std::string representation of all the undigitized sequence(s) in sequences
Definition at line 204 of file sequences.cpp.
References StochHMM::track::getName(), StochHMM::int_to_string(), seq, and size().
|
private |
Definition at line 195 of file sequences.h.
Referenced by exDefDefined(), getWeight(), operator=(), sequences(), setExDef(), and ~sequences().
|
private |
Definition at line 199 of file sequences.h.
Referenced by getLength(), operator=(), sequences(), and setLength().
|
private |
Definition at line 200 of file sequences.h.
Referenced by addSeq(), getAttrib(), getHeader(), getLength(), operator=(), sequences(), and size().
|
private |
Definition at line 202 of file sequences.h.
Referenced by addSeq(), operator=(), sequences(), and setLength().
|
private |
Definition at line 203 of file sequences.h.
Referenced by isSameSize(), operator=(), sequences(), and setLength().
|
private |
Definition at line 197 of file sequences.h.
Referenced by addSeq(), getAttrib(), getHeader(), getLength(), getSeq(), getUndigitized(), operator=(), operator[](), realValue(), sequences(), seqValue(), stringify(), undigitize(), and ~sequences().