# custom value transformation function [closed]

Background: Blast is a (famous) tool for finding high scoring local alignments between sequences. It allows you to set a search parameter that controls the statistical significance of each (similar) sequence in the result. If you set t in the E-value field, it will report only the sequances with e-values lower than t and deem anything else "insignificant match".

Question: I'm looking for a way (a function) to transform the resulting e-values to values from in the following set: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1] that also make use of the search parameter t as the zero of that function; and the closer to t values are, the closer they get to 0; and the furthur away from t, the closer they get to 1.

A suggested function is
$$p(x_i) = \frac{1}{\log_{}{E_i}}$$where x_i is the ith sequance, and E_i is its e-value. However, this function makes no use of the original threshold, and it produces negative values, and values greater than 1!

values greater than 1 (in the suggested function) make sense (strong statistical significance of a sequence similarity score) and they will always be mapped to 1 (in the transformation function); on the other hand, negative values produced by the suggested function should not be mapped to 0.

Any suggestion?!

## closed as unclear what you're asking by Michael Chernick, Stephan Kolassa, mdewey, Peter Flom♦Dec 28 '17 at 14:23

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• What are possible values for E? – Stephan Kolassa Dec 27 '17 at 20:22
• E can be any vale less than 0.01; for example some actual values of E I'm getting are (in order from best to worst): 6e-178, 1e-177, 3e-176, 3e-88, 9e-49, 8e-24, 2e-08, 1e-07 – 7kemZmani Dec 27 '17 at 22:13
• could anyone explain which part is "unclear"?! – 7kemZmani Dec 28 '17 at 16:39
• It's clearer now, given the comment. I forgot to retract my closure vote, and have nominated this for reopening. – Stephan Kolassa Dec 28 '17 at 16:40

If your threshold is $t$, you can use
$$p(x) = -\log t\bigg(\frac{1}{\log x}-\frac{1}{\log t}\bigg)$$
tt <- 0.01