How to add Ensembl id to cluster.markers in Seurat
1
0
Entering edit mode
22 months ago

Hello, could someone help me with this question? Thanks so much in advance. When I run Seurat for RNA-seq data, there is a step to find all markers of a cluster, lets say cluster 2. The code is "cluster2.markers <- FindMarkers(pbmc10k, ident.1 = 2, min.pct = 0.25). After run, I can get a data list that consists of columns of gene symbol, ave_Log2FC, pct.1, pct.2 and p_val_adj. I want to have this data list with Ensembl ID for each gene symbol. How to add a code to have Ensembl ID included? Thanks for the help.

id Ensembl • 1.1k views
ADD COMMENT
0
Entering edit mode
22 months ago
fracarb8 ★ 1.6k
library(org.Hs.eg.db)
mapped_genes <- data.frame(GeneName = rownames(cluster2.markers),
           ensemblID = mapIds(org.Hs.eg.db, keys =rownames(cluster2.markers), keytype = "SYMBOL", column="ENSEMBL"))
cluster2.markers$ensemblID <- mapped_genes$ensemblID
ADD COMMENT
0
Entering edit mode

works great. Thank you so much.

ADD REPLY

Login before adding your answer.

Traffic: 2350 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