feat(report): decouple the feature distributions from the PCA and regroup the sections - #48
Merged
Merged
Conversation
…roup the sections Every curated feature now gets a violin panel, placed in the section its block belongs to, instead of the union of the top-10 |loading| on PC1/PC2 choosing which distributions the reader is shown.
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.
Replaces the PCA-selected violin panels with a per-feature distribution for every curated feature, placed in the report section its metric belongs to, and regroups the surrounding sections so nothing is shown twice.
Summary
|loading|on PC1 and PC2, so the PCA decided which distributions the reader was shown. Because the logic for the PCA will change in future issues, this has been refactored.--pca_features, so a user whitelist does not silently lose its distributions.ggdist).Transcripts_in_cellis the FL sum andIsoforms_in_cellis the distinct-model count, so the two names already read correctly as a pair. Unique junction chains keep their full name, which is part of the established term.Details
Panel titles come from the curated registry label rather than from the column name.
Registry block names became constants shared by the registry and the report layout. The layout decides which blocks still need a section by name, so a literal string in both places would let a rename silently duplicate or drop a whole section of figures.
Fixes three per-unit rates rendering as percentages.
infer_feature_metadata()promotes any count-like feature whose maximum is at most 1.5 to a percentage and multiplies it by 100, and genes-per-read, UJCs-per-read and isoforms-per-transcript are ratios bounded by 1 by construction, so all three drew on a 0–100 axis labelled "Genes, %" / "Reads, %" / "Transcripts, %". The rate suffix is now detected and stripped before the domain rules run, so the numerator names the domain, and rates get their own unit so they are neither rescaled nor drawn on a log axis.Validated by regenerating the multisample report in both reads and isoforms modes and inspecting the rendered figures, including a run with a
--pca_featureswhitelist to exercise the fallback section. The per-sample report was run directly in both modes as well, since the multisample regeneration does not exercise it — that check caught a rename that would have silently orphaned the JavaScript selector hiding a mode-specific tab, which is keyed on the section heading's generated anchor.