YuLab-SMU / clusterProfiler

:bar_chart: A universal enrichment tool for interpreting omics data
https://yulab-smu.top/biomedical-knowledge-mining-book/
1.02k stars 256 forks source link

gsePathway geneList input #333

Closed Jcerra7 closed 2 years ago

Jcerra7 commented 3 years ago

Hello! I am trying to run a Pathway GSEA, but have been facing issues with the correct formatting of the geneList argument. Through the Biomedical Knowledge Mining using GOSemSim and clusterProfiler page I have followed the code below from section 9.3 to recreate the example. This genelist dataset has gene names and p scores and upon running the following code I get the error output:

data("geneList")

Pathway GSEA

y <- gsePathway(geneList, pvalueCutoff = 0.2, pAdjustMethod = "BH", verbose = FALSE)

Error in GSEA_internal(geneList = geneList, exponent = exponent, minGSSize = minGSSize, : geneList should be a decreasing sorted vector...

I have tried using geneList <- sort(geneList, decreasing = TRUE) before running the above code but get this error:

Error in check_gene_id(geneList, geneSets) : --> No gene can be mapped....

Any information regarding the proper formatting of this aspect of the geneList argument would be great. Thanks in advance.

huerqiang commented 3 years ago

You may have used geneList data from other packages, please try

data(geneList, package = "DOSE")
#Pathway GSEA
library(ReactomePA)
y <- gsePathway(geneList,
pvalueCutoff = 0.2,
pAdjustMethod = "BH",
verbose = FALSE)
Jcerra7 commented 3 years ago

Yes! Thank you. Code is functioning now.