Question: Error in GSEA function of clusterProfiler on R
0
gravatar for j.thomas93
5 months ago by
j.thomas930
j.thomas930 wrote:

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
df = read.csv("expression_set_full-gsea.csv", header=TRUE)

# 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, 
             pAdjustMethod = "none")

But i keep getting the following error:

preparing geneSet collections...
GSEA analysis...
leading edge analysis...
done...
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘species’ for signature ‘"character"’
In addition: Warning messages:
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) :
  'package:stats' may not be available when loading

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.

Thanks in advance!

rna-seq rstudio gsea R • 705 views
ADD COMMENTlink modified 5 months ago by jared.andrews078.0k • written 5 months ago by j.thomas930
2
gravatar for jared.andrews07
5 months ago by
jared.andrews078.0k
Memphis, TN
jared.andrews078.0k wrote:

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".

ADD COMMENTlink written 5 months ago by jared.andrews078.0k

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

Thanks for your help!

ADD REPLYlink written 5 months ago by j.thomas930
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1854 users visited in the last hour