When I was performing my analysis with GSEA, I noticed that the p-value changed (by ~0.005) when I changed the order of genes in my gene set. I know that the order of genes in the gene set doesn't matter but does anyone have any idea about the reason to the fluctuation of p-value?
Why are my results different from yours when I analyze the example
datasets using GSEA?
You are using a different random number generator (for sample permutation) and different seeds for that random number generator, so the resulting numbers are different. However, these differences should be VERY SMALL and the IDENTITY of the top (up or down) gene sets should be pretty much the same. The FDRs might be at most a few percent different from run to run. To get exactly the same result from run to run, specify the random number seed (its a parameter in the gsea software).
Just a clarification: the p-values did not change because of the order of genes, but because of a different random number seed. Try running the same analysis on the same set without changing the order, and the p-values will be different again.
Just a clarification: the p-values did not change because of the order of genes, but because of a different random number seed. Try running the same analysis on the same set without changing the order, and the p-values will be different again.
Moderator note: I've moved this from a comment to a reply, so it can be voted as a proper answer.
Got it! The random number seed was set as default instead of a specific integer. Thank you!