Skip to content

Show mutational consequence histogram when only a subset of variants have consequence data #672

@bencap

Description

@bencap

Summary

The histogram's "Protein Effect Series" is currently hidden for any score set where at least one variant lacks a determinable protein consequence. This all-or-nothing gate prevents the histogram from being used for score sets with a mix of coding and intronic/unmappable variants (e.g. BAP1 SGE), even when the vast majority of variants have consequence data.

Problem

In ui/src/lib/variants.ts, the function allCodingVariantsHaveProteinConsequence returns true only if every variant in the set satisfies one of:

  • Has a non-NA vep_functional_consequence
  • Has a parseable parsedPostMappedHgvsP (protein HGVS)
  • Has a cDNA HGVS with a non-integer position (known non-coding)

In ScoreSetHistogram.vue, the computed property proteinEffectOptionsAvailable gates both the "Protein Effect Series Options" UI panel and the filterControlVariantByEffect logic entirely on this function. The result: a single unmapped or intronic variant suppresses the entire consequence-based histogram view for all other variants.

Proposed behavior

The histogram should display consequence-based series as long as a meaningful portion of variants have consequence data, with a disclaimer noting how many variants are excluded.

Specific changes:

  1. Relax the gate: Replace the all-or-nothing allCodingVariantsHaveProteinConsequence check with a threshold-based check (e.g. show the histogram if ≥ N% of coding variants have consequence data, or unconditionally show it and handle missing data as an "Unknown/No consequence" series or by exclusion).
  2. Add a disclaimer: When some variants are excluded from the consequence histogram due to missing data, display a note such as: "N variants are not shown in this view because consequence data is unavailable." This should appear near the Protein Effect series controls or in the figure legend.
  3. Treat intronic variants explicitly: Once Mark intronic variants with a dedicated consequence instead of raising a mapping error dcd_mapping2#99 is resolved, variants with vep_functional_consequence = "intron_variant" should be treated as a known, displayable category rather than as missing data.

Acceptance criteria

  • The "Protein Effect Series" histogram controls are shown for score sets where at least some (but not all) variants have consequence data
  • Variants without consequence data are excluded from the consequence-based series (not counted in any series bar)
  • A disclaimer is shown adjacent to the histogram indicating how many variants are excluded from the consequence view
  • Score sets where no variants have any consequence data continue to hide the consequence series entirely
  • Existing score sets where all variants have consequence data continue to work identically

Implementation notes

  • The change is primarily in ui/src/lib/variants.ts (allCodingVariantsHaveProteinConsequence) and ui/src/components/score-set/ScoreSetHistogram.vue (proteinEffectOptionsAvailable computed property and the surrounding UI template)
  • Consider adding a companion computed property like variantsWithoutConsequenceCount to feed the disclaimer text
  • The threshold for "enough variants have consequence data" should be discussed — a reasonable starting point is: show the histogram if any variant has consequence data, and always note the exclusion count
  • This issue is related to the intronic variant marking issue; resolving that first will make the consequence data more complete and reduce the number of excluded variants

Metadata

Metadata

Assignees

No one assigned

    Labels

    app: frontendTask implementation touches the frontendtype: enhancementEnhancement to an existing feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions