Skip to content

spike: Design variant + annotation API shape for score set and variant pages #743

Description

@bencap

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:

  1. Score set page: paginated sparse list for table/chart rendering, with on-demand expansion for inline variant-level visualizations
  2. 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:

  • AssayedVariantMappingRecord (current) → mapping_record_allelesAllele 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)?

Metadata

Metadata

Assignees

Labels

app: backendTask implementation touches the backendapp: frontendTask implementation touches the frontendtype: investigationInvestigation/exploration task for understanding requirementsworkstream: clinicalTask relates to clinical features

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions