本文整理汇总了C++中Genome::getTopSegmentEndIterator方法的典型用法代码示例。如果您正苦于以下问题:C++ Genome::getTopSegmentEndIterator方法的具体用法?C++ Genome::getTopSegmentEndIterator怎么用?C++ Genome::getTopSegmentEndIterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Genome
的用法示例。
在下文中一共展示了Genome::getTopSegmentEndIterator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addIdenticalParentChild
void GappedSegmentSimpleIteratorTest2::createCallBack(AlignmentPtr alignment)
{
addIdenticalParentChild(alignment, 2, 100, 5);
Genome* parent = alignment->openGenome(alignment->getRootName());
Genome* child = parent->getChild(0);
TopSegmentIteratorPtr ti = child->getTopSegmentIterator();
BottomSegmentIteratorPtr bi = parent->getBottomSegmentIterator();
hal_index_t i = 0;
bool reversed = true;
while (ti != child->getTopSegmentEndIterator())
{
if (i % 5 == 0)
{
reversed = !reversed;
if (reversed && i < (hal_index_t)(parent->getNumBottomSegments() - 1))
{
makeInversion(ti, 5);
}
}
ti->toRight();
bi->toRight();
++i;
}
}
示例2: createCallBack
void GappedSegmentSimpleIteratorTest::createCallBack(AlignmentPtr alignment)
{
addIdenticalParentChild(alignment, 2, 100, 5);
Genome* parent = alignment->openGenome(alignment->getRootName());
Genome* child = parent->getChild(0);
TopSegmentIteratorPtr ti = child->getTopSegmentIterator();
BottomSegmentIteratorPtr bi = parent->getBottomSegmentIterator();
int i = 0;
while (ti != child->getTopSegmentEndIterator())
{
if (i++ % 2)
{
ti->getTopSegment()->setParentReversed(true);
bi->getBottomSegment()->setChildReversed(0, true);
}
ti->toRight();
bi->toRight();
}
}
示例3: createCallBack
void TopSegmentSimpleIteratorTest::createCallBack(AlignmentPtr alignment)
{
Genome* ancGenome = alignment->addRootGenome("Anc0", 0);
size_t numChildren = 9;
for (size_t i = 0; i < numChildren; ++i)
{
std::stringstream ss;
ss << i;
alignment->addLeafGenome(string("Leaf") + ss.str(), "Anc0", 0.1);
}
vector<Sequence::Info> seqVec(1);
seqVec[0] = Sequence::Info("Sequence", 1000000, 5000, 10000);
ancGenome->setDimensions(seqVec);
CuAssertTrue(_testCase, ancGenome->getNumChildren() == numChildren);
_topSegments.clear();
for (size_t i = 0; i < ancGenome->getNumTopSegments(); ++i)
{
TopSegmentStruct topSeg;
topSeg.setRandom();
topSeg._length =
ancGenome->getSequenceLength() / ancGenome->getNumTopSegments();
topSeg._startPosition = i * topSeg._length;
_topSegments.push_back(topSeg);
}
TopSegmentIteratorPtr tsIt = ancGenome->getTopSegmentIterator(0);
TopSegmentIteratorConstPtr tsEnd =
ancGenome->getTopSegmentEndIterator();
for (size_t i = 0; tsIt != tsEnd; tsIt->toRight(), ++i)
{
CuAssertTrue(_testCase,
(size_t)tsIt->getTopSegment()->getArrayIndex() == i);
_topSegments[i].applyTo(tsIt);
}
}