StochHMM  v0.34
Flexible Hidden Markov Model C++ Library and Application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes
StochHMM::PWM Class Reference

#include <pwm.h>

List of all members.

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)
trackgetTrack ()
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

tracktrk
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
emmbgWeight

Detailed Description

Definition at line 50 of file pwm.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

void StochHMM::PWM::_finalizeTransitions ( )
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().

{
//Assign emission transitions
for(size_t i=0; i < weightMatrix.size(); i++){
std::vector<std::string>& tmp= weightMatrix[i]->getTransitionNames();
for (size_t j = 0; j < tmp.size(); j++) {
size_t itera = positionNames[tmp[j]];
weightMatrix[i]->addTransition(weightMatrix[itera]->getEmission());
}
if (tmp.size() > 1){
simple = false;
undefinedSpacer = false;
}
}
//TODO: DETERMINE CORE REGIONS AND THEN ADAPT SCORING TO THOSE
//Determine Front Core
//Check the Transitions and determine core regions
size_t firstMultiTrans(SIZE_MAX);
size_t backWeightStart(SIZE_MAX);
for(size_t i=0 ; i < weightMatrix.size(); i++){
if (weightMatrix[i]->transitionsSize() > 1){
firstMultiTrans = i;
std::vector<std::string>& tmp = weightMatrix[i]->getTransitionNames();
for( size_t j = 0; j < tmp.size(); j++){
size_t indx = positionNames[tmp[j]];
if (indx > i+1){
backWeightStart = indx;
break;
}
}
break;
}
else{
}
}
//Determine Spacer and transitions
variableTransition = new (std::nothrow) std::bitset<1024>;
for(size_t i=firstMultiTrans; i< backWeightStart; i++){
if (weightMatrix[i]->transitionsSize() > 1){
(*variableTransition)[i]=1;
}
}
//Determine Back Core
for(size_t i = backWeightStart; i < weightMatrix.size() ; i++){
}
}
return;
}
bool StochHMM::PWM::_getOrderedPositionNames ( stringList states,
stringList names 
)
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().

{
for(size_t i=0;i<pos.size();i++){
size_t nameHeader=pos[i].find("NAME:");
if (nameHeader == std::string::npos){
continue;
}
size_t nameLineEnding=pos[i].find_first_of("\n",nameHeader);
std::string name = pos[i].substr(nameHeader+5,nameLineEnding-(nameHeader+5));
clear_whitespace(name, " \t\n");
if (names.contains(name)){
std::cerr << "Position with name of: " << name << " is defined twice in the model\n";
return false;
}
else{
names.push_back(name);
}
}
return true;
}
bool StochHMM::PWM::_parseAmbiguous ( std::string &  txt)
private

Definition at line 783 of file pwm.cpp.

References StochHMM::track::parseAmbiguous(), StochHMM::stringList::size(), StochHMM::stringList::splitString(), and trk.

Referenced by parse().

{
stringList lst;
lst.splitString(txt, "\n");
for(size_t i=0;i<lst.size();i++){
stringList ln;
ln.splitString(lst[i],":\t ");
if (trk!=NULL){
if (!trk->parseAmbiguous(ln[1])){
std::cerr << "Couldn't parse the Ambiguous section for " << ln[0] << std::endl;
return false;
}
}
else{
std::string info = "Ambiguous Characters Section\nSupplied track name doesn't correspond to any previously parsed tracks.\nPlease check the formatting and names.\n Unfound Name: " + ln[0];
std::cerr << info << std::endl;
return false;
}
}
return true;
}
bool StochHMM::PWM::_parseBackground ( std::string &  txt)
private

Definition at line 678 of file pwm.cpp.

References bgWeight, StochHMM::emm::parse(), and trk.

Referenced by parse().

{
emm* temp_emm = new(std::nothrow) emm;
if (temp_emm==NULL){
std::cerr << "OUT OF MEMORY\nFile" << __FILE__ << "Line:\t"<< __LINE__ << std::endl;
exit(1);
}
if (!temp_emm->parse(txt,trk)){
return false;
}
bgWeight = temp_emm;
return true;
}
bool StochHMM::PWM::_parsePositions ( std::string &  txt)
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().

{
//3. create and parse states
stringList positions;
_splitPositions(txt,positions);
stringList names;
_getOrderedPositionNames(positions, names);
for(size_t i=0;i<names.size();i++){
positionNames[names[i]] = i ;
}
for(size_t iter=1;iter<positions.size();iter++){
matrixPosition* temp = new (std::nothrow) matrixPosition;
temp->parse(positions[iter], trk, names);
weightMatrix.push_back(temp);
//std::cout << positions[iter] << std::endl;
}
return true;
}
bool StochHMM::PWM::_parseSpacer ( std::string &  txt)
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().

{
simple = false;
variableSpacer = false;
stringList lst;
lst.splitString(txt,":");
//Split header to see where to insert spacer
stringList order;
order.splitString(lst[0],"-");
frontWeightName = order[0];
backWeightName = order[2];
//Push Frontside Weights into Matrix
if (positionNames.count(frontWeightName) == 1){
size_t frontIndex = positionNames[frontWeightName];
for(size_t i=0;i <= frontIndex; i++){
}
}
else{
std::cerr << "Couldn't find " << frontWeightName << " in the POSITION WEIGHT DEFINITIONS" << std::endl;
exit(2);
}
//Push backside weights into Matrix
if (positionNames.count(backWeightName) == 1){
size_t backIndex = positionNames[backWeightName];
for(size_t i=backIndex;i < weightMatrix.size() ; i++){
}
}
else{
std::cerr << "Couldn't find " << backWeightName << " in the POSITION WEIGHT DEFINITIONS" << std::endl;
exit(2);
}
//Parse Spacer Sizes
stringList spc;
spc.splitString(lst[1],",");
for(size_t i=0;i<spc.size();i++){
clear_whitespace(spc[i], " \t\n");
size_t val = atoi(spc[i].c_str());
if (val > max_spacer){
max_spacer = val;
}
if (val < min_spacer){
min_spacer = val;
}
undefSpacerSizes.push_back(val);
}
return true;
}
bool StochHMM::PWM::_parseThreshold ( std::string &  txt)
private

Definition at line 673 of file pwm.cpp.

References simpleThreshold.

Referenced by parse().

{
simpleThreshold = atof(txt.c_str());
return true;
}
bool StochHMM::PWM::_parseTrack ( std::string &  txt)
private

Definition at line 760 of file pwm.cpp.

References StochHMM::track::parse(), StochHMM::track::setIndex(), StochHMM::stringList::splitString(), and trk.

Referenced by parse().

{
stringList lst;
lst.splitString(txt, "\n");
trk=new(std::nothrow) track();
if (trk==NULL){
std::cerr << "OUT OF MEMORY\nFile" << __FILE__ << "Line:\t"<< __LINE__ << std::endl;
exit(1);
}
if (trk->parse(lst[0])){
}
else {
std::string info = "Couldn't parse new track line. Please check formatting of : " + lst[0];
std::cerr << info << std::endl;
exit(1);
}
return true;
}
bool StochHMM::PWM::_splitPositions ( std::string &  txt,
stringList sts 
)
private

Definition at line 833 of file pwm.cpp.

References StochHMM::clear_whitespace(), and StochHMM::stringList::push_back().

Referenced by _parsePositions().

{
size_t start=0;
size_t end=0;
while(start!=std::string::npos){
end=txt.find("NAME:",start+1);
std::string st = txt.substr(start,end-start);
clear_whitespace(st, "#><");
sts.push_back(st);
start=txt.find("NAME:",end);
}
return true;
}
float StochHMM::PWM::calculateBack ( sequences seqs,
size_t  position,
float  sum 
)
private

Definition at line 586 of file pwm.cpp.

References backWeightMatrix, currentThreshold, and score().

Referenced by scoreVariableSpacer().

{
float score = sum;
for (size_t pos = 0; pos < backWeightMatrix.size(); pos++){
sum += backWeightMatrix[pos]->getEmissionValue(seqs, position+pos);
if (sum < *currentThreshold){
return -INFINITY;
}
}
return score;
}
float StochHMM::PWM::calculateBack ( sequence seq,
size_t  position,
float  sum 
)
private

Definition at line 599 of file pwm.cpp.

References backWeightMatrix, currentThreshold, and score().

{
float score = sum;
for (size_t pos = 0; pos < backWeightMatrix.size(); pos++){
sum += backWeightMatrix[pos]->getEmissionValue(seq, position+pos);
if (sum < *currentThreshold){
return -INFINITY;
}
}
return score;
}
track* StochHMM::PWM::getTrack ( )
inline

Definition at line 72 of file pwm.h.

References trk.

Referenced by main().

{return trk;}
void StochHMM::PWM::import ( std::string &  file)

Import a Position Weight Matrices file Imports file and parses the file position weight matrix file

Parameters:
[in]std::stringfile

Definition at line 47 of file pwm.cpp.

References parse(), and StochHMM::slurpFile().

Referenced by main().

{
std::string modelString=slurpFile(file);
parse(modelString);
}
void StochHMM::PWM::import ( const char *  file)

Import a Position Weight Matrices file Imports file and parses the file position weight matrix file

Parameters:
[in]constchar* file

Definition at line 56 of file pwm.cpp.

{
std::string fl(file);
import(fl);
}
bool StochHMM::PWM::parse ( const std::string &  matrix)

Parses a Position Weight Matrices string Parses string containing position weight matrix definitions

Parameters:
[in]std::stringfile

Definition at line 65 of file pwm.cpp.

References _finalizeTransitions(), _parseAmbiguous(), _parseBackground(), _parsePositions(), _parseSpacer(), _parseThreshold(), and _parseTrack().

Referenced by import().

{
size_t thresh = matrix.find("THRESHOLD DEFINITION");
size_t track = matrix.find("TRACK SYMBOL DEFINITIONS");
size_t ambig = matrix.find("AMBIGUOUS SYMBOL DEFINITIONS");
size_t pwm = matrix.find("POSITION WEIGHT DEFINITIONS");
size_t back = matrix.find("BACKGROUND DEFINITION");
size_t space = matrix.find("SPACER DEFINITIONS");
size_t blank;
size_t nlChar;
if (thresh != std::string::npos){
blank=matrix.find("\n\n",thresh);
size_t nlCharEq = matrix.rfind("####\n",blank);
size_t nlCharNum= matrix.rfind("====\n",blank);
//Check for optional dividing line
if (nlCharEq!=std::string::npos){
nlChar=nlCharEq+5;
}
else if (nlCharNum!=std::string::npos){
nlChar=nlCharNum+5;
}
else{ //No divider line
nlChar=matrix.find("\n",thresh);
nlChar++;
}
std::string thr (matrix.substr(nlChar,blank-nlChar));
if (!_parseThreshold(thr)){
return false;
}
}
if (track != std::string::npos){
blank=matrix.find("\n\n",track);
size_t nlCharEq = matrix.rfind("####\n",blank);
size_t nlCharNum= matrix.rfind("====\n",blank);
//Check for optional dividing line
if (nlCharEq!=std::string::npos){
nlChar=nlCharEq+5;
}
else if (nlCharNum!=std::string::npos){
nlChar=nlCharNum+5;
}
else{ //No divider line
nlChar=matrix.find("\n",track);
nlChar++;
}
std::string trck (matrix.substr(nlChar,blank-nlChar));
if (!_parseTrack(trck)){
return false;
}
}
else{
std::cerr << "Required section: TRACK SYMBOL DEFINITIONS missing from the model" << std::endl;
return false;
}
if (ambig != std::string::npos){
blank=matrix.find("\n\n",ambig);
size_t nlCharEq = matrix.rfind("####\n",blank);
size_t nlCharNum= matrix.rfind("====\n",blank);
//Check for optional dividing line
if (nlCharEq!=std::string::npos){
nlChar=nlCharEq+5;
}
else if (nlCharNum!=std::string::npos){
nlChar=nlCharNum+5;
}
else{ //No divider line
nlChar=matrix.find("\n",ambig);
nlChar++;
}
std::string amb(matrix.substr(nlChar,blank-nlChar));
if (!_parseAmbiguous(amb)){
return false;
}
}
if (back!= std::string::npos){
blank=matrix.find("\n\n",back);
size_t nlCharEq = matrix.rfind("####\n",blank);
size_t nlCharNum= matrix.rfind("====\n",blank);
//Check for optional dividing line
if (nlCharEq!=std::string::npos){
nlChar=nlCharEq+5;
}
else if (nlCharNum!=std::string::npos){
nlChar=nlCharNum+5;
}
else{ //No divider line
nlChar=matrix.find("\n",back);
nlChar++;
}
std::string background(matrix.substr(nlChar,blank-nlChar));
if (!_parseBackground(background)){
return false;
}
}
//Parse the positions
if (pwm != std::string::npos){
std::string positions = matrix.substr(pwm);
_parsePositions(positions);
}
//Parse the Spacer Information
if (space != std::string::npos){
blank=matrix.find("\n\n",space);
size_t nlCharEq = matrix.rfind("####\n",blank);
size_t nlCharNum= matrix.rfind("====\n",blank);
//Check for optional dividing line
if (nlCharEq!=std::string::npos){
nlChar=nlCharEq+5;
}
else if (nlCharNum!=std::string::npos){
nlChar=nlCharNum+5;
}
else{ //No divider line
nlChar=matrix.find("\n",space);
nlChar++;
}
std::string spacer(matrix.substr(nlChar,blank-nlChar));
if (!_parseSpacer(spacer)){
return false;
}
}
return true;
}
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().

