本文整理汇总了C++中Genome::getContigAtLocation方法的典型用法代码示例。如果您正苦于以下问题:C++ Genome::getContigAtLocation方法的具体用法?C++ Genome::getContigAtLocation怎么用?C++ Genome::getContigAtLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Genome
的用法示例。
在下文中一共展示了Genome::getContigAtLocation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
//.........这里部分代码省略.........
int cumulativePositiveAddFrontClipping[NUM_READS_PER_PAIR] = { 0, 0 };
do {
size_t tentativeUsed = 0;
secondReadLocationChanged = false;
for (int firstOrSecond = 0; firstOrSecond < NUM_READS_PER_PAIR; firstOrSecond++) { // looping over the order in which the reads are written, not the order in which they arrived
int whichRead = writeOrder[firstOrSecond];
//
// Loop until we get a write with no additional front clipping.
//
int addFrontClipping = 0;
while (!format->writeRead(context, &lvc, buffer + used + tentativeUsed, size - used - tentativeUsed, &usedBuffer[firstOrSecond][whichAlignmentPair],
idLengths[whichRead], reads[whichRead], result[whichAlignmentPair].status[whichRead], result[whichAlignmentPair].mapq[whichRead], locations[whichRead], result[whichAlignmentPair].direction[whichRead],
whichAlignmentPair != 0 || !firstIsPrimary, &addFrontClipping, true, writeOrder[firstOrSecond] == 0,
reads[1 - whichRead], result[whichAlignmentPair].status[1 - whichRead], locations[1 - whichRead], result[whichAlignmentPair].direction[1 - whichRead],
result[whichAlignmentPair].alignedAsPair)) {
if (0 == addFrontClipping || locations[whichRead] == InvalidGenomeLocation) {
//
// We failed because we ran out of buffer.
//
goto blownBuffer;
}
if (1 == firstOrSecond) {
//
// If the location of the second read changed, we need to redo the first one as well, because it includes an offset to the second read
//
secondReadLocationChanged = true;
}
const Genome::Contig *originalContig = genome->getContigAtLocation(locations[whichRead]);
const Genome::Contig *newContig = genome->getContigAtLocation(locations[whichRead] + addFrontClipping);
if (newContig != originalContig || NULL == newContig || locations[whichRead] + addFrontClipping > originalContig->beginningLocation + originalContig->length - genome->getChromosomePadding()) {
//
// Altering this would push us over a contig boundary. Just give up on the read.
//
result[whichAlignmentPair].status[whichRead] = NotFound;
result[whichAlignmentPair].location[whichRead] = InvalidGenomeLocation;
locations[whichRead] = InvalidGenomeLocation;
} else {
if (addFrontClipping > 0) {
cumulativePositiveAddFrontClipping[firstOrSecond] += addFrontClipping;
reads[whichRead]->setAdditionalFrontClipping(cumulativePositiveAddFrontClipping[firstOrSecond]);
}
locations[whichRead] += addFrontClipping;
}
} // While formatting didn't work
tentativeUsed += usedBuffer[firstOrSecond][whichAlignmentPair];
} // for first or second read
} while (secondReadLocationChanged);
used += usedBuffer[0][whichAlignmentPair] + usedBuffer[1][whichAlignmentPair];
//
// Both reads are written into the buffer. Save the final locations we used for when we commit.
//
for (int whichRead = 0; whichRead < NUM_READS_PER_PAIR; whichRead++) {
finalLocations[whichRead][whichAlignmentPair] = locations[whichRead];
}
} // for each pair.
//
// Now write the single alignments.