feat(plotting): add min_cells to DotPlot to drop sparse groupby categories - #4363
Open
micheleoliveiracod wants to merge 2 commits into
Open
micheleoliveiracod wants to merge 2 commits into
micheleoliveiracod wants to merge 2 commits into
Conversation
…egories Add a `min_cells` parameter to `BasePlot`, `DotPlot`, and `pl.dotplot` that drops `groupby` categories with fewer than the given number of cells before plotting. Categories are silently removed (with unused categories cleaned up on the index), and a `ValueError` is raised if no category meets the threshold. `categories_order`, when given, is filtered to match. Add tests covering the new parameter and its edge cases. Co-Authored-By: Michele Oliveira <data.analystmlso@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4363 +/- ##
=========================================
+ Coverage 0 81.94% +81.94%
=========================================
Files 0 134 +134
Lines 0 13038 +13038
=========================================
+ Hits 0 10684 +10684
- Misses 0 2354 +2354
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Adds a
min_cellsparameter toBasePlot,DotPlot, andpl.dotplotthatdrops
groupbycategories with fewer than the given number of cells beforeplotting. This avoids showing summary statistics (fraction of nonzero
expressors, mean expression) for sparsely populated groups, which are not
very robust.
Matching categories are silently removed (unused categories are cleaned up
on the index), a
ValueErroris raised if no category meets the threshold,and
categories_order(when given) is filtered to match.docs/release-notes/4363.feat.md)