Skip to content

Commit

Permalink
Don't try to access a bogus read if no overlaps exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianwalenz committed Sep 19, 2017
1 parent 3e6fe62 commit ab92df3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/correction/generateCorrectionLayouts.C
Original file line number Diff line number Diff line change
Expand Up @@ -367,19 +367,21 @@ main(int argc, char **argv) {
uint32 readID = (ovlLen > 0) ? ovl[0].a_iid : UINT32_MAX; // Read ID of overlaps, or maximum ID if no overlaps.
tgTig *layout = new tgTig;

layout->_tigID = ii;
layout->_layoutLen = gkpStore->gkStore_getRead(readID)->gkRead_sequenceLength();
layout->_tigID = ii;

assert(ii <= readID);

// If ii is below readID, there are no overlaps for this read. Make an empty placeholder tig for it.
// But if ii is readID, we have overlaps, so process them, then load more.

if (ii == readID) {
layout->_layoutLen = gkpStore->gkStore_getRead(readID)->gkRead_sequenceLength();

layout = generateLayout(layout,
olapThresh,
minEvidenceLength, maxEvidenceErate, maxEvidenceCoverage,
ovl, ovlLen);

ovlLen = ovlStore->readOverlaps(ovl, ovlMax, true);
}

Expand Down

0 comments on commit ab92df3

Please sign in to comment.