fix(annotation): handle all VRS allele state types in deserialization#737
Open
bencap wants to merge 2 commits into
Open
fix(annotation): handle all VRS allele state types in deserialization#737bencap wants to merge 2 commits into
bencap wants to merge 2 commits into
Conversation
allele_from_mapped_variant_dictionary_result unconditionally constructed a LiteralSequenceExpression from the stored state dict, causing a Pydantic ValidationError (500) for score sets containing reference-identical variants whose state is a ReferenceLengthExpression. - Dispatch on state type to construct RLE, LengthExpression, or LSE - Raise ValueError with an actionable message for unknown state types, replacing the cryptic multi-field Pydantic error as the failure mode - Add test constants for RLE and LengthExpression allele dicts - Parametrize state-type and CisPhasedBlock member tests to cover all three state types and enforce coverage of future additions
…elds Serializing evidence to dicts via `serialize_evidence_items` before assigning to `hasEvidenceItems`/`hasEvidenceLines` caused `VariantPathogenicityEvidenceLine` validation to fail for Statement objects containing nested VRS Alleles with production genomic data (regex constraints on `digest`, `refgetAccession`, etc. failed during dict reconstruction). - Remove `serialize_evidence_items` from `util.py` entirely - `acmg_evidence_line`: pass `list(evidence)` directly; Statement is in `has_evidence_items_models` and passes the isinstance check - `functional_evidence_line`: wrap items as `StudyResult(root=item)`; `ExperimentalVariantFunctionalImpactStudyResult` does not inherit `StudyResult` so direct instances fail the isinstance check - `mapped_variant_to_pathogenicity_statement`: pass `list(evidence)` - Add regression tests in `test_evidence_line.py` and `test_annotate.py` that assert evidence items are model instances, not raw dicts - Remove `TestSerializeEvidenceItems` from `test_util.py`
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
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.
allele_from_mapped_variant_dictionary_resultunconditionally constructed aLiteralSequenceExpressionfrom the stored state dict, causing a PydanticValidationError(500) for score sets containing reference-identical variants whose state is aReferenceLengthExpression.Additionally, fixes a bug where certain evidence lines were unable to be regenerated via a serialized dict. Evidence generation now proceeds directly via models.