本文整理汇总了C++中Kmer::getLowerKey方法的典型用法代码示例。如果您正苦于以下问题:C++ Kmer::getLowerKey方法的具体用法?C++ Kmer::getLowerKey怎么用?C++ Kmer::getLowerKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kmer
的用法示例。
在下文中一共展示了Kmer::getLowerKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: storeData
void StoreKeeper::storeData(Vertex & vertex, int & sample) {
m_storeDataCalls++;
Kmer kmer = vertex.getKey();
Kmer lowerKey;
kmer.getLowerKey(&lowerKey, m_kmerLength, m_colorSpaceMode);
uint64_t before = m_hashTable.size();
ExperimentVertex * graphVertex = m_hashTable.insert(&lowerKey);
// * 2 because we store pairs
uint64_t size = m_hashTable.size();
// check if we inserted something.
// if it is the case, then assign the dummy color to it.
if(before < size) {
set<PhysicalKmerColor> emptySet;
VirtualKmerColorHandle noColor = m_colorSet.findVirtualColor(&emptySet);
m_colorSet.incrementReferences(noColor);
graphVertex->setVirtualColor(noColor);
#ifdef CONFIG_ASSERT
assert(noColor == NULL_VIRTUAL_COLOR);
#endif
}
int period = 1000000;
if(size % period == 0 && size != m_lastSize) {
printName();
cout << "has " << size << " Kmer objects in MyHashTable instance" << endl;
m_lastSize = size;
}
#if 0
cout << "DEBUG Growth -> " << before << " -> " << size << endl;
#endif
// add the PhysicalKmerColor to the node.
PhysicalKmerColor sampleColor = sample;
VirtualKmerColorHandle oldVirtualColor = graphVertex->getVirtualColor();
if(m_colorSet.virtualColorHasPhysicalColor(oldVirtualColor, sampleColor)) {
// Nothing to do, we already have this color
return;
}
#ifdef CONFIG_ASSERT
set<PhysicalKmerColor> * theOldSamples = m_colorSet.getPhysicalColors(oldVirtualColor);
set<PhysicalKmerColor> oldSamples = *theOldSamples;
assert(oldSamples.count(sampleColor) == 0);
#endif
VirtualKmerColorHandle newVirtualColor= m_colorSet.getVirtualColorFrom(oldVirtualColor, sampleColor);
#ifdef CONFIG_ASSERT
assert(m_colorSet.virtualColorHasPhysicalColor(newVirtualColor, sampleColor));
set<PhysicalKmerColor>* samples = m_colorSet.getPhysicalColors(newVirtualColor);
assert(samples->count(sampleColor) > 0);
#endif
#ifdef CONFIG_ASSERT2
if(oldVirtualColor == newVirtualColor) {
cout << "new sampleColor " << sampleColor << endl;
//cout << "References " << m_colorSet.getNumberOfReferences(newVirtualColor);
cout << endl;
cout << " >>> Old samples " << oldSamples.size () << endl;
for(set<PhysicalKmerColor>::iterator i = oldSamples.begin();
i != oldSamples.end() ; ++i) {
cout << " " << *i;
}
cout << endl;
cout << " old color " << oldVirtualColor;
cout << " refs " << m_colorSet.getNumberOfReferences(oldVirtualColor) << endl;
set<PhysicalKmerColor>* samples = m_colorSet.getPhysicalColors(newVirtualColor);
cout << " >>> new samples " << samples->size () << endl;
//.........这里部分代码省略.........