fix(VariantScreen): use mapped coordinate mode for histogram#674
Open
bencap wants to merge 1 commit into
Open
Conversation
The Variant view histogram fell back to raw-mode tooltip labels because three things lined up: the `coordinates` prop defaulted to `'raw'`, the variant cache only ran `parseScoresOrCounts` (so `parsedPostMappedHgvs*` and `translated_hgvs_p` were never populated), and the fetch omitted `include_post_mapped_hgvs` plus the `vep`/`clingen` namespaces — so even a mapped-mode tooltip would have had nothing to render. Pass `coordinates="mapped"` on VariantScreen and route the fetch + parse through the same pipeline ScoreSetView uses. Along the way, consolidate the variant-data plumbing that had drifted between the two screens: - Extract `histogramScoreSetVariantDataUrl` and a small params/URL builder in `api/mavedb/score-sets.ts`; ScoreSetView and the histogram fetch now share one definition of the endpoint and namespace set. - Add `parseScoreSetVariantData` in `lib/variants.ts` as the single entrypoint for the `parseScoresOrCounts` → `parseSimpleCodingVariants` → `translateSimpleCodingVariants` chain; the latter two are now internal. - Rename `getVariantScores` → `getHistogramVariantData` to reflect that it returns full variant rows, not just scores. - Type `useVariantLookup`'s `scores`/`variantScoreRow` as `Variant` instead of `ScoresOrCountsRow`, removing the `as any` cast at the histogram `:variants` binding. - Introduce `ParsedSimpleDnaVariation`/`ParsedSimpleProteinVariation` aliases so the `residueType`/`origin` fields added by `parseSimpleCodingVariants` are reflected in the type.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Variant view histogram fell back to raw-mode tooltip labels because three things lined up: the
coordinatesprop defaulted to'raw', the variant cache only ranparseScoresOrCounts(soparsedPostMappedHgvs*andtranslated_hgvs_pwere never populated), and the fetch omittedinclude_post_mapped_hgvsplus thevep/clingennamespaces — so even a mapped-mode tooltip would have had nothing to render. Passcoordinates="mapped"on VariantScreen and route the fetch + parse through the same pipeline ScoreSetView uses.Along the way, consolidate the variant-data plumbing that had drifted between the two screens:
histogramScoreSetVariantDataUrland a small params/URL builder inapi/mavedb/score-sets.ts; ScoreSetView and the histogram fetch now share one definition of the endpoint and namespace set.parseScoreSetVariantDatainlib/variants.tsas the single entrypoint for theparseScoresOrCounts→parseSimpleCodingVariants→translateSimpleCodingVariantschain; the latter two are now internal.getVariantScores→getHistogramVariantDatato reflect that it returns full variant rows, not just scores.useVariantLookup'sscores/variantScoreRowasVariantinstead ofScoresOrCountsRow, removing theas anycast at the histogram:variantsbinding.ParsedSimpleDnaVariation/ParsedSimpleProteinVariationaliases so theresidueType/originfields added byparseSimpleCodingVariantsare reflected in the type.