Skip to content

Variant page shows incorrect allele metadata for associated nucleotide measurements #651

@bencap

Description

@bencap

Summary

When a user selects an associated nucleotide measurement, the Variant Information section can display allele metadata from the parent route allele instead of the selected measurement’s allele. This creates an inconsistent state where displayed allele context does not match the active measurement.

Problem Statement

The page currently mixes two allele contexts:

  1. Route-level ClinGen allele metadata (name, genomic locations, ClinVar allele IDs).
  2. Selected measurement allele ID from the selected variant detail.

For associated nucleotide measurements, these can differ. As a result, the user can see a selected measurement tied to one ClinGen allele ID while the surrounding allele name and metadata correspond to another.

Expected Behavior

Selecting any measurement should update all allele-context fields to the selected measurement’s allele context:

  • ClinGen allele name
  • ClinGen allele ID
  • ClinVar allele IDs
  • Genomic location(s)
  • Variant page title text

Actual Behavior

For associated nucleotide selections, the page may continue showing parent route allele metadata while only the displayed ClinGen allele ID reflects the selected measurement, causing mismatched variant context.

Reproduction Steps

  1. Open a variant page for a ClinGen allele that has associated nucleotide measurements such as https://mavedb.org/variants/CA025230.
  2. Select an associated nucleotide measurement in the measurement switcher.
  3. Compare the selected measurement’s allele context with the Variant Information panel.
  4. Observe that allele name and related metadata may not match the selected measurement.

Root Cause

Allele metadata is fetched and derived from the route-level allele ID, while selected measurement context is derived from the selected variant detail. The UI renders both, but only one source is updated per selection.

Proposed Solution

Introduce selected-measurement allele metadata as the primary source for Variant Information and title rendering:

  1. Resolve effective allele ID from selected measurement first, with route allele as fallback.
  2. Fetch/cache ClinGen allele metadata by effective allele ID.
  3. Bind Variant Information props and page title to effective selected-allele metadata.
  4. Preserve fallback behavior when selected measurement metadata is unavailable.

Acceptance Criteria

  • Selecting an associated nucleotide measurement updates all allele metadata fields to the selected measurement’s allele.
  • No mixed-context state where allele ID and allele name/ClinVar/genomic location refer to different alleles.
  • Page title continues to reflect route level allele metadata when available.
  • Fallback to route-level allele metadata works if selected measurement metadata cannot be loaded.
  • Switching between measurement cards remains responsive and does not trigger redundant fetches.
  • Regression check passes for measurements where selected allele equals route allele.

Test Plan

  • Manual test with a dataset where associated nucleotide measurement allele differs from route allele.
  • Manual test with a dataset where alleles match (no behavior regression).
  • Switch among nucleotide, protein, and associated nucleotide measurements and verify consistent metadata updates.
  • Verify title and Variant Information remain consistent with the route level allele and selected measurement.

Metadata

Metadata

Assignees

Labels

app: frontendTask implementation touches the frontendtype: bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions