本文整理汇总了C++中Kmer::loadFromTextRepresentation方法的典型用法代码示例。如果您正苦于以下问题:C++ Kmer::loadFromTextRepresentation方法的具体用法?C++ Kmer::loadFromTextRepresentation怎么用?C++ Kmer::loadFromTextRepresentation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kmer
的用法示例。
在下文中一共展示了Kmer::loadFromTextRepresentation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readLine
void GenomeGraphReader::readLine() {
char buffer[1024];
buffer[0] = '\0';
bool isCurrentlyAtTheGreatEndOfTime = m_reader.eof();
while(!m_bad && !m_reader.eof()) {
m_reader.getline(buffer, 1024);
// skip comment
if(strlen(buffer) > 0 && buffer[0] == '#')
continue;
break;
}
if(m_bad || (m_reader.eof() && isCurrentlyAtTheGreatEndOfTime)) {
m_reader.close();
printName();
if(m_bad) {
cout << " Error: file " << m_fileName << " does not exist";
cout << endl;
} else {
cout << " finished reading file " << m_fileName;
cout << " got " << m_loaded << " objects" << endl;
}
Message finishedMessage;
finishedMessage.setTag(DONE);
send(m_parent, finishedMessage);
die();
} else {
// AGCTGTGAAACTGGTGCAAGCTACCAGAATC;36;A;C
string sequence;
CoverageDepth coverage;
string parents;
string children;
for(int i = 0 ; i < (int) strlen(buffer) ; ++i) {
if(buffer[i] == ';')
buffer[i] = ' ';
}
istringstream stringBuffer(buffer);
stringBuffer >> sequence;
stringBuffer >> coverage;
stringBuffer >> parents;
stringBuffer >> children;
///////////////////////////////////////////////////////////////////////
// convert the sequence to upper case
map<char,char> translationTable;
translationTable['a'] = 'A';
translationTable['t'] = 'T';
translationTable['g'] = 'G';
translationTable['c'] = 'C';
for(int i = 0 ; i < (int) sequence.length() ; ++i) {
char symbol = sequence[i];
if(translationTable.count(symbol) > 0) {
char correct = translationTable[symbol];
sequence [i] = correct;
}
}
#if 0
cout << "DEBUG " << sequence << " with " << coverage << endl;
#endif
// if this is the first one, send the k-mer length too
if(m_loaded == 0) {
Message aMessage;
aMessage.setTag(CoalescenceManager::SET_KMER_LENGTH);
int length = sequence.length();
aMessage.setBuffer(&length);
aMessage.setNumberOfBytes(sizeof(length));
send(m_aggregator, aMessage);
}
Kmer kmer;
kmer.loadFromTextRepresentation(sequence.c_str());
Vertex vertex;
vertex.setKey(kmer);
vertex.setCoverageValue(coverage);
//.........这里部分代码省略.........