-
Notifications
You must be signed in to change notification settings - Fork 2
Refactor Score Ranges to Score Calibrations and Strengthen Their Data Model #545
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
Merged
bencap
merged 20 commits into
release-2025.5.0
from
feature/bencap/518/generic-score-range-entries
Nov 11, 2025
Merged
Refactor Score Ranges to Score Calibrations and Strengthen Their Data Model #545
bencap
merged 20 commits into
release-2025.5.0
from
feature/bencap/518/generic-score-range-entries
Nov 11, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…single primary definition
For use with urn:mavedb:00000097-0-2
Adds a standalone score calibration model to replace the `score_ranges` property of score sets. This model better supports generically typed score ranges, publication identifiers directly associated with score ranges and odds paths provided independently of functional classes.
This was
linked to
issues
Oct 20, 2025
72be010 to
f4fbc42
Compare
This was
linked to
issues
Oct 20, 2025
jstone-dev
approved these changes
Oct 28, 2025
c67dda6 to
00602eb
Compare
Collaborator
Author
|
DB Migration steps for this branch Checkout the commit git checkout 129d7daefb0c18d0f70f20ee633cb17a02a3cc37
DB_PORT=5434 DB_DATABASE_NAME=mavedb DB_USERNAME=postgres DB_PASSWORD=XXX poetry run alembic upgrade headRun the manual migration DB_PORT=5434 DB_DATABASE_NAME=mavedb DB_USERNAME=postgres DB_PASSWORD=XXX poetry run python3 alembic/manual_migrations/migrate_score_ranges_to_calibrations.pyCheckout the commit git checkout 3da28919a6f6173ad0d65c768b172dfffbf730fc
DB_PORT=5434 DB_DATABASE_NAME=mavedb DB_USERNAME=postgres DB_PASSWORD=XXX poetry run alembic upgrade headCheckout the head commit at main and upgrade to the alembic head git checkout main
DB_PORT=5434 DB_DATABASE_NAME=mavedb DB_USERNAME=postgres DB_PASSWORD=XXX poetry run alembic upgrade head |
… strengths, and reworked score calibrations
- Refactored score range jsonb in score sets into a separate data model with db tables and publication associations - Removed tests related to score ranges and replaced them with tests for score calibrations. - Updated test cases to validate the creation of score sets with investigator-provided calibrations. - Ensured that score set creation fails when non-investigator provided calibrations are included. - Adjusted error assertions to reflect changes in validation logic for score calibrations.
- Removed the `investigator_provided` field from `ScoreCalibrationBase` and adjusted related validation logic. - Updated `SavedScoreCalibration` to include `investigator_provided` as a boolean field. - Modified validation error messages to include specific locations in the request body. - Changed references from `InvestigatorProvidedScoreCalibrationCreate` to `ScoreCalibrationCreate` in `ScoreSetCreate`. - Updated test constants and removed unnecessary test cases related to `investigator_provided`. - Enhanced tests for creating score calibrations to ensure correct behavior for investigator-provided settings. - Adjusted tests to reflect changes in the model structure and validation logic.
31e69c7 to
a04ccb0
Compare
…avedb-api into feature/bencap/518/generic-score-range-entries
This was referenced Nov 13, 2025
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 pull request introduces a major refactor of how score calibrations and functional ranges are handled in the database and application logic. The changes migrate from storing score ranges directly on
ScoreSetobjects to a new, dedicatedscore_calibrationstable, update related migration scripts, and improve the logic for variant classification using these calibrations. Additionally, new ACMG classification utilities are introduced.Database schema migrations and refactoring:
score_calibrationsandscore_calibration_publication_identifierstables, and migrated existing score range data fromScoreSetto this new structure. (alembic/versions/002f6f9ec7ac_add_score_calibration_table.py)score_rangesproperty from thescoresetstable and provided a downgrade path to restore it if needed. (alembic/versions/f5a72192fafd_remove_score_range_property_from_score_.py)score_calibrationstable to remove thenamecolumn and add anotescolumn, updating the schema for future flexibility. (alembic/versions/8886f0453125_remove_name_add_notes_to_calibrations.py)Application logic and classification improvements:
score_calibrationsstructure and itsfunctional_ranges, replacing prior logic that relied onscore_rangesonScoreSet. This includes renaming and updating the main classification functions and ensuring robust error handling when calibrations are missing. (src/mavedb/lib/annotation/classification.py) [1] [2] [3]New utilities for ACMG classification:
src/mavedb/lib/acmg.py)