Skip to content

fix(report): correct per-cell exon-count percentages and drop dead bins figure - #38

Merged
CarlosBlancoGo merged 1 commit into
mainfrom
fix/exon-count-percentages
Jul 18, 2026
Merged

fix(report): correct per-cell exon-count percentages and drop dead bins figure#38
CarlosBlancoGo merged 1 commit into
mainfrom
fix/exon-count-percentages

Conversation

@CarlosBlancoGo

Copy link
Copy Markdown
Collaborator

The per-cell "Exon Count Profile" figure computed percentages with a
scalar condition inside ifelse(), which returned length-1 and got recycled
across every exon-count bin — collapsing each cell's distribution to a flat
value summing past 100%. Same root cause as the gene-bin bug fixed in #37,
different plot family. Pre-existing on main.

  • Fix: perc = 100 * n / sum(n) (elementwise recycling of the scalar
    denominator); dropped the dead divide-by-zero guard, since cls_valid
    filters count > 0 upstream so a grouped cell always has a positive total.
  • Removed the "Exon Count Bins" build block — assigned but never rendered
    anywhere in the report.

Verified: reads + isoforms full-pipeline tests run clean and
the reports build.

…ns figure

The per-cell exon-count profile computed its percentage with
ifelse(sum(n) > 0, 100 * n / sum(n), 0). ifelse() returns a result the
length of its condition; sum(n) is scalar within the group, so it returned
only the first bin's percentage and dplyr recycled it across every bin —
each cell's exon-count distribution collapsed to a flat value that summed
past 100%. Replaced with 100 * n / sum(n), which recycles the scalar
denominator elementwise. The divide-by-zero guard is unnecessary: cls_valid
already filters count > 0, so a grouped cell always has a positive total.

Also removed the "Exon Count Bins" build block: the plot was assigned but
never printed. It was dead code.
@CarlosBlancoGo
CarlosBlancoGo merged commit 029d49f into main Jul 18, 2026
2 checks passed
@CarlosBlancoGo
CarlosBlancoGo deleted the fix/exon-count-percentages branch July 18, 2026 19:02
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