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 Attributes
trainingSeqs Class Reference

#include <trainingSeq.h>

List of all members.

Public Member Functions

int fileCount ()
bool eof (size_t iter)
bool good (size_t iter)
bool is_open (size_t iter)
int queueSize (size_t iter)
bool openFiles (std::string &)
bool openFiles (char **)
bool importMask (std::string &)
bool importMask (char **)
void determineAlphabet (size_t iter)
void setAlphabet (size_t, stringList &)

Private Attributes

vector< std::ifstream * > seqFiles
std::ifstream * maskFile
bool masked
queue< int > stateMask
std::vector< std::map
< std::string, int > > 
alphaIndex
std::vector< std::vector
< std::string > > 
indexAlpha
std::vector< stateInfostateEmm
std::map< int, map< int, int >
> transitions std::vector
< trainingSeq
seqs

Detailed Description

Definition at line 53 of file trainingSeq.h.


Member Function Documentation

void trainingSeqs::determineAlphabet ( size_t  iter)

Definition at line 184 of file trainingSeq.cpp.

References MAX_BUFFER.

{
const std::ifstream* file(seqFile[iter]);
//Import a buffer full of the sequence
std::string temp;
std::string undigitized;
while(getline(*file,temp,'\n')){
if (temp[0]== '>'){
continue;
}
else{
undigitized+=temp;
}
if (undigitized.size() >= MAX_BUFFER){
break;
}
}
std::set<std::string> alphabet;
pair<std::set<int>::iterator,bool> ret;
for(size_t i=0;i<undigitized.size();i++){
ret = alphabet.insert(undigitized[i]);
if (ret.second()){
indexAlpha[iter].push_back(undigitized[i]);
}
}
for(size_t i=0;i<indexAlpha[iter].size();i++){
string &temp= indexAlpha[iter][i];
alphaIndex[iter][temp]=i;
}
file.seekg(0,std::ios::beg);
file.clear();
return;
}
bool trainingSeqs::eof ( size_t  iter)
inline

Definition at line 56 of file trainingSeq.h.

{return seqFiles[iter]->eof();}
int trainingSeqs::fileCount ( )
inline

Definition at line 55 of file trainingSeq.h.

{return seqFiles.size();};
bool trainingSeqs::good ( size_t  iter)
inline

Definition at line 57 of file trainingSeq.h.

{return seqFiles[iter]->good();}
bool trainingSeqs::importMask ( std::string &  )
bool trainingSeqs::importMask ( char **  )
bool trainingSeqs::is_open ( size_t  iter)
inline

Definition at line 58 of file trainingSeq.h.

{return seqFiles[iter]->is_open();}
bool trainingSeqs::openFiles ( std::string &  filename)

Definition at line 172 of file trainingSeq.cpp.

{
}
bool trainingSeqs::openFiles ( char **  )
int trainingSeqs::queueSize ( size_t  iter)
inline

Definition at line 61 of file trainingSeq.h.

{return seqs.size();}
void trainingSeqs::setAlphabet ( size_t  iter,
stringList lst 
)

Definition at line 225 of file trainingSeq.cpp.

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

{
for(size_t i=0;i<lst.size();i++){
string& temp = lst[i];
indexAlpha[iter].push_back(temp);
alphaIndex[iter][temp]=i;
}
return;
}

Member Data Documentation

std::vector<std::map<std::string, int> > trainingSeqs::alphaIndex
private

Definition at line 78 of file trainingSeq.h.

std::vector<std::vector<std::string> > trainingSeqs::indexAlpha
private

Definition at line 79 of file trainingSeq.h.

bool trainingSeqs::masked
private

Definition at line 75 of file trainingSeq.h.

std::ifstream* trainingSeqs::maskFile
private

Definition at line 73 of file trainingSeq.h.

vector<std::ifstream*> trainingSeqs::seqFiles
private

Definition at line 72 of file trainingSeq.h.

std::map<int,map<int,int> > transitions std::vector<trainingSeq> trainingSeqs::seqs
private

Definition at line 86 of file trainingSeq.h.

std::vector<stateInfo> trainingSeqs::stateEmm
private

Definition at line 81 of file trainingSeq.h.

queue<int> trainingSeqs::stateMask
private

Definition at line 76 of file trainingSeq.h.


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