Skip to content

Commit

Permalink
Fixed E-value formula
Browse files Browse the repository at this point in the history
  • Loading branch information
prashanti committed Jul 3, 2015
1 parent 6ae5461 commit 6020d6c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 6020d6c

Please sign in to comment.