Hi,
I have a similar issue as in the original question: RNAseq data where a sample has a lot of very significant changes (around 10,000 genes) that I analysed with GSEA only to get hundreds of gene sets significantly enriched. However, I have the feeling most of them are just redundant as names are very similar and they often share a large number of genes. So here I am, looking for a way to trim redundant gene sets.
I tried your script but unfortunately I can't seem to make it work. I'm still quite a beginner with R so please bear with me. When I try to run the script as it is (i.e. using the example files in the fgsea package) I get the following error:
> elimRes <- eliminatePathways(universe=names(exampleRanks),
+ pathways=examplePathways,
+ pathway2name=pathway2name,
+ isNonRandomPval=fgseaIsNonRandomPval(examplePathways, exampleRanks, nperm=5000))
Testing pathway '5990980_Cell_Cycle'
Testing pathway '5990979_Cell_Cycle,_Mitotic'
Error in colnamesInt(x, neworder, check_dups = TRUE) :
argument specifying columns specify non existing column(s): cols[1]='pathway'
I have searched and looked everywhere and tried a few things but don't understand where the issue is. Would you be able to help?
Also I have tried to run the script with my own .rnk and .gmt files. In that case I get an error already at the GSEA results:
> fgseaRes <- fgsea(pathways = examplePathways,
+ stats = exampleRanks,
+ minSize=15,
+ maxSize=500,
+ nperm=10000)
Error in `[.data.frame`(x, order(x, na.last = na.last, decreasing = decreasing)) :
undefined columns selected
In addition: Warning message:
In fgsea(pathways = examplePathways, stats = exampleRanks, minSize = 15, :
There are ties in the preranked stats (50% of the list).
The order of those tied genes will be arbitrary, which may produce unexpected results.
Any suggestions for a way around this?
Thanks
I am not sure for GSEA results...
But for GO enrichment analysis with goseq, I usually remove the too specific and too general terms for plots. I have written a R package called gogadget (gogadget: an R package for go analysis visualization and interpretation ), with a filter function.
But there are more tools available such as REVIGO or GO trimming.
Good luck!