You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've occasionally seen users get confused when they do something like Idents(foo) <- "bar", expecting the Idents of foo to take the value of a column bar that doesn't exist in the metadata. I believe it would help users if this were called out.
Here is my idea:
obj<-pbmc_small
levels(obj)
## [1] "0" "1" "2"
Idents(obj) <-"group"## Warning: 'group' not found in this object's metadata. All Idents are now the string 'group'.## Set the Idents to `I('group')` to bypass this warning.
levels(obj)
## [1] "group"
colnames(obj[[]])
## [1] "orig.ident" "nCount_RNA" "nFeature_RNA" "RNA_snn_res.0.8" "letter.idents" "groups" ## [7] "RNA_snn_res.1"
Idents(obj) <-"groups"
levels(obj)
## [1] "g2" "g1"
Idents(obj) <- I("group")
levels(obj)
## [1] "group"
Would this be welcome as a PR?
The text was updated successfully, but these errors were encountered:
I've occasionally seen users get confused when they do something like
Idents(foo) <- "bar"
, expecting the Idents offoo
to take the value of a columnbar
that doesn't exist in the metadata. I believe it would help users if this were called out.Here is my idea:
Would this be welcome as a PR?
The text was updated successfully, but these errors were encountered: