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


C++ Genome::getSequenceEndIterator方法代码示例

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


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

示例1: writeSegments

void LodExtract::writeSegments(const Genome* inParent,
                               const vector<const Genome*>& inChildren)
{
  vector<const Genome*> inGenomes = inChildren;
  inGenomes.push_back(inParent);
  const Genome* outParent = _outAlignment->openGenome(inParent->getName());
  assert(outParent != NULL && outParent->getNumBottomSegments() > 0);
  BottomSegmentIteratorPtr bottom;
  TopSegmentIteratorPtr top;
  SegmentIteratorPtr outSegment;

  // FOR EVERY GENOME
  for (hal_size_t i = 0; i < inGenomes.size(); ++i)
  {
    const Genome* inGenome = inGenomes[i];
    Genome* outGenome = _outAlignment->openGenome(inGenome->getName());

    SequenceIteratorPtr outSeqIt = outGenome->getSequenceIterator();
    SequenceIteratorConstPtr outSeqEnd = outGenome->getSequenceEndIterator();
    
    // FOR EVERY SEQUENCE IN GENOME
    for (; outSeqIt != outSeqEnd; outSeqIt->toNext())
    {
      const Sequence* outSequence = outSeqIt->getSequence();
      const Sequence* inSequence = 
         inGenome->getSequence(outSequence->getName());
      if (outGenome != outParent && outSequence->getNumTopSegments() > 0)
      {
        top = outSequence->getTopSegmentIterator();
        outSegment = top;
      }
      else if (outSequence->getNumBottomSegments() > 0)
      {
        bottom = outSequence->getBottomSegmentIterator();
        outSegment = bottom;
      }
      const LodGraph::SegmentSet* segSet = _graph.getSegmentSet(inSequence);
      assert(segSet != NULL);
      LodGraph::SegmentSet::const_iterator segIt = segSet->begin();
      if (segSet->size() > 2)
      {
        //skip left telomere
        ++segIt;
        // use to skip right telomere:
        LodGraph::SegmentSet::const_iterator segLast = segSet->end();
        --segLast;
      
        // FOR EVERY SEGMENT IN SEQUENCE
        for (; segIt != segLast; ++segIt)
        {
          // write the HAL array index back to the segment to make
          // future passes quicker. 
          (*segIt)->setArrayIndex(outSegment->getArrayIndex());
          outSegment->setCoordinates((*segIt)->getLeftPos(), 
                                     (*segIt)->getLength());
          assert(outSegment->getSequence()->getName() == inSequence->getName());
          outSegment->toRight();
        }
      }
      else if (outSequence->getSequenceLength() > 0)
      {
        assert(segSet->size() == 2);
        writeUnsampledSequence(outSequence, outSegment);
      }
    }
  } 
}
开发者ID:dayin1989,项目名称:hal,代码行数:67,代码来源:halLodExtract.cpp


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