Hello,
I am having an error when I try to use clusterprofiler enricher feature for MsigDB analysis of a list of genes. I have been following the code here: https://yulab-smu.github.io/clusterProfiler-book/chapter3.html#msigdb-analysis
Below the code I have used to generate the geneList.
geneListdf <- datadclustergenesannoordered[,c(12,3,4)] head(geneList_df)
entrezgene Expression D_cluster 2 <na> -0.14884273 A 3 <na> -0.15661623 A 4 <na> -1.05130066 A 5 <na> 0.44873763 A 6 <na> -0.21960779 A 7 <na> -0.03056169 A
Then, I create the geneList as per the tutorial:
geneList <- geneListdf[,2] names(geneList) <- as.character(geneListdf[,1]) geneList <- sort(geneList, decreasing = TRUE) head(geneList)
<NA> <NA> 100422993 100033799 <NA> 100033799
5.017799 5.011760 4.381810 4.332800 3.822049 3.799207
I then defined the threshold for expression change:
gene <- names(geneList)[abs(geneList) > 1.2] head(gene)
[1] NA NA "100422993" "100033799" NA "100033799"
At this point, I jumped to section 3.2.2 MSigDb analysis and follow the tutorial to retrieve the h.sapiens gene sets:
mdf <- msigdbr(species = "Homo sapiens") head(mdf, 2) %>% as.data.frame
And created an object for the Hallmark Dataset as indicated below:
mt2g <- msigdbr(species = "Homo sapiens", category = "H") %>% dplyr::select(gsname, entrezgene) head(mt2g)
A tibble: 6 x 2
gsname entrezgene <chr> <int> 1 HALLMARKADIPOGENESIS 19 2 HALLMARKADIPOGENESIS 11194 3 HALLMARKADIPOGENESIS 10449 4 HALLMARKADIPOGENESIS 33 5 HALLMARKADIPOGENESIS 34 6 HALLMARKADIPOGENESIS 35
At this point I run the enricher function and get the following error:
em <- enricher(gene, TERM2GENE=m_t2g) --> No gene can be mapped.... --> Expected input gene ID: 5010,914,1956,350,43,3002 --> return NULL...
I have also tried removing the NAs from my geneList with the same result. I am failing to understand what I am doing wrong here and would greatly appreciate guidance.
Cheers.