Error in GSEA function of clusterProfiler on R
1
0
Entering edit mode
2.0 years ago
j.thomas93 • 0

I am trying to run GSEA on RStudio using this:

library(clusterProfiler)
library(enrichplot)

# SET THE DESIRED ORGANISM HERE
organism = "org.Hs.eg.db"
library(organism, character.only = TRUE)

# reading in data from deseq2

# we want the log2 fold change
original_gene_list <- df$logFC # name the vector names(original_gene_list) <- df$X

# omit any NA values
gene_list<-na.omit(original_gene_list)
write.csv(df, file ="dfff.csv")

# sort the list in decreasing order (required for clusterProfiler)
gene_list = sort(gene_list, decreasing = TRUE)
gse <- gseGO(geneList=gene_list,
ont ="ALL",
keyType = "ENSEMBL",
nPerm = 10000,
minGSSize = 3,
maxGSSize = 800,
pvalueCutoff = 0.05,
verbose = TRUE,
OrgDb = organism,


But i keep getting the following error:

preparing geneSet collections...
GSEA analysis...
done...
Error in (function (classes, fdef, mtable)  :
unable to find an inherited method for function ‘species’ for signature ‘"character"’
1: In .GSEA(geneList = geneList, exponent = exponent, minGSSize = minGSSize,  :
We do not recommend using nPerm parameter incurrent and future releases
2: In fgsea(pathways = geneSets, stats = geneList, nperm = nPerm, minSize = minGSSize,  :
You are trying to run fgseaSimple. It is recommended to use fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument in the fgsea function call.
3: In serialize(data, node$con) : 'package:stats' may not be available when loading 4: In serialize(data, node$con) :


Any idea what is happening here and how can I fix it. The "In addition" warnings are non fatal, but the error before obviously stops the function.

RNA-Seq GSEA R rstudio • 4.7k views
2
Entering edit mode
2.0 years ago

You aren't passing the OrgDb parameter properly. It has to be an actual OrgDb object, rather than the string associated with it. So that parameter should be OrgDb = org.Hs.eg.db rather than a character variable for "org.Hs.eg.db".

0
Entering edit mode

Yup! Of course, I wws bashing my head against a wall for hours with that!

0
Entering edit mode

I'd like to use the clusterProfiler function in a pipeline. Is it possible to enter the orgdb as a variable?

0
Entering edit mode

Sure. xx <- org.Hs.eg.db. If you're asking how to evaluate a string as an expression or whatever, see this stackoverflow question for options.