You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mint a pre-mapped VRS allele for each accession-target variant inside validate_genomic_variant, reusing the variant object and CDOT provider it already has.
Problem
Transcript accessions (NM_/ENST) have 5' UTRs, so c.197 is not position 197 of the fetched transcript sequence. Positions have to go through a coordinate-aware mapper before SPDI conversion. Non-accession targets (#868) don't have this problem.
Proposed behavior
Reuse variant_obj after hgvs.validator.Validator(hdp=cdot_rest()) validates it. Don't parse or validate it again.
Project it to a sequence-relative position with hgvs.variantmapper.VariantMapper or AssemblyMapper, built on hdp=cdot_rest(). Don't use ga4gh.vrs's AlleleTranslator, which is hardwired to the public UTA server.
Fetch the sequence with cdot_rest().get_seq(TargetAccession.accession), memoized per (target, accession).
Set allele.expressions to the original HGVS string.
Call site: in validate_genomic_variant, after validator.validate(...) succeeds. Keep minting failures (CDOT unavailable, accession not found, projection failure) out of the validity return. They must never raise ValidationError.
Acceptance criteria
First, in a dev environment with cdot-rest, confirm that a transcript with a non-trivial 5' UTR projects to a sequence position that differs from its c. number.
For such an accession, the digest uses the offset-adjusted position.
CDOT fetches each (target, accession) at most once per validation pass.
CDOT failures (network, timeout, accession not found) and projection failures (such as an intronic variant with no resolvable sequence) raise different typed exceptions. That lets Attach minted pre-mapped VRS to created Variant rows and record the outcome #870 record them under different AnnotationFailureCategory values, and the existing EXTERNAL_API_ERROR and EXTERNAL_REFERENCE_NOT_FOUND are enough.
Corpus cross-check: accession variants that have a MappedVariant.pre_mapped and a clean alignment (no near_gap/at_mismatched_locus) produce matching digests. A mismatch on a flagged variant is expected.
Implementation notes
cdot_rest() (data_providers/services.py) is the internal service that validate_hgvs_genomic_column already calls.
Variant.hgvs_nt/hgvs_pro store bare edits without the accession, even for accession targets. dcd-mapping's _map_accession adds TargetAccession.accession itself.
Summary
Mint a pre-mapped VRS allele for each accession-target variant inside
validate_genomic_variant, reusing the variant object and CDOT provider it already has.Problem
Transcript accessions (
NM_/ENST) have 5' UTRs, soc.197is not position 197 of the fetched transcript sequence. Positions have to go through a coordinate-aware mapper before SPDI conversion. Non-accession targets (#868) don't have this problem.Proposed behavior
variant_objafterhgvs.validator.Validator(hdp=cdot_rest())validates it. Don't parse or validate it again.hgvs.variantmapper.VariantMapperorAssemblyMapper, built onhdp=cdot_rest(). Don't usega4gh.vrs'sAlleleTranslator, which is hardwired to the public UTA server.cdot_rest().get_seq(TargetAccession.accession), memoized per(target, accession)._from_spdi→normalize_and_identifyover aLiteralSequenceDataProxy.allele.expressionsto the original HGVS string.validate_genomic_variant, aftervalidator.validate(...)succeeds. Keep minting failures (CDOT unavailable, accession not found, projection failure) out of the validity return. They must never raiseValidationError.Acceptance criteria
cdot-rest, confirm that a transcript with a non-trivial 5' UTR projects to a sequence position that differs from itsc.number.(target, accession)at most once per validation pass.AnnotationFailureCategoryvalues, and the existingEXTERNAL_API_ERRORandEXTERNAL_REFERENCE_NOT_FOUNDare enough.MappedVariant.pre_mappedand a clean alignment (nonear_gap/at_mismatched_locus) produce matching digests. A mismatch on a flagged variant is expected.Implementation notes
cdot_rest()(data_providers/services.py) is the internal service thatvalidate_hgvs_genomic_columnalready calls.Variant.hgvs_nt/hgvs_prostore bare edits without the accession, even for accession targets. dcd-mapping's_map_accessionaddsTargetAccession.accessionitself.