Commit dbf4a082 by Eric Coissac

Patch a bug in the length variance estimation when variance is null

parent 8e312e93
......@@ -1949,7 +1949,11 @@ def estimateFragmentLength(self,minlength=500):
if delta:
mdelta = sum(delta) / float(len(delta))
sdelta = math.sqrt(sum(float(d ** 2) / len(delta) for d in delta) - mdelta**2)
m2delta= sum(float(d ** 2) / float(len(delta)) for d in delta)
variance=m2delta - mdelta**2
if variance < 0:
variance=0
sdelta = math.sqrt(variance)
return (mdelta+self.index.getReadSize(),sdelta)
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment