本文整理汇总了C++中Genome::getNumChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ Genome::getNumChildren方法的具体用法?C++ Genome::getNumChildren怎么用?C++ Genome::getNumChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Genome
的用法示例。
在下文中一共展示了Genome::getNumChildren方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
}
}
}
示例2: createCallBack
void TopSegmentSimpleIteratorTest::createCallBack(Alignment *alignment) {
Genome *ancGenome = alignment->addRootGenome("Anc0", 0);
size_t numChildren = 9;
for (size_t i = 0; i < numChildren; ++i) {
alignment->addLeafGenome("Leaf" + std::to_string(i), "Anc0", 0.1);
}
vector<Sequence::Info> seqVec(1);
seqVec[0] = Sequence::Info("Sequence", 1000000, 5000, 10000);
ancGenome->setDimensions(seqVec);
CuAssertTrue(_testCase, ancGenome->getNumChildren() == numChildren);
_topSegments.clear();
for (size_t i = 0; i < ancGenome->getNumTopSegments(); ++i) {
TopSegmentStruct topSeg;
topSeg.setRandom();
topSeg._length = ancGenome->getSequenceLength() / ancGenome->getNumTopSegments();
topSeg._startPosition = i * topSeg._length;
_topSegments.push_back(topSeg);
}
TopSegmentIteratorPtr tsIt = ancGenome->getTopSegmentIterator(0);
for (size_t i = 0; not tsIt->atEnd(); tsIt->toRight(), ++i) {
CuAssertTrue(_testCase, (size_t)tsIt->getTopSegment()->getArrayIndex() == i);
_topSegments[i].applyTo(tsIt);
}
}