How to add Ensembl id to cluster.markers in Seurat
1
1
Entering edit mode
2.1 years 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.2k views
ADD COMMENT
2
Entering edit mode
2.1 years ago
fracarb8 ★ 1.7k
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: 1490 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