From 542445b8162beeb24b4ee39eefd86caccab6f48f Mon Sep 17 00:00:00 2001 From: Sergey Koren Date: Tue, 13 Jun 2017 12:29:57 -0400 Subject: [PATCH] Initialize clear range to 0 not UINT32_MAX to avoid assert fails on reads without any good bases --- src/overlapBasedTrimming/splitReads-trimBad.C | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/overlapBasedTrimming/splitReads-trimBad.C b/src/overlapBasedTrimming/splitReads-trimBad.C index 011d6757a..4144c495c 100644 --- a/src/overlapBasedTrimming/splitReads-trimBad.C +++ b/src/overlapBasedTrimming/splitReads-trimBad.C @@ -55,8 +55,11 @@ trimBadInterval(gkStore *gkp, // Find the largest good region, save it in the output clear range. If there are no // regions (the whole read was marked bad?), default to a bougs clear range. - w->clrBgn = UINT32_MAX; - w->clrEnd = UINT32_MAX; + // Was previously set to UINT32_MAX. However, for a read with no good region, when UINT32_MAX is returned + // to calling function, asserts on line 370-371 fail because UINT32_MAX is not in initial clear range + // set to 0 instead. + w->clrBgn = 0; + w->clrEnd = 0; for (uint32 rr=0; rrclrEnd - w->clrBgn) < (goodRegions.hi(rr) - goodRegions.lo(rr))) {