当前位置: 首页>>代码示例>>C++>>正文


C++ BottomSegmentIteratorPtr::getReversed方法代码示例

本文整理汇总了C++中BottomSegmentIteratorPtr::getReversed方法的典型用法代码示例。如果您正苦于以下问题:C++ BottomSegmentIteratorPtr::getReversed方法的具体用法?C++ BottomSegmentIteratorPtr::getReversed怎么用?C++ BottomSegmentIteratorPtr::getReversed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BottomSegmentIteratorPtr的用法示例。


在下文中一共展示了BottomSegmentIteratorPtr::getReversed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: checkCallBack

void TopSegmentIteratorReverseTest::checkCallBack(const Alignment *alignment) {
    BottomSegmentIteratorPtr bi;
    TopSegmentIteratorPtr ti, ti2;

    const Genome *parent1 = alignment->openGenome("parent1");
    const Genome *child1 = alignment->openGenome("child1");

    ti = child1->getTopSegmentIterator();
    bi = parent1->getBottomSegmentIterator();

    ti2 = child1->getTopSegmentIterator();
    ti2->toChild(bi, 0);

    CuAssertTrue(_testCase, ti->getStartPosition() == 0);
    CuAssertTrue(_testCase, ti->getLength() == 10);
    CuAssertTrue(_testCase, ti->getReversed() == false);

    CuAssertTrue(_testCase, ti2->getStartPosition() == 9);
    CuAssertTrue(_testCase, ti2->getLength() == 10);
    CuAssertTrue(_testCase, ti2->getReversed() == true);

    bi->slice(1, 3);
    ti2->toChild(bi, 0);

    CuAssertTrue(_testCase, bi->getStartPosition() == 1);
    CuAssertTrue(_testCase, bi->getLength() == 6);
    CuAssertTrue(_testCase, ti2->getStartPosition() == 8);
    CuAssertTrue(_testCase, ti2->getLength() == 6);

    string buffer;
    bi->getString(buffer);
    CuAssertTrue(_testCase, buffer == "CCTACG");
    ti2->getString(buffer);
    CuAssertTrue(_testCase, buffer == "CACGTA");

    bi = child1->getBottomSegmentIterator();
    CuAssertTrue(_testCase, bi->getReversed() == false);

    ti->toParseUp(bi);
    CuAssertTrue(_testCase, ti->getStartPosition() == 0);
    CuAssertTrue(_testCase, ti->getLength() == 5);

    bi->toReverse();
    ti->toParseUp(bi);
    CuAssertTrue(_testCase, ti->getStartPosition() == 4);
    CuAssertTrue(_testCase, ti->getLength() == 5);

    bi->toReverse();
    CuAssertTrue(_testCase, bi->getReversed() == false);
    bi->toRight();
    ti->toParseUp(bi);
    CuAssertTrue(_testCase, ti->getStartPosition() == 5);
    CuAssertTrue(_testCase, ti->getLength() == 5);

    bi->toReverse();
    ti->toParseUp(bi);
    CuAssertTrue(_testCase, ti->getStartPosition() == 9);
    CuAssertTrue(_testCase, ti->getLength() == 5);
}
开发者ID:glennhickey,项目名称:hal,代码行数:59,代码来源:halTopSegmentTest.cpp

示例2: toRightNextUngapped

void GappedBottomSegmentIterator::toRightNextUngapped(BottomSegmentIteratorPtr botSegIt) const {
    while (botSegIt->bseg()->hasChild(_childIndex) == false && botSegIt->getLength() <= _gapThreshold) {
        if ((!botSegIt->getReversed() && botSegIt->getBottomSegment()->isLast()) ||
            (botSegIt->getReversed() && botSegIt->getBottomSegment()->isFirst())) {
            break;
        }
        botSegIt->toRight();
    }
}
开发者ID:glennhickey,项目名称:hal,代码行数:9,代码来源:halGappedBottomSegmentIterator.cpp

示例3: toLeftNextUngapped

void GappedBottomSegmentIterator::toLeftNextUngapped(BottomSegmentIteratorPtr botSegIt) const {
    // FIXME: should be methods of BottomSegmentIterator?
    // FIXME: these are identical in halGappedTopSegmentIterator.
    while (botSegIt->bseg()->hasChild(_childIndex) == false && botSegIt->getLength() <= _gapThreshold) {
        if ((!botSegIt->getReversed() && botSegIt->getBottomSegment()->isFirst()) ||
            (botSegIt->getReversed() && botSegIt->getBottomSegment()->isLast())) {
            break;
        }
        botSegIt->toLeft();
    }
}
开发者ID:glennhickey,项目名称:hal,代码行数:11,代码来源:halGappedBottomSegmentIterator.cpp


注:本文中的BottomSegmentIteratorPtr::getReversed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。