How to get real cell names from Seurat Object?
1
0
Entering edit mode
3.8 years ago
leranwangcs ▴ 150

Hi,

I'm trying to extract cell names from my seurat object. I tried

colnames(BAAK_B@assays$RNA@data)

But all I got was:

"AATGAAGAGAGCCGTA-1" "ACTATGGGTTGACGGA-1" "ACTGTCCAGGAAGTCC-1" "AGATCGTCACTTGTCC-1" "AGCGTATAGTCTTGGT-1" "AGCGTATCACTCTAGA-1" "AGCTACAGTCCAGCAC-1" "AGCTTCCGTGGCAGAT-1" "AGCTTCCTCAAGTCTG-1" "AGGACTTGTTATTCTC-1"

I wondered if this is what seurat supposed to generate? Or is there any way to get some real cell names? Such as "tuft" cell?

Thanks very much!

rna-seq • 6.2k views
ADD COMMENT
3
Entering edit mode
3.8 years ago

Do you mean cell type, rather than cell name? Seurat doesn't automatically annotate your cells with the cell type. You can do that through manual intervention with the RenameIdents function, or you can get the SingleR package from bioconductor to "guess" it for you. you can get the current identity with the Idents function.

ADD COMMENT
0
Entering edit mode

Thanks for the reply! I was confused because in a seurat tutorial, it says there was a column called cellType which looks like this:

##            nGene  nUMI    orig.ident  celltypes nCount_RNA nFeature_RNA
## X7873M.1    3563 11796 SeuratProject Macrophage      11796         3563
## X7873M.104  2670  7570 SeuratProject Macrophage       7570         2670
## X7873M.105  2241  5510 SeuratProject Macrophage       5510         2241
## X7873M.106  4705 22636 SeuratProject        CAF      22636         4705
## X7873M.110  3169 11690 SeuratProject Macrophage      11690         3169
## X7873M.114  4659 20798 SeuratProject Macrophage      20798         4659

and if you run:

sort(table(ovarian@meta.data$celltypes))

the output should be something like this:

##  Naive CD4 T Memory CD4 T   CD14+ Mono            B        CD8 T 
##          697          483          480          344          271 
## FCGR3A+ Mono           NK           DC     Platelet 
##          162          155           32           14

However, I don't have the "cellType" column contained in the meta.data slot:

                                               orig.ident.  nCount_RNA nFeature_RNA
AATGAAGAGAGCCGTA-1     BAAK_B       1573          743
ACTATGGGTTGACGGA-1     BAAK_B       5883         2049
ACTGTCCAGGAAGTCC-1     BAAK_B      14083         2945
AGATCGTCACTTGTCC-1     BAAK_B       6661         2211
AGCGTATAGTCTTGGT-1     BAAK_B        520          285

And if I do Idents(BAAK_B) I got something like this:

AATGAAGAGAGCCGTA-1 ACTATGGGTTGACGGA-1 ACTGTCCAGGAAGTCC-1 AGATCGTCACTTGTCC-1 
            BAAK_B                          BAAK_B                                 BAAK_B                              BAAK_B    
AGCTACAGTCCAGCAC-1 AGCTTCCGTGGCAGAT-1 AGCTTCCTCAAGTCTG-1 AGGACTTGTTATTCTC-1 
            BAAK_B                                   BAAK_B                           BAAK_B                           BAAK_B

And if I use "RenameIdents", I need a list of cell names to assign to the new.ident.name parameter, but could that be done only if I have known which cell type should be assigned to which?

I can try SingleR, but I'm curious if this is a must step to get cell type, why not seen in most of the tutorial? I'm worried if I missed anything so that the cellType column is missing?

Thank you!!

ADD REPLY
1
Entering edit mode

In the tutorials the cell types were defined previously by a researcher, and are not generated automatically. You need to manually label your clusters/cell types, or use a program like singleR (which was stated above) to infer cell types.

ADD REPLY
0
Entering edit mode

Thanks very much for your help!!

ADD REPLY

Login before adding your answer.

Traffic: 1405 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6