From f367a00b0a47e22c96cacccc1ffb4934746629cb Mon Sep 17 00:00:00 2001 From: Sean Upchurch Date: Tue, 23 Aug 2011 13:54:07 -0700 Subject: [PATCH] fix bug in RegionFinder.updateControlStatistics that was causing crash --- findall.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/findall.py b/findall.py index f2c7043..f6fb9e6 100755 --- a/findall.py +++ b/findall.py @@ -700,7 +700,11 @@ def previousRegionIsDone(pos, previousHit, maxSpacing, maxCoord): def regionPassesCriteria(regionFinder, sumAll, numStarts, regionLength, stringency=1): - return sumAll >= stringency * regionFinder.minHits and numStarts > stringency * regionFinder.minRatio and regionLength > stringency * regionFinder.readlen + minTotalReads = stringency * regionFinder.minHits + minNumReadStarts = stringency * regionFinder.minRatio + minRegionLength = stringency * regionFinder.readlen + + return sumAll >= minTotalReads and numStarts > minNumReadStarts and regionLength > minRegionLength def trimRegion(region, regionFinder, peak, regionStop, trimValue, currentReadList, totalReadCount): @@ -829,7 +833,7 @@ def setMultireadPercentage(region, hitRDS, hitRDSsize, currentTotalWeight, curre except ZeroDivisionError: return - region.multiP = multiP + region.multiP = min(multiP, 100.) def regionAndPeakPass(regionFinder, region, regionLength, peakScore, plusRatio): @@ -907,6 +911,7 @@ def writeRegions(outregions, outfile, doPvalue, poissonmean, shiftValue=0, repor def calculatePValue(sum, poissonmean): pValue = math.exp(-poissonmean) + #TODO: 798: DeprecationWarning: integer argument expected, got float - for i in xrange(sum) for i in xrange(sum): pValue *= poissonmean pValue /= i+1 -- 2.30.2