We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to rename my clusters in a Seurat object.
Seurat
my old cluster IDs are numers
Idents(seuObj) <- 'RNA_snn_res.0.1' levels(seuObj) [1] "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15"
I would like to assign the clusters names from a named vector
Following the vignette from the web site I tried to assign the vector to the numbers -
cluster_ids <- c("DC2_genes", "mregDC_genes", "mregDC_genes", "Bcell_genes",...) names(cluster_ids) <- levels(seuObj) seuObj <- RenameIdents(seuObj, cluster_ids)
But this just assigns numbers to the new Idents
Idents
head(Idents(seuObj)) C7_AAACCCAAGGGTGGGA-1 C7_AAACCCAAGTAGCATA-1 C7_AAACCCACAAGAGGTC-1 C7_AAACCCACAGTCTCTC-1 C7_AAACCCACATGAATCC-1 0.346464052287582 0.177389184397163 0.132815134099617 0.300105882352941 0.497196167423096 C7_AAACCCAGTAGAGGAA-1 0.335241176470588
What am I doing wrong here?
The text was updated successfully, but these errors were encountered:
I manage to find a workwround, but I don't understand what I did wrong here.
my solution was to extract the cluster column as vector and assign the new names to it. Then I created a new column in my seurat obj.
vec <- seuObj $RNA_snn_res.0.1 levels(vec) <- cluster_ids seuObj[["UCell_clusters"]] <- vec Idents(seuObj) <- 'UCell_clusters'
Sorry, something went wrong.
Hi,
Glad you were able to find a workaround. I couldn't reproduce this myself, would you be able to provide a reproducible example to get this issue?
Idents(pbmc_small) <- 'RNA_snn_res.0.8' levels(pbmc_small) cluster_ids <- c("DC2_genes", "mregDC_genes") names(cluster_ids) <- levels(pbmc_small) pbmc_small <- RenameIdents(pbmc_small, cluster_ids)
head(Idents(pbmc_small)) ATGCCAGAACGACT CATGGCCTGTGCAT GAACCTGATGAACC TGACTGGATTCTCA AGTCAGACTGCACA TCTGATACACGTGT DC2_genes DC2_genes mregDC_genes DC2_genes DC2_genes DC2_genes Levels: DC2_genes mregDC_genes
No branches or pull requests
I'm trying to rename my clusters in a
Seurat
object.my old cluster IDs are numers
I would like to assign the clusters names from a named vector
Following the vignette from the web site I tried to assign the vector to the numbers -
But this just assigns numbers to the new
Idents
What am I doing wrong here?
The text was updated successfully, but these errors were encountered: