本文整理汇总了C++中FileFormat::writeRead方法的典型用法代码示例。如果您正苦于以下问题:C++ FileFormat::writeRead方法的具体用法?C++ FileFormat::writeRead怎么用?C++ FileFormat::writeRead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileFormat
的用法示例。
在下文中一共展示了FileFormat::writeRead方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
//.........这里部分代码省略.........
//
for (int whichAlignmentPair = 0; whichAlignmentPair < nResults; whichAlignmentPair++) {
reads[0]->setAdditionalFrontClipping(0);
reads[1]->setAdditionalFrontClipping(0);
GenomeLocation locations[2];
locations[0] = result[whichAlignmentPair].status[0] != NotFound ? result[whichAlignmentPair].location[0] : InvalidGenomeLocation;
locations[1] = result[whichAlignmentPair].status[1] != NotFound ? result[whichAlignmentPair].location[1] : InvalidGenomeLocation;
int writeOrder[2]; // The order in which we write the reads, which is just numerical by genome location. SO writeOrder[0] gets written first, and writeOrder[1] second.
if (locations[0] <= locations[1]) {
writeOrder[0] = 0;
writeOrder[1] = 1;
} else {
writeOrder[0] = 1;
writeOrder[1] = 0;
}
bool secondReadLocationChanged;
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]);