From 6020d6c326622fe71f29946ab7da4944ebd6589b Mon Sep 17 00:00:00 2001 From: prashanti Date: Fri, 3 Jul 2015 09:14:34 -0500 Subject: [PATCH] Fixed E-value formula --- src/regression.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/regression.py b/src/regression.py index 1fb8147..b97cd21 100644 --- a/src/regression.py +++ b/src/regression.py @@ -109,10 +109,9 @@ def compute_expect_scores(studentizedresiduals,numoftaxa): for line in infile: if "Score" not in line: gene,genesize,genename,taxon,taxonsize,taxonname,score,uri=line.strip().split("\t") + score=float(score) residual=studentizedresiduals[i] - a=-residual*math.pi - b=math.sqrt(6)-0.5772156649 - pvalue=1-math.exp(-math.exp(a/b)) + pvalue=1-math.exp(-math.exp(-residual*math.pi/math.sqrt(6)+ 0.5772156649)) expect=pvalue*numoftaxa ranks.write(uri+"\t"+str(studentizedresiduals[i])+"\t"+str(round(pvalue,2))+"\t"+str(expect)+"\n") outfile.write(gene+"\t"+genename+"\t"+taxon+"\t"+taxonname+"\t"+str(round(score,2))+"\t"+str(expect)+"\n")