Context
Blocks: feat: Implement CatVRS transit layer on variant endpoints #744
Variant data transfer is the main performance bottleneck on score set pages. The new data model (AssayedVariant → MappingRecord → Allele) provides richer variant data at all levels (genomic, coding, protein), which makes API shape decisions more consequential.
The API needs to serve two contexts efficiently:
- Score set page: paginated sparse list for table/chart rendering, with on-demand expansion for inline variant-level visualizations
- Variant page: full rich single-variant response including alleles at all levels and CatVRS categorical representation for protein-level variants
The design decision produced here is the contract that the CatVRS implementation (#744) builds against.
Data model traversal path
For a given AssayedVariant:
AssayedVariant → MappingRecord (current) → mapping_record_alleles → Allele rows at applicable levels (filtered by level column)
- For protein-level variants (
MappingRecord.assay_level = protein): the associated Allele rows where level = 'coding' are the categorical members for CatVRS
- Annotation data is on per-type annotation tables (
VEPAnnotation, GnomADVariant, ClinicalControl) keyed by allele_id
Goal
Produce an ADR or decision comment specifying the concrete API contract for variant data endpoints.
Questions to Resolve
- What fields constitute the minimum viable sparse payload for score set list rendering?
- What is the expansion mechanism for full variant data within the score set page context? (query param, field mask, sub-resource?)
- Does CatVRS expansion live on
GET /variants/{id} directly, or a sub-resource?
- How does annotation data surface in responses — inline or by reference?
- What are the acceptable response time targets for each endpoint context?
- How does the response handle variants with alleles at multiple levels (e.g. all three levels for protein-level score sets)?
Context
Blocks: feat: Implement CatVRS transit layer on variant endpoints #744
Variant data transfer is the main performance bottleneck on score set pages. The new data model (
AssayedVariant → MappingRecord → Allele) provides richer variant data at all levels (genomic, coding, protein), which makes API shape decisions more consequential.The API needs to serve two contexts efficiently:
The design decision produced here is the contract that the CatVRS implementation (#744) builds against.
Data model traversal path
For a given
AssayedVariant:AssayedVariant→MappingRecord(current) →mapping_record_alleles→Allelerows at applicable levels (filtered bylevelcolumn)MappingRecord.assay_level = protein): the associatedAllelerows wherelevel = 'coding'are the categorical members for CatVRSVEPAnnotation,GnomADVariant,ClinicalControl) keyed byallele_idGoal
Produce an ADR or decision comment specifying the concrete API contract for variant data endpoints.
Questions to Resolve
GET /variants/{id}directly, or a sub-resource?