Additional Statistics Endpoints and Statistics Router Refactor #397
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 optiononlyCurrentcontrols 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.