Question: clusterProfiler GSEA function set seed
0
gravatar for mthuang.nj
8 months ago by
mthuang.nj0
mthuang.nj0 wrote:

Hi, everyone, I am using R clusterProfiler package to do GSEA analysis. Following is my code,

        GSEA_GO_BP <- GSEA(cor_sort, 
                exponent = 1, 
                nPerm = 1000, 
                minGSSize = 10, 
                maxGSSize = 500, 
                pvalueCutoff = 1, 
                pAdjustMethod = "BH",
                seed=FALSE,
                TERM2GENE=GO_BP)

I got one question. No matter whether I set seed TRUE or FALSE, GSEA results always changed. I just can't get a reproducible result. Did i set seed in a wrong way? I also see someone else posted the same question, but still no answer.

Thanks in advance.

clusterprofiler R • 435 views
ADD COMMENTlink modified 4 months ago by brivero0 • written 8 months ago by mthuang.nj0

Have you been able solve it? I am having the same issue, and I think it's really important. Every time I run it GSEA using GO and cluster profiler, it give me a different set of enrichment. Please let me know if you figured it out. That will be a great help! Thank you!

ADD REPLYlink written 7 months ago by urjaswita90

Sorry, I still don't know how to figure it out.

ADD REPLYlink written 7 months ago by mthuang.nj0
0
gravatar for brivero
4 months ago by
brivero0
brivero0 wrote:

hey! I had the same issue and I fixed it by adding set.seed(1234) before the function, and then seed = T within the function. You should get the same results now.

set.seed(1234)
GSEA_GO_BP <- GSEA(cor_sort, 
                exponent = 1, 
                nPerm = 1000, 
                minGSSize = 10, 
                maxGSSize = 500, 
                pvalueCutoff = 1, 
                pAdjustMethod = "BH",
                seed=TRUE,
                TERM2GENE=GO_BP)
ADD COMMENTlink modified 4 months ago by Friederike5.2k • written 4 months ago by brivero0

If this doesn't solve the issue, I strongly recommend to alert the author of the package directly. Actually, I suspect it's a problem with the fgsea algorithm, according to this issue, the solution proposed by brivero should hold up.

ADD REPLYlink written 4 months ago by Friederike5.2k
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: 1774 users visited in the last hour