I'm trying to work out the formula for BLAST e value calculation. I have surfed all across the internet looking for it, but the only thing I'm able to find is the formula provided here: http://www.ncbi.nlm.nih.gov/BLAST/tutorial/Altschul-1.html The problem is, I can't get the correct value for whatever parameters I plug into it. What I do? I run blastp module of blast on a query and Uniprot database. BLAST then gives me values for gapped K and lambda, as well as scores, database length and query length. When I plug that into the formula E = K * m * n * exp (- lambda * S), I get absolute nonsense. I tried various stuff for m and n - including database length, query length, result sequence length - tried bit scores and real scores, and I simply can't get the E value which blast outputs by itself, no matter what. Is there a way to correctly calculate E value and how? Please help.