Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix graphql type error #1644

Merged
merged 2 commits into from
Oct 21, 2024
Merged

Fix graphql type error #1644

merged 2 commits into from
Oct 21, 2024

Conversation

rileyhgrant
Copy link
Contributor

Resolves a long standing type error in the GraphQL API.

The original type for the odds_ratio field of the contingency_table_test of the joint frequency data's frequency comparison stats (used for the discrepant frequencies flag) was a Float. However, some small percentage of the odds_ratio values were infinity, there could be several infinities in this array for a given variant due to odds_ratio being calculated for differing genetic ancestry groups.

These GraphQL errors likely had extremely little impact on users, as the gnomAD browser's frontend was requesting, but not actually using, the odds_ratio data, instead preferring a different field to display a relevant p_value. The only users who would have been impacted by this would have been those using our API, and who had requested and used the odds_ratio field of in the frequency comparison stats. I believe those users would have had a null returned to them, rather than an infinity.

This PR addresses this with 2 minor edits:

  1. Changes the type that was previously a float to a string. This is a bit odd since some large percentage of these values are truly floats, but due to the existence of a more useful field for seeing at a glance the values relevant to discrepant frequencies (stat_union) I believe this quick fix is appropriate.
  2. Removes the unused values from the frontend's API request. These were left in there after the stat_union field was added, and while requested, the frontend does not use the data at all.

@rileyhgrant rileyhgrant self-assigned this Oct 18, 2024
@rileyhgrant rileyhgrant merged commit cb1846f into main Oct 21, 2024
5 checks passed
@rileyhgrant rileyhgrant deleted the fix-12k-graphql-errors branch October 21, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants