fix(report): FL-weight length metrics from the cell summary and fix category-violin scale - #39
Merged
Conversation
…ategory-violin scale Multisample-report fixes, all around isoforms-mode FL weighting and length figures: (a) Median-length summary table. The table's median disagreed with the per-cell median-length violin. Isoforms mode did as.integer(FL) on a comma-separated field (NA -> fell back to FL=1, an unweighted transcript-model median); reads mode took a pooled median over all reads from the classification file (a different statistic than the violin). Both modes now compute median(Median_length_per_cell) from the cell summary, the same source as the violin, so table and violin agree. Completes the "read per-cell metrics from the cell summary" migration for this metric. (b) Structural-category proportion violin. geom_violin() lacked scale = "width", so distributions concentrated near 100% rendered as very thin, almost invisible lines. Added scale = "width" to match every other violin in the file. (c) Median-length violin y-axis. The log axis showed only 2-3 default ticks over the narrow per-cell median range. Added adaptive log breaks (scales::breaks_log(n = 8)) via a new optional y_breaks argument to build_sample_comparison_plot. (d) Bulk length distribution — now truly FL-weighted. It was never actually weighted: the code intended to weight by FL but hit the same as.integer(FL) bug on the comma-separated field, silently falling back to unweighted. It now sums the comma-separated FL to a per-model total and weights the violin, boxplot (precomputed weighted quartiles via stat = "identity"), and mean point — without a rep() row-explosion. Reads mode is unchanged (each read is one observation).
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.
Multisample-report fixes, centred on isoforms-mode FL weighting and the length
figures.
Isoforms mode did
as.integer(FL)on comma-separated FL (NA -> fallback to 1);reads mode took a pooled median over all reads. Both now use
median(Median_length_per_cell)from the cell summary — the same source as theviolin — so they agree. The classification-file read and its
rep()FLrow-explosion are removed.
scale = "width", sodistributions near 100% (e.g. FSM) rendered as invisible needles. Added it.
median range; added adaptive log breaks (
scales::breaks_log(n = 8)) via a newoptional
y_breaksarg tobuild_sample_comparison_plot.intended weighting hit the same
as.integer(FL)bug and silently fell back tounweighted. It now sums comma-separated FL to a per-model total and weights the
violin, boxplot (weighted quartiles via
stat = "identity") and mean point,with no
rep()row-explosion. Reads mode unchanged.