I am currently using R to assign mutation significance values to proteins in yeast.
I have a data frame that looks like this:
Genes q_values
1 HNT1 4.836462e-01
2 EMP47 6.792469e-01
3 QDR2 6.357284e-01
4 TMS1 9.781394e-01
5 TMS1 8.672664e-01
...
However, on occasion there will be a q_value significantly lower than the others:
...
35 HHF1 5.565396e-01
36 RGA2 2.323061e-12
37 CDC24 8.174687e-01
...
# Notice how value for row 36 is very low
I want to rescale these q_values onto a 1-10000 scale. However, I need the highest original q_value (i.e. ~9.85e-01) to be the lowest on the new scale (e.i. a value of 1). Inversely, the lowest original q_value (i.e. ~1.36e-13) needs to be the highest on the new scale (e.i. a value of 10000).
I have tried making a variation of the equation proposed here: https://stats.stackexchange.com/questions/25894/changing-the-scale-of-a-variable-to-0-100. However I did not manage to get the results I am looking far.
What would be the best way to go about doing this?