fix(report): correct per-cell exon-count percentages and drop dead bins figure - #38
Merged
Merged
Conversation
…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.
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 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.
perc = 100 * n / sum(n)(elementwise recycling of the scalardenominator); dropped the dead divide-by-zero guard, since
cls_validfilters
count > 0upstream so a grouped cell always has a positive total.anywhere in the report.
Verified: reads + isoforms full-pipeline tests run clean and
the reports build.