Skip to content

Conversation

@bencap
Copy link
Collaborator

@bencap bencap commented Mar 6, 2025

This change adds additional statistics router endpoints:

  • /api/v1/statistics/score-set/count?group: Count of published score sets in MaveDB, possibly grouped by month or year.
    • /api/v1/statistics/experiment/count?group: Count of published experiments in MaveDB, possibly grouped by month or year.
  • /api/v1/statistics/target/mapped/gene: Counts of gene symbols to which we have mapped targets. Included in this change is a script which populates this information for historically mapped targets.
  • /api/v1/statistics/variant/count?group: The count of variant objects in MaveDB, possibly grouped by month or year.
  • /api/v1/statistics/mapped-variant/count?group&onlyCurrent: The count of mapped variant objects in MaveDB, possibly grouped by month or year. An additional option onlyCurrent controls whether to only count current mapped variants.

In addition to the new routers above, this change refactors existing routes to clarify their logic. A prior version of this router used overly complex shared functions and enum fields that shared more code at the cost of overcomplicating simple stats routes. Here, we live with slightly more code duplication rather than complex functions that are tricky to edit and maintain.

Tests for the new routes have been added as well, in addition to a new test utility that adds mapped variants to the test database.

bencap added 5 commits March 4, 2025 00:12
The previous version of these statistics endpoints featured code that was overly complex for the task at hand. This change refactors statistics code in a way that slightly increases duplicated code (mostly API decorators) while decreasing the complexity of shared functions and logic switches. The result is much clearer and concise endpoints for existing routes.
For historical data, we do not always have the genes that we mapped a target to. This script can be used to infer the mapped gene from the HGVS string of a mapped variant.
@bencap bencap requested review from jstone-dev and sallybg March 6, 2025 19:16
@bencap bencap changed the base branch from main to release-2025.1.1 March 6, 2025 19:16
@bencap bencap linked an issue Mar 6, 2025 that may be closed by this pull request
@bencap bencap force-pushed the feature/bencap/375/ave-statistics-endpoints branch from 4157a35 to 9aedb21 Compare March 6, 2025 19:20
Copy link
Contributor

@sallybg sallybg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@bencap bencap merged commit 5153c34 into release-2025.1.1 Mar 13, 2025
5 checks passed
@bencap bencap deleted the feature/bencap/375/ave-statistics-endpoints branch March 13, 2025 02:41
@bencap bencap mentioned this pull request Mar 18, 2025
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.

Statistics Endpoints to Support AVE Website

3 participants