satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.29k stars 912 forks source link

Rename Ensembl id to Gene Name #7460

Closed ryf0810 closed 1 year ago

ryf0810 commented 1 year ago

Hi Author,

I downloaded two Seurat objects from the online resources, where the RNA assay only contains feature in ensembl id format. I get the corresponding gene names using getBM() function from biomaRt library. However when I tried to replace the ensembl

gene.fetal <- getBM( attributes = c('ensembl_gene_id', 'external_gene_name'), filters = 'ensembl_gene_id', values = rownames(fetal.kidney), mart = ensembl.con ) dict <- setNames(gene.fetal$external_gene_name, gene.fetal$ensembl_gene_id) gene.names.fetal <- unname(dict[rownames(fetal.kidney)]) rownames(fetal.kidney) <- gene.names.fetal

Then, Warning: Renaming features in v3/v4 assays is not supported, this Error popped up. Are there any way to map the gene names to replace ensembl id? Thank you!

Best!

ryf0810 commented 1 year ago

I have solved it by changing the layer data matrices row names. Sorry for bothering, I'll close this question! Best!

denvercal1234GitHub commented 2 months ago

Hi @ryf0810 - Could you specify the code you used? Like rownames(SeuratObj[[RNA]]$data < new_gene_names_vector?

samyuktha-suresh commented 2 months ago

Hello @ryf0810 , could you please share your code for the same? Thanks!