本文整理汇总了C++中TopSegmentIteratorConstPtr::getReversed方法的典型用法代码示例。如果您正苦于以下问题:C++ TopSegmentIteratorConstPtr::getReversed方法的具体用法?C++ TopSegmentIteratorConstPtr::getReversed怎么用?C++ TopSegmentIteratorConstPtr::getReversed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TopSegmentIteratorConstPtr
的用法示例。
在下文中一共展示了TopSegmentIteratorConstPtr::getReversed方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testTopSegment
void MappedSegmentMapAcrossTest::testTopSegment(AlignmentConstPtr alignment,
TopSegmentIteratorConstPtr top)
{
const Genome* parent = top->getGenome()->getParent();
const Genome* other = top->getGenome()->getName() == "child1" ?
alignment->openGenome("child2") : alignment->openGenome("child1");
set<MappedSegmentConstPtr> results;
top->getMappedSegments(results, other, NULL, false);
CuAssertTrue(_testCase, results.size() == 1);
MappedSegmentConstPtr mseg = *results.begin();
CuAssertTrue(_testCase, mseg->getSource()->getGenome() == top->getGenome());
CuAssertTrue(_testCase, mseg->getSource()->getStartPosition() ==
top->getStartPosition());
CuAssertTrue(_testCase,
mseg->getSource()->getLength() == top->getLength());
CuAssertTrue(_testCase,
mseg->getSource()->getReversed() == top->getReversed());
BottomSegmentIteratorConstPtr bottom = parent->getBottomSegmentIterator();
bottom->toParent(top);
TopSegmentIteratorConstPtr sister = other->getTopSegmentIterator();
sister->toChildG(bottom, other);
CuAssertTrue(_testCase, mseg->getGenome() == sister->getGenome());
CuAssertTrue(_testCase,
mseg->getStartPosition() == sister->getStartPosition());
CuAssertTrue(_testCase,
mseg->getLength() == sister->getLength());
CuAssertTrue(_testCase,
mseg->getReversed() == sister->getReversed());
}
示例2: testBottomSegment
void MappedSegmentMapDownTest::testBottomSegment(
AlignmentConstPtr alignment,
BottomSegmentIteratorConstPtr bottom,
hal_size_t childIndex)
{
const Genome* child = bottom->getGenome()->getChild(childIndex);
set<MappedSegmentConstPtr> results;
bottom->getMappedSegments(results, child, NULL, false);
CuAssertTrue(_testCase, results.size() == 1);
MappedSegmentConstPtr mseg = *results.begin();
CuAssertTrue(_testCase, mseg->getSource()->getGenome() ==
bottom->getGenome());
CuAssertTrue(_testCase, mseg->getSource()->getStartPosition() ==
bottom->getStartPosition());
CuAssertTrue(_testCase,
mseg->getSource()->getLength() == bottom->getLength());
CuAssertTrue(_testCase,
mseg->getSource()->getReversed() == bottom->getReversed());
TopSegmentIteratorConstPtr top = child->getTopSegmentIterator();
top->toChild(bottom, childIndex);
CuAssertTrue(_testCase, mseg->getGenome() == top->getGenome());
CuAssertTrue(_testCase,
mseg->getStartPosition() == top->getStartPosition());
CuAssertTrue(_testCase,
mseg->getLength() == top->getLength());
CuAssertTrue(_testCase,
mseg->getReversed() == top->getReversed());
}
示例3: identifyInsertionFromLeftBreakpoint
bool DefaultRearrangement::identifyInsertionFromLeftBreakpoint(
TopSegmentIteratorConstPtr topSegment)
{
assert(topSegment->getReversed() == false);
if (scanInsertionCycle(topSegment) == true &&
_cur->hasParent() == false)
{
_id = Insertion;
return true;
}
_id = Invalid;
return false;
}
示例4: toRightNextUngapped
void DefaultGappedBottomSegmentIterator::toRightNextUngapped(
TopSegmentIteratorConstPtr ts) const
{
while (ts->hasParent() == false &&
ts->getLength() <= _gapThreshold)
{
if ((!ts->getReversed() && ts->getTopSegment()->isLast()) ||
(ts->getReversed() && ts->getTopSegment()->isFirst()))
{
break;
}
ts->toRight();
}
}
示例5: checkCallBack
void TopSegmentSimpleIteratorTest::checkCallBack(AlignmentConstPtr alignment)
{
const Genome* ancGenome = alignment->openGenome("Anc0");
CuAssertTrue(_testCase,
ancGenome->getNumTopSegments() == _topSegments.size());
TopSegmentIteratorConstPtr tsIt = ancGenome->getTopSegmentIterator(0);
for (size_t i = 0; i < ancGenome->getNumTopSegments(); ++i)
{
CuAssertTrue(_testCase,
(size_t)tsIt->getTopSegment()->getArrayIndex() == i);
_topSegments[i].compareTo(tsIt, _testCase);
tsIt->toRight();
}
tsIt = ancGenome->getTopSegmentIterator(
ancGenome->getNumTopSegments() - 1);
for (hal_index_t i = ancGenome->getNumTopSegments() - 1; i >= 0; --i)
{
CuAssertTrue(_testCase, tsIt->getTopSegment()->getArrayIndex() == i);
_topSegments[i].compareTo(tsIt, _testCase);
tsIt->toLeft();
}
tsIt = ancGenome->getTopSegmentIterator(0);
tsIt->slice(0, tsIt->getLength() - 1);
for (hal_index_t i = 0; i < (hal_index_t)ancGenome->getSequenceLength(); ++i)
{
CuAssertTrue(_testCase, tsIt->getLength() == 1);
CuAssertTrue(_testCase, tsIt->getStartPosition() == i);
tsIt->toRight(tsIt->getStartPosition() + 1);
}
tsIt = ancGenome->getTopSegmentIterator(
ancGenome->getNumTopSegments() - 1);
tsIt->slice(tsIt->getLength() - 1, 0);
for (hal_index_t i = ancGenome->getSequenceLength() - 1; i >= 0; --i)
{
CuAssertTrue(_testCase, tsIt->getLength() == 1);
CuAssertTrue(_testCase, tsIt->getStartPosition() == i);
tsIt->toLeft(tsIt->getStartPosition() - 1);
}
tsIt = ancGenome->getTopSegmentIterator(0);
tsIt->toReverse();
CuAssertTrue(_testCase, tsIt->getReversed() == true);
tsIt->slice(tsIt->getLength() - 1, 0);
for (hal_index_t i = 0; i < (hal_index_t)ancGenome->getSequenceLength(); ++i)
{
CuAssertTrue(_testCase, tsIt->getLength() == 1);
CuAssertTrue(_testCase, tsIt->getStartPosition() == i);
tsIt->toLeft(tsIt->getStartPosition() + 1);
}
tsIt = ancGenome->getTopSegmentIterator(
ancGenome->getNumTopSegments() - 1);
tsIt->toReverse();
tsIt->slice(0, tsIt->getLength() - 1);
for (hal_index_t i = ancGenome->getSequenceLength() - 1; i >= 0; --i)
{
CuAssertTrue(_testCase, tsIt->getLength() == 1);
CuAssertTrue(_testCase, tsIt->getStartPosition() == i);
tsIt->toRight(tsIt->getStartPosition() - 1);
}
}
示例6: checkCallBack
void MappedSegmentMapExtraParalogsTest::checkCallBack(AlignmentConstPtr alignment)
{
validateAlignment(alignment);
const Genome *grandChild1 = alignment->openGenome("grandChild1");
const Genome *grandChild2 = alignment->openGenome("grandChild2");
const Genome *root = alignment->openGenome("root");
TopSegmentIteratorConstPtr top = grandChild2->getTopSegmentIterator();
set<MappedSegmentConstPtr> results;
// First, check that by default we will only get the homologies in
// or before the MRCA. (in this case, just seg 0 of grandChild1).
top->getMappedSegments(results, grandChild1, NULL, true);
CuAssertTrue(_testCase, results.size() == 1);
MappedSegmentConstPtr mseg = *results.begin();
// Source information should be preserved
CuAssertTrue(_testCase, mseg->getSource()->getGenome() == top->getGenome());
CuAssertTrue(_testCase, mseg->getSource()->getStartPosition() ==
top->getStartPosition());
CuAssertTrue(_testCase,
mseg->getSource()->getLength() == top->getLength());
CuAssertTrue(_testCase,
mseg->getSource()->getReversed() == top->getReversed());
// Check target information is correct
CuAssertTrue(_testCase,
mseg->getGenome() == grandChild1);
CuAssertTrue(_testCase,
mseg->getStartPosition() == 2);
CuAssertTrue(_testCase,
mseg->getLength() == 3);
CuAssertTrue(_testCase,
mseg->getReversed() == true);
// Check that by using the grandparent as the coalescence limit we
// will get all the paralogs.
top->getMappedSegments(results, grandChild1, NULL, true, 0, root);
CuAssertTrue(_testCase, results.size() == 3);
set<MappedSegmentConstPtr>::iterator i = results.begin();
bool found[3] = {false, false, false};
for (; i != results.end(); ++i)
{
// Source information should be preserved
CuAssertTrue(_testCase, mseg->getSource()->getGenome() == top->getGenome());
CuAssertTrue(_testCase, mseg->getSource()->getStartPosition() ==
top->getStartPosition());
CuAssertTrue(_testCase,
mseg->getSource()->getLength() == top->getLength());
CuAssertTrue(_testCase,
mseg->getSource()->getReversed() == top->getReversed());
// Check target information is correct
CuAssertTrue(_testCase,
mseg->getGenome() == grandChild1);
CuAssertTrue(_testCase,
mseg->getStartPosition() == 2
|| mseg->getStartPosition() == 5
|| mseg->getStartPosition() == 8);
CuAssertTrue(_testCase,
mseg->getLength() == 3);
CuAssertTrue(_testCase,
mseg->getReversed() == true);
found[mseg->getArrayIndex()] = true;
}
}