{
if (simple){
scoreSimple(seqs);
}
else if (undefinedSpacer){
}
else if (variableSpacer){
}
return;
}
void StochHMM::PWM::score ( sequence seq)

Definition at line 383 of file pwm.cpp.

References scoreSimple(), scoreUndefSpacer(), scoreVariableSpacer(), simple, undefinedSpacer, and variableSpacer.

{
if (simple){
}
else if (undefinedSpacer){
}
else if (variableSpacer){
}
return;
}
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().

{
size_t numberSeqs = seqs->size();
for (size_t i=0;i < numberSeqs ;i++){
sequence* sq = seqs->getSeq(i);
std::cout << sq->getHeader() << std::endl;
}
return;
}
void StochHMM::PWM::scoreSimple ( sequence seq)

Definition at line 417 of file pwm.cpp.

References currentThreshold, StochHMM::sequence::getLength(), score(), simpleThreshold, and weightMatrix.

{
size_t seq_size = seq->getLength();
size_t motif_size = weightMatrix.size();
if (seq_size < motif_size){
return;
}
float score(0);
for(size_t position = 0; position <= seq_size - motif_size; position++){
score = 0;
for (size_t motif_pos = 0; motif_pos < motif_size; motif_pos ++){
score += weightMatrix[motif_pos]->getEmissionValue(seq,position+motif_pos);
if (weightMatrix[motif_pos]->isThresholdSet()){
currentThreshold = weightMatrix[motif_pos]->getThresholdPtr();
}
break;
}
}
continue;
}
std::cout << position << "\t" << score << "\n";
}
}
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().

{
size_t numberSeqs = seqs->size();
for (size_t i=0;i < numberSeqs ;i++){
sequence* sq = seqs->getSeq(i);
std::cout << sq->getHeader() << std::endl;
}
return;
}
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.

{
size_t seq_size = seq->getLength();
size_t motif_size = weightMatrix.size();
size_t front_size = frontWeightMatrix.size();
size_t back_size = backWeightMatrix.size();
if (seq_size < motif_size + max_spacer){
return;
}
float front_score(0);
float back_score(0);
float sumScore(0);
size_t spacerSize(0);
for(size_t position = 0; position < seq_size - (motif_size + max_spacer); position++){
front_score = 0;
back_score = 0;
sumScore = 0;
//Calculate the Front motif score
for (size_t front_pos = 0; front_pos < front_size; front_pos++){
front_score += frontWeightMatrix[front_pos]->getEmissionValue(seq,position+front_pos);
if (front_score <= *currentThreshold){
break;
}
}
if (front_score <= *currentThreshold){
continue;
}
//Calculate the back scores
for(size_t sp = 0; sp < undefSpacerSizes.size(); sp++){
spacerSize = undefSpacerSizes[sp];
//Check to see if back_motif was previously calculated.
//If it was then get score and assign score.
//If not then calculate
size_t back_pos(0);
for(; back_pos < back_size; back_pos++){
back_score += backWeightMatrix[back_pos]->getEmissionValue(seq, position+front_size+spacerSize+back_pos);
sumScore = front_score+back_score;
if (front_score+back_score <= *currentThreshold){
break;
}
}
//TODO: Assign score to list
//Assign score of backward
if (back_pos == back_size){
//std::cout << "We've made it through" << std::endl;
}
if (sumScore >= *currentThreshold){
std::cout << position << "\t" <<spacerSize << "\t" << sumScore << "\n";
}
}
}
return;
}
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().

{
size_t numberSeqs = seqs->size();
for (size_t i=0;i < numberSeqs ;i++){
sequence* sq = seqs->getSeq(i);
std::cout << sq->getHeader() << std::endl;
}
return;
}
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.

{
size_t seq_size = seq->getLength();
size_t motif_size = weightMatrix.size();
size_t front_size = frontWeightMatrix.size();
//size_t back_size = backWeightMatrix.size();
if (seq_size < motif_size + max_spacer){
return;
}
float score(0);
float sumScore(0);
for(size_t position = 0; position < seq_size - (motif_size + max_spacer); position++){
score = 0;
sumScore = 0;
//Calculate the Front motif score
for (size_t front_pos = 0; front_pos < front_size; front_pos++){
score += frontWeightMatrix[front_pos]->getEmissionValue(seq,position+front_pos);
break;
}
}
continue;
}
//Calculate the back scores
for(size_t sp = 0; sp < variableSpacerMatrix.size(); sp++){
//Check to see if back_motif was previously calculated.
//If it was then get score and assign score.
//If not then calculate
score+=variableSpacerMatrix[sp]->getEmissionValue(seq, position+front_size+sp);
if ((*variableTransition)[sp]){
sumScore = calculateBack(seq, position+front_size+sp+1, score);
if (sumScore >= *currentThreshold){
std::cout << position << "\t" << (sp+1) << "\t" << sumScore << "\n";
}
}
}
}
return;
}
void StochHMM::PWM::setBackground ( emm bg)
inline

Definition at line 67 of file pwm.h.

References bgWeight.

{bgWeight = bg;}
void StochHMM::PWM::setCurrentThreshold ( float *  thresh)
inline

Definition at line 71 of file pwm.h.

References currentThreshold.

{currentThreshold = thresh;}
void StochHMM::PWM::setSimpleThreshold ( float  thresh)
inline

Definition at line 69 of file pwm.h.

References simpleThreshold.

{simpleThreshold = thresh;};
void StochHMM::PWM::setTrack ( track tr)
inline

Definition at line 68 of file pwm.h.

References trk.

{trk = tr;}
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.

{
std::string pwm;
std::string split("#################################\n");
pwm += "#POSITION WEIGHT MATRIX\n\n";
if ( simpleThreshold!= -INFINITY){
pwm +="<THRESHOLD DEFINITION>\n";
pwm += split;
pwm += "\n\n";
}
pwm +="<TRACK SYMBOL DEFINITIONS>\n";
pwm += split;
pwm += trk->stringify();
pwm += "\n";
if (bgWeight != NULL){
pwm += "<BACKGROUND DEFINITION>\n";
pwm += split;
pwm += bgWeight->stringify();
}
pwm += "<SPACER DEFINITIONS>\n";
pwm += split;
pwm += frontWeightName + "-SPACER-" + backWeightName + ":";
pwm += join(undefSpacerSizes, ',');
pwm += "\n\n";
}
pwm +="<POSITION WEIGHT DEFINITIONS>\n";
pwm += split;
for(size_t i=0; i< weightMatrix.size(); i++){
pwm += weightMatrix[i]->stringify();
pwm += split;
}
pwm += "//END";
return pwm;
}

Member Data Documentation

std::bitset<1024>* StochHMM::PWM::backScored
private

Definition at line 105 of file pwm.h.

std::list<float>* StochHMM::PWM::backScores
private

Definition at line 104 of file pwm.h.

std::vector<matrixPosition*> StochHMM::PWM::backWeightMatrix
private

Definition at line 103 of file pwm.h.

Referenced by _finalizeTransitions(), _parseSpacer(), calculateBack(), and scoreUndefSpacer().

std::string StochHMM::PWM::backWeightName
private

Definition at line 111 of file pwm.h.

Referenced by _parseSpacer(), and stringify().

emm* StochHMM::PWM::bgWeight
private

Definition at line 115 of file pwm.h.

Referenced by _parseBackground(), PWM(), setBackground(), and stringify().

float* StochHMM::PWM::currentThreshold
private
std::vector<matrixPosition*> StochHMM::PWM::frontWeightMatrix
private

Definition at line 102 of file pwm.h.

Referenced by _finalizeTransitions(), _parseSpacer(), scoreUndefSpacer(), and scoreVariableSpacer().

std::string StochHMM::PWM::frontWeightName
private

Definition at line 110 of file pwm.h.

Referenced by _parseSpacer(), and stringify().

size_t StochHMM::PWM::max_spacer
private

Definition at line 113 of file pwm.h.

Referenced by _parseSpacer(), PWM(), scoreUndefSpacer(), and scoreVariableSpacer().

size_t StochHMM::PWM::min_spacer
private

Definition at line 112 of file pwm.h.

Referenced by _parseSpacer(), and PWM().

std::map<std::string,size_t> StochHMM::PWM::positionNames
private

Definition at line 100 of file pwm.h.

Referenced by _finalizeTransitions(), _parsePositions(), and _parseSpacer().

bool StochHMM::PWM::simple
private

Definition at line 93 of file pwm.h.

Referenced by _finalizeTransitions(), _parseSpacer(), PWM(), and score().

float StochHMM::PWM::simpleThreshold
private

Definition at line 96 of file pwm.h.

Referenced by _parseThreshold(), PWM(), scoreSimple(), setSimpleThreshold(), and stringify().

track* StochHMM::PWM::trk
private
bool StochHMM::PWM::undefinedSpacer
private

Definition at line 95 of file pwm.h.

Referenced by _finalizeTransitions(), _parseSpacer(), score(), and stringify().

std::vector<size_t> StochHMM::PWM::undefSpacerSizes
private

Definition at line 107 of file pwm.h.

Referenced by _parseSpacer(), scoreUndefSpacer(), and stringify().

valueType StochHMM::PWM::valType
private

Definition at line 91 of file pwm.h.

Referenced by PWM().

bool StochHMM::PWM::variableSpacer
private

Definition at line 94 of file pwm.h.

Referenced by _finalizeTransitions(), _parseSpacer(), and score().

std::vector<matrixPosition*> StochHMM::PWM::variableSpacerMatrix
private

Definition at line 108 of file pwm.h.

Referenced by _finalizeTransitions(), and scoreVariableSpacer().

std::bitset<1024>* StochHMM::PWM::variableTransition
private

Definition at line 109 of file pwm.h.

Referenced by _finalizeTransitions(), and scoreVariableSpacer().

std::vector<matrixPosition*> StochHMM::PWM::weightMatrix
private

The documentation for this class was generated from the following files: