Skip to content

fix(report): FL-weight length metrics from the cell summary and fix category-violin scale - #39

Merged
CarlosBlancoGo merged 1 commit into
mainfrom
fix/multisample-report-median-and-violin
Jul 19, 2026
Merged

fix(report): FL-weight length metrics from the cell summary and fix category-violin scale#39
CarlosBlancoGo merged 1 commit into
mainfrom
fix/multisample-report-median-and-violin

Conversation

@CarlosBlancoGo

Copy link
Copy Markdown
Collaborator

Multisample-report fixes, centred on isoforms-mode FL weighting and the length
figures.

  • Median-length summary table disagreed with the per-cell median-length violin.
    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 the
    violin — so they agree. The classification-file read and its rep() FL
    row-explosion are removed.
  • Structural-category proportion violin lacked scale = "width", so
    distributions near 100% (e.g. FSM) rendered as invisible needles. Added it.
  • Median-length violin y-axis showed only 2-3 ticks over the narrow per-cell
    median range; added adaptive log breaks (scales::breaks_log(n = 8)) via a new
    optional y_breaks arg to build_sample_comparison_plot.
  • Bulk length distribution is now actually FL-weighted. It never was: the
    intended weighting hit the same as.integer(FL) bug and silently fell back to
    unweighted. 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.

…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).
@CarlosBlancoGo
CarlosBlancoGo merged commit 2f1935f into main Jul 19, 2026
2 checks passed
@CarlosBlancoGo
CarlosBlancoGo deleted the fix/multisample-report-median-and-violin branch July 19, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant