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


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

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


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

示例1: createCallBack

void SequenceUpdateTest::createCallBack(Alignment *alignment) {
    hal_size_t alignmentSize = alignment->getNumGenomes();
    CuAssertTrue(_testCase, alignmentSize == 0);

    Genome *ancGenome = alignment->addRootGenome("AncGenome", 0);

    size_t numSequences = 1000;
    vector<Sequence::Info> seqVec;
    for (size_t i = 0; i < numSequences; ++i) {
        hal_size_t len = 1 + i * 5 + i;
        string name = "sequence" + std::to_string(i);
        seqVec.push_back(Sequence::Info(name, len, i, i * 2));
    }
    ancGenome->setDimensions(seqVec);
    alignment->closeGenome(ancGenome);
    ancGenome = alignment->openGenome("AncGenome");

    vector<Sequence::UpdateInfo> updateVec;
    for (size_t i = 0; i < numSequences / 2; ++i) {
        const Sequence *sequence = ancGenome->getSequence("sequence" + std::to_string(i));
        updateVec.push_back(Sequence::UpdateInfo(sequence->getName(), i * 7));
    }
    ancGenome->updateTopDimensions(updateVec);

    updateVec.clear();
    for (size_t i = 0; i < numSequences / 3; ++i) {
        const Sequence *sequence = ancGenome->getSequence("sequence" + std::to_string(i));
        updateVec.push_back(Sequence::UpdateInfo(sequence->getName(), i * 5));
    }
    ancGenome->updateBottomDimensions(updateVec);
}
开发者ID:glennhickey,项目名称:hal,代码行数:31,代码来源:halSequenceTest.cpp

示例2: writeSequences

void LodExtract::writeSequences(const Genome* inParent,
                                const vector<const Genome*>& inChildren)
{
  vector<const Genome*> inGenomes = inChildren;
  inGenomes.push_back(inParent);
  const Genome* outParent = _outAlignment->openGenome(inParent->getName());
  (void)outParent;
  assert(outParent != NULL && outParent->getNumBottomSegments() > 0);
  string buffer;

  for (hal_size_t i = 0; i < inGenomes.size(); ++i)
  {
    const Genome* inGenome = inGenomes[i];
    Genome* outGenome = _outAlignment->openGenome(inGenome->getName());
    if (inGenome == inParent || outGenome->getNumChildren() == 0)
    {   
      SequenceIteratorConstPtr inSeqIt = inGenome->getSequenceIterator();
      SequenceIteratorConstPtr end = inGenome->getSequenceEndIterator();
      for (; inSeqIt != end; inSeqIt->toNext())
      {
        const Sequence* inSequence = inSeqIt->getSequence();
        if (inSequence->getSequenceLength() > 0)
        {
          Sequence* outSequence = outGenome->getSequence(inSequence->getName());
          assert(outSequence != NULL);
          inSequence->getString(buffer);
          outSequence->setString(buffer);
        }
      }
    }
  }
}
开发者ID:dayin1989,项目名称:hal,代码行数:32,代码来源:halLodExtract.cpp


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