StochHMM
v0.34
Flexible Hidden Markov Model C++ Library and Application
|
#include <pwm.h>
Public Member Functions | |
PWM () | |
Constructor for PWM class. | |
void | import (std::string &file) |
void | import (const char *file) |
bool | parse (const std::string &matrix) |
void | score (sequences *seqs) |
void | scoreSimple (sequences *seqs) |
void | scoreUndefSpacer (sequences *seqs) |
void | scoreVariableSpacer (sequences *seqs) |
void | score (sequence *seq) |
void | scoreSimple (sequence *seq) |
void | scoreUndefSpacer (sequence *seq) |
void | scoreVariableSpacer (sequence *seq) |
void | setBackground (emm *bg) |
void | setTrack (track *tr) |
void | setSimpleThreshold (float thresh) |
void | setCurrentThreshold (float *thresh) |
track * | getTrack () |
std::string | stringify () |
void | print () |
Private Member Functions | |
bool | _parseTrack (std::string &txt) |
bool | _parseAmbiguous (std::string &txt) |
bool | _parsePositions (std::string &txt) |
bool | _parseThreshold (std::string &txt) |
bool | _parseBackground (std::string &txt) |
bool | _parseSpacer (std::string &txt) |
bool | _splitPositions (std::string &txt, stringList &sts) |
bool | _getOrderedPositionNames (stringList &states, stringList &names) |
void | _finalizeTransitions () |
float | calculateBack (sequences *seqs, size_t position, float sum) |
float | calculateBack (sequence *seq, size_t position, float sum) |
Private Attributes | |
track * | trk |
valueType | valType |
bool | simple |
bool | variableSpacer |
bool | undefinedSpacer |
float | simpleThreshold |
float * | currentThreshold |
std::vector< matrixPosition * > | weightMatrix |
std::map< std::string, size_t > | positionNames |
std::vector< matrixPosition * > | frontWeightMatrix |
std::vector< matrixPosition * > | backWeightMatrix |
std::list< float > * | backScores |
std::bitset< 1024 > * | backScored |
std::vector< size_t > | undefSpacerSizes |
std::vector< matrixPosition * > | variableSpacerMatrix |
std::bitset< 1024 > * | variableTransition |
std::string | frontWeightName |
std::string | backWeightName |
size_t | min_spacer |
size_t | max_spacer |
emm * | bgWeight |
StochHMM::PWM::PWM | ( | ) |
Constructor for PWM class.
Definition at line 32 of file pwm.cpp.
References bgWeight, currentThreshold, max_spacer, min_spacer, StochHMM::PROBABILITY, simple, simpleThreshold, SIZE_MAX, and valType.
|
private |
Definition at line 697 of file pwm.cpp.
References backWeightMatrix, frontWeightMatrix, positionNames, simple, SIZE_MAX, undefinedSpacer, variableSpacer, variableSpacerMatrix, variableTransition, and weightMatrix.
Referenced by parse().
|
private |
Definition at line 855 of file pwm.cpp.
References StochHMM::clear_whitespace(), StochHMM::stringList::contains(), StochHMM::stringList::push_back(), and StochHMM::stringList::size().
Referenced by _parsePositions().
|
private |
Definition at line 783 of file pwm.cpp.
References StochHMM::track::parseAmbiguous(), StochHMM::stringList::size(), StochHMM::stringList::splitString(), and trk.
Referenced by parse().
|
private |
|
private |
Definition at line 807 of file pwm.cpp.
References _getOrderedPositionNames(), _splitPositions(), StochHMM::matrixPosition::parse(), positionNames, StochHMM::stringList::size(), trk, and weightMatrix.
Referenced by parse().
|
private |
Definition at line 612 of file pwm.cpp.
References backWeightMatrix, backWeightName, StochHMM::clear_whitespace(), frontWeightMatrix, frontWeightName, max_spacer, min_spacer, positionNames, simple, StochHMM::stringList::size(), StochHMM::stringList::splitString(), undefinedSpacer, undefSpacerSizes, variableSpacer, and weightMatrix.
Referenced by parse().
|
private |
|
private |
Definition at line 760 of file pwm.cpp.
References StochHMM::track::parse(), StochHMM::track::setIndex(), StochHMM::stringList::splitString(), and trk.
Referenced by parse().
|
private |
Definition at line 833 of file pwm.cpp.
References StochHMM::clear_whitespace(), and StochHMM::stringList::push_back().
Referenced by _parsePositions().
|
private |
Definition at line 586 of file pwm.cpp.
References backWeightMatrix, currentThreshold, and score().
Referenced by scoreVariableSpacer().
|
private |
Definition at line 599 of file pwm.cpp.
References backWeightMatrix, currentThreshold, and score().
|
inline |
void StochHMM::PWM::import | ( | std::string & | file | ) |
Import a Position Weight Matrices file Imports file and parses the file position weight matrix file
[in] | std::string | file |
Definition at line 47 of file pwm.cpp.
References parse(), and StochHMM::slurpFile().
Referenced by main().
void StochHMM::PWM::import | ( | const char * | file | ) |
bool StochHMM::PWM::parse | ( | const std::string & | matrix | ) |
Parses a Position Weight Matrices string Parses string containing position weight matrix definitions
[in] | std::string | file |
Definition at line 65 of file pwm.cpp.
References _finalizeTransitions(), _parseAmbiguous(), _parseBackground(), _parsePositions(), _parseSpacer(), _parseThreshold(), and _parseTrack().
Referenced by import().
void StochHMM::PWM::print | ( | ) |
void StochHMM::PWM::score | ( | sequences * | seqs | ) |
Definition at line 370 of file pwm.cpp.
References scoreSimple(), scoreUndefSpacer(), scoreVariableSpacer(), simple, undefinedSpacer, and variableSpacer.
Referenced by calculateBack(), main(), scoreSimple(), and scoreVariableSpacer().
void StochHMM::PWM::score | ( | sequence * | seq | ) |
Definition at line 383 of file pwm.cpp.
References scoreSimple(), scoreUndefSpacer(), scoreVariableSpacer(), simple, undefinedSpacer, and variableSpacer.
void StochHMM::PWM::scoreSimple | ( | sequences * | seqs | ) |
Definition at line 407 of file pwm.cpp.
References StochHMM::sequence::getHeader(), StochHMM::sequences::getSeq(), and StochHMM::sequences::size().
Referenced by score().
void StochHMM::PWM::scoreSimple | ( | sequence * | seq | ) |
Definition at line 417 of file pwm.cpp.
References currentThreshold, StochHMM::sequence::getLength(), score(), simpleThreshold, and weightMatrix.
void StochHMM::PWM::scoreUndefSpacer | ( | sequences * | seqs | ) |
Definition at line 452 of file pwm.cpp.
References StochHMM::sequence::getHeader(), StochHMM::sequences::getSeq(), and StochHMM::sequences::size().
Referenced by score().
void StochHMM::PWM::scoreUndefSpacer | ( | sequence * | seq | ) |
Definition at line 463 of file pwm.cpp.
References backWeightMatrix, currentThreshold, frontWeightMatrix, StochHMM::sequence::getLength(), max_spacer, undefSpacerSizes, and weightMatrix.
void StochHMM::PWM::scoreVariableSpacer | ( | sequences * | seqs | ) |
Definition at line 525 of file pwm.cpp.
References StochHMM::sequence::getHeader(), StochHMM::sequences::getSeq(), and StochHMM::sequences::size().
Referenced by score().
void StochHMM::PWM::scoreVariableSpacer | ( | sequence * | seq | ) |
Definition at line 535 of file pwm.cpp.
References calculateBack(), currentThreshold, frontWeightMatrix, StochHMM::sequence::getLength(), max_spacer, score(), variableSpacerMatrix, variableTransition, and weightMatrix.
|
inline |
|
inline |
|
inline |
|
inline |
std::string StochHMM::PWM::stringify | ( | ) |
Definition at line 308 of file pwm.cpp.
References backWeightName, bgWeight, StochHMM::double_to_string(), frontWeightName, StochHMM::join(), simpleThreshold, StochHMM::emm::stringify(), StochHMM::track::stringify(), trk, undefinedSpacer, undefSpacerSizes, and weightMatrix.
|
private |
Definition at line 103 of file pwm.h.
Referenced by _finalizeTransitions(), _parseSpacer(), calculateBack(), and scoreUndefSpacer().
|
private |
Definition at line 111 of file pwm.h.
Referenced by _parseSpacer(), and stringify().
|
private |
Definition at line 115 of file pwm.h.
Referenced by _parseBackground(), PWM(), setBackground(), and stringify().
|
private |
Definition at line 97 of file pwm.h.
Referenced by calculateBack(), PWM(), scoreSimple(), scoreUndefSpacer(), scoreVariableSpacer(), and setCurrentThreshold().
|
private |
Definition at line 102 of file pwm.h.
Referenced by _finalizeTransitions(), _parseSpacer(), scoreUndefSpacer(), and scoreVariableSpacer().
|
private |
Definition at line 110 of file pwm.h.
Referenced by _parseSpacer(), and stringify().
|
private |
Definition at line 113 of file pwm.h.
Referenced by _parseSpacer(), PWM(), scoreUndefSpacer(), and scoreVariableSpacer().
|
private |
Definition at line 112 of file pwm.h.
Referenced by _parseSpacer(), and PWM().
|
private |
Definition at line 100 of file pwm.h.
Referenced by _finalizeTransitions(), _parsePositions(), and _parseSpacer().
|
private |
Definition at line 93 of file pwm.h.
Referenced by _finalizeTransitions(), _parseSpacer(), PWM(), and score().
|
private |
Definition at line 96 of file pwm.h.
Referenced by _parseThreshold(), PWM(), scoreSimple(), setSimpleThreshold(), and stringify().
|
private |
Definition at line 90 of file pwm.h.
Referenced by _parseAmbiguous(), _parseBackground(), _parsePositions(), _parseTrack(), getTrack(), setTrack(), and stringify().
|
private |
Definition at line 95 of file pwm.h.
Referenced by _finalizeTransitions(), _parseSpacer(), score(), and stringify().
|
private |
Definition at line 107 of file pwm.h.
Referenced by _parseSpacer(), scoreUndefSpacer(), and stringify().
|
private |
Definition at line 94 of file pwm.h.
Referenced by _finalizeTransitions(), _parseSpacer(), and score().
|
private |
Definition at line 108 of file pwm.h.
Referenced by _finalizeTransitions(), and scoreVariableSpacer().
|
private |
Definition at line 109 of file pwm.h.
Referenced by _finalizeTransitions(), and scoreVariableSpacer().
|
private |
Definition at line 99 of file pwm.h.
Referenced by _finalizeTransitions(), _parsePositions(), _parseSpacer(), scoreSimple(), scoreUndefSpacer(), scoreVariableSpacer(), and stringify().