opentargets / issues

Issue tracker for Open Targets Platform and Open Targets Genetics Portal
https://platform.opentargets.org https://genetics.opentargets.org
Apache License 2.0
12 stars 2 forks source link

Increase odds ratio resolution to 4 decimal points #2071

Closed d0choa closed 1 week ago

d0choa commented 2 years ago

Context

As reported by @mohdkarim and @Jeremy37, for the next study-locus link, we are displaying an odds ratio of 1 and CIs of (1.0, 1.0)

Screenshot 2022-02-22 at 11 32 36

)

However, as it can be seen on the API response, we have more resolution for the odds ratio. The fact that the p-value is 3.0e-15 is telling us that the deviation between 1 and 1.0073 is relevant, so it would be good to be able to see the difference.

Action

Can we please increase the resolution of the odds ratio and the confidence intervals to 4 decimal points?

This implies updating:

Screenshot 2022-02-22 at 11 47 30 Screenshot 2022-02-22 at 11 39 53
andrewhercules commented 2 years ago

@d0choa there is a single function called significantFigures that uses the d3-format library to render all numbers found in Open Targets Genetics.

Unfortunately, the current implementation does not provide granularity to specify a certain precision for odds ratio numbers and a different precision for L2G scores or p-values.

If I change the function to show 4 decimal points (deploy preview), this is what it would look like on a study-locus page.

Screenshot 2022-02-23 at 14 15 38

And using the example you provided above -- Diabetes or endocrine disease and locus around 7_100691506_A_ATTTTTTT -- if I set the function to show 5 decimal points so that the odds ratio value of 1.0073 is visible, this is what it looks like.

Screenshot 2022-02-23 at 14 15 20

Which option do you prefer?

d0choa commented 2 years ago

I see. The abstraction that assumes all figures will require the same resolution is probably not a good idea. Different numbers have different interpretations and might require different levels of resolution for reasons that are hard to generalise.

If @carcruz thinks it's the right strategy, we can create a second helper function significantOdds and apply it on odds ratios and their respective confidence intervals

andrewhercules commented 2 years ago

I agree, I don't think it is ideal that all numbers are treated the same as some numbers require different levels of precision. I have closed the corresponding PR - https://github.com/opentargets/genetics-app/pull/206 - as this issue requires a more comprehensive fix.

d0choa commented 1 week ago

New widgets will only show Beta and not odds ratio.

I checked this specific case in the new UI: https://genetics--ot-platform.netlify.app/variant/7_100691506_A_ATTTTTTT

I think it's a really nice example of how things are improving cc @buniello @addramir @DSuveges

Screenshot 2024-09-11 at 11 21 03