Hi there, I got a list of DEG from my scRNAseq from mouse.I would like to run some analysis using ClusterProfiler. However, I'm facing a problem that I'm unable to convert the ENSEMBL gene names to ENTREZ ID. Can you please help me with that? Below all information about the code and Error I'm getting.
Code should be placed in three backticks as shown below
> library("AnnotationDbi")
>library("org.Mm.eg.db")
>sigs.df<- as.data.frame (df3)
>sigs.df
X Gene pvalue log2FoldChange pct.1 pct.2 padj
1 ENSMUSG00000021270 Hsp90aa1 1.02894e-16 -1.0737909 0.524 0.832 3.19518e-12
2 ENSMUSG00000041859 Mcm3 1.34494e-14 -0.9469918 0.113 0.436 4.17644e-10
3 ENSMUSG00000041133 Smc1a 1.80664e-14 -0.7971461 0.262 0.621 5.61017e-10
4 ENSMUSG00000009575 Cbx5 3.55868e-14 -0.6508072 0.226 0.572 1.10508e-09
5 ENSMUSG00000022391 Rangap1 6.29202e-14 -0.7469614 0.107 0.415 1.95386e-09
6 ENSMUSG00000029623 Pdap1 2.24799e-13 -0.4088167 0.149 0.438 6.98068e-09
7 ENSMUSG00000029730 Mcm7 2.25639e-13 -0.3725229 0.161 0.448 7.00678e-09
8 ENSMUSG00000027715 Ccna2 4.19436e-13 -0.3656079 0.137 0.418 1.30248e-08
9 ENSMUSG00000028312 Smc2 4.55697e-13 -0.4142646 0.244 0.554 1.41508e-08
10 ENSMUSG00000032026 Rexo2 5.96883e-13 -0.6615188 0.060 0.325 1.85350e-08
> sigs.df$entrez <-mapIds(org.Mm.eg.db, keys = rownames(sigs.df), keytype="ENSEMBL", column = "ENTREZID")
Result from R:
sigs.df$entrez <-mapIds(org.Mm.eg.db, keys = rownames(sigs.df), keytype="ENSEMBL", column = "ENTREZID") Error in .testForValidKeys(x, keys, keytype, fks) : None of the keys entered are valid keys for 'ENSEMBL'. Please use the keys method to see a listing of valid arguments.
sessionInfo( )
```
THanks a lot for your help
Hi Guido,
many thanks for that. It has successfully solved the problem here. Thanks Best Marta