Question: Rename Idents in Seurat Object
gravatar for Thorerges
6 months ago by
Thorerges10 wrote:

I have a seurat object that looks as such:

> object
An object of class Seurat  15780 features across 6272 samples within 1 assay  Active assay: RNA (15780 features)  2 dimensional
    > reductions calculated: pca, umap

Identities based on the clustering I've done look as such:

> head(uc@active.ident)
                     0                      0                      0                      0                      0 
Levels: 0 1 2 3 4

How do I assign barcodes based on pre-determined clusters in seurat V3? I already know which barcodes belong to which cluster.

Any help is appreciated!

rna-seq • 1.2k views
ADD COMMENTlink written 6 months ago by Thorerges10

You mean, you want to assign some categorical value to each cell that you already know belongs to a particular class? You can simply edit the field. To access, do this: This will give you a table. The row of the table are all cells, you can get their sequence from, row.names( Now, if your category is A, B and C, with X, Y and Z cells (let suppose in sequence) then make a character vector: New_idents <- rep(c("A","B","C), times =c("X,Y,Z)). Then assign this to as :$"Newcluster" <- as.factor(New_idents).

If they are not in sequence, you would have to do little more work, but in principle you can modulate To then plot this, just use"Newcluster" in DimPlot().

ADD REPLYlink written 6 months ago by piyushjo550
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1322 users visited in the last hour