Repository navigation
Say which cell names a rename would repeat - #314
Closed
BenjaminDEMAILLE wants to merge 1 commit into
Closed
BenjaminDEMAILLE wants to merge 1 commit into
BenjaminDEMAILLE wants to merge 1 commit into
Conversation
Renaming to names that are not unique leaves the frames being renamed with
duplicate row names:
> RenameCells(object, new.names = rep("dup", ncol(object)))
Error in `.rowNamesDF<-`(x, value = value):
duplicate 'row.names' are not allowed
The message names neither the cells nor the renaming, and it comes from far
enough inside that the traceback is no help either.
Check the mapping before applying it:
Renaming would give the same name to more than one cell. 1 name is
repeated: 'dup'
Fixes satijalab#256.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Sep 1, 2026
Author
|
Superseded by #319, which groups the message-only PRs into one, since they share a rationale and none of them changes behaviour. 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.
Fixes #256.
The mapping is applied to the meta data, the identities and every assay in turn, so the failure comes from whichever frame is renamed first. The message names neither the cells nor the renaming, and the traceback lands in
.rowNamesDF<-, which is why that issue reads as a mystery.Checking the mapping before applying it:
Cell names have to be unique, so this was never going to succeed; it just says so now, and names what to fix.
The other half of that issue
The reporter also hits it through
RunAzimuth(), with a different message (missing values in 'row.names' are not allowed) and a different cause: an SCT model naming cells the assay no longer has. That one is satijalab/seurat#10481, since the code is in Seurat. It also explains why passingmake.unique(Cells(object))did not help them: uniqueness was not the problem in that path.Tests
tests/testthat/test_rename_duplicates.R: every cell renamed to one name, a single collision named exactly, and unique names plusadd.cell.idstill renaming.Three assertions fail without the change. SeuratObject suite: 182 passing, 0 failures. Seurat's own suite against this build: 1184 passing, the only 2 failures being ones that predate it and are unrelated (
Read10X_Image, satijalab/seurat#10454).🤖 Generated with Claude Code