本文整理汇总了C++中TopSegmentIteratorConstPtr::getMappedSegments方法的典型用法代码示例。如果您正苦于以下问题:C++ TopSegmentIteratorConstPtr::getMappedSegments方法的具体用法?C++ TopSegmentIteratorConstPtr::getMappedSegments怎么用?C++ TopSegmentIteratorConstPtr::getMappedSegments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TopSegmentIteratorConstPtr
的用法示例。
在下文中一共展示了TopSegmentIteratorConstPtr::getMappedSegments方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}
}