Skip to content

Show clinical sequence counts as tooltip on Jaccard index column #1303

Description

@fhennig

Idea

When displaying the Jaccard index column in the mutations-over-time table (both computed and predefined variant modes), it would be helpful to show the underlying clinical sequence counts as a tooltip on each cell. This would let users judge whether a given Jaccard score is reliable or potentially noisy due to low sequence counts.

The three values we want to surface per mutation are:

  • Intersection count — sequences that match both the lineage and the mutation (the Jaccard numerator)
  • Total count — all sequences in the clinical data that have the mutation (regardless of lineage)
  • Variant count — total sequences for the lineage (the Jaccard denominator component)

All three are already fetched inside getJaccardForMutations and getMutationsForVariant in website/src/lapis/getMutations.ts — they're just thrown away after the ratio is computed.

Problem

The CustomColumn type from @genspectrum/dashboard-components only supports { header: string, values: Record<string, string | number> }. Cell rendering is handled entirely by the gs-mutations-over-time web component, so we have no React layer to attach a tooltip to.

Possible approaches

  1. Add tooltips field to CustomColumn in @genspectrum/dashboard-components — cleanest solution, requires a PR to that library.
  2. Add a second custom column showing the counts inline (e.g. "45 / 500" for intersection / total) — works today without library changes, but is less ergonomic.
  3. Gray out low-count Jaccard scores — a related idea: once the counts are exposed, visually de-emphasize Jaccard values backed by few sequences (e.g. dim or style the cell differently). Same blocker as above.

Related context

The data layer changes needed are straightforward and independent of the rendering problem:

  • Change getJaccardForMutations to return counts alongside the Jaccard map
  • Change getMutationsForVariant similarly
  • Expose counts in WasapMutationsData for downstream use

The JaccardFetchInfo box (added in this branch) already surfaces the total variant sequence count as a coarse reliability indicator — per-mutation counts would be a more precise complement to that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions