projects
/
erange.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
47bd897
)
fix bug in RegionFinder.updateControlStatistics that was causing crash
author
Sean Upchurch
<sau@caltech.edu>
Tue, 23 Aug 2011 20:54:07 +0000
(13:54 -0700)
committer
Sean Upchurch
<sau@caltech.edu>
Tue, 23 Aug 2011 20:54:07 +0000
(13:54 -0700)
findall.py
patch
|
blob
|
history
diff --git
a/findall.py
b/findall.py
index f2c70432b1ccc477ca3ccee55b708a0e3e82f4bf..f6fb9e618ae7ebd72830e75b84aa536a455c07e8 100755
(executable)
--- a/
findall.py
+++ b/
findall.py
@@
-700,7
+700,11
@@
def previousRegionIsDone(pos, previousHit, maxSpacing, maxCoord):
def regionPassesCriteria(regionFinder, sumAll, numStarts, regionLength, stringency=1):
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):
def trimRegion(region, regionFinder, peak, regionStop, trimValue, currentReadList, totalReadCount):
@@
-829,7
+833,7
@@
def setMultireadPercentage(region, hitRDS, hitRDSsize, currentTotalWeight, curre
except ZeroDivisionError:
return
except ZeroDivisionError:
return
- region.multiP = m
ultiP
+ region.multiP = m
in(multiP, 100.)
def regionAndPeakPass(regionFinder, region, regionLength, peakScore, plusRatio):
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)
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
for i in xrange(sum):
pValue *= poissonmean
pValue /= i+1