Repository navigation
Plot a repeated feature once, and say when cells have no identity - #10478
Closed
BenjaminDEMAILLE wants to merge 1 commit into
Closed
BenjaminDEMAILLE wants to merge 1 commit into
BenjaminDEMAILLE wants to merge 1 commit into
Conversation
Two ways DotPlot() fails on input it should handle. A feature named twice, which happens as soon as marker lists are combined, becomes a duplicated factor level: > DotPlot(object, features = c(markers, markers[1])) Error in `levels<-`: factor level [4] is duplicated The features are only there to fix the order of the axis, so take them unique. VlnPlot() already tolerates this. Cells with no identity come back from CellsByIdentities() as NA. Those NAs reach FetchData(), and the per-group frames then fail to bind: > DotPlot(object, features = markers) Error in `rbind`: duplicate 'row.names' are not allowed Drop them, and say how many were left out. Both the cell names and the identity column are filtered, so this holds whether or not the NA padding from CellsByIdentities() is fixed as well (satijalab/seurat-object#302). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Superseded by #10492, which groups five small independent fixes into one review. The commit is carried over unchanged; closing here to keep the queue down rather than because anything was wrong with it. |
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.
Two ways
DotPlot()fails on input it should handle. Both found by sweeping the plotting functions with degenerate but ordinary arguments;VlnPlot()andFeaturePlot()handle the same inputs.A feature named twice
From
The features are there only to fix the order of the axis, so they are taken unique. This happens as soon as marker lists are combined, and with a named list (the grouped dot plot) it is unavoidable when a gene marks two groups.
Cells with no identity
CellsByIdentities()returns a group forNA, padded withNAcell names, and those reachFetchData(). The per-group frames then fail to bind. Such cells are now dropped, withBoth the cell names and the identity column are filtered, so this holds whether or not the padding itself is fixed. With satijalab/seurat-object#302 (which fixes the padding) but without this change, the same call still fails, differently:
so the two are complementary rather than duplicates.
Tests
tests/testthat/test_dotplot_features_idents.R: a repeated feature plotted once, a feature repeated across named groups, cells with no identity warned about and excluded, and the ordinary case unchanged.Three assertions fail without the change. Full suite
NOT_CRAN=true: 1188 passing, the only 2 failures being the pre-existingRead10X_Imageones fixed in #10454.🤖 Generated with Claude Code