I had actually accidentally used ranks instead of Entrez gene ids (but switched later to human Ensembl gene ids). However, without your comment I would have never figured this out!
I'm trying to perform GSEA with the fgsea package in R:
fgseaRes<-fgsea(pathways=pathwaysH,stats=new_res_important)
However, I receive the error:
Warning message:
In preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, :
There are ties in the preranked stats (5.02% of the list).
The order of those tied genes will be arbitrary, which may produce unexpected results.
As suggested by this post: https://github.com/YuLab-SMU/clusterProfiler/issues/214, I have randomly ranked values with the same log2fc. However, I still receive the same error. I had also removed genes with NA values for log2fc (I don't know if this is necessary). However, I still receive the same error. Has anybody encountered this issue and knows how to solve it?
My stats object looks something like this:
.
My pathways object looks something like this:
Also, when I try to see if the rank is duplicated:
any(duplicated(rank))
The result is FALSE. So I'm really unsure of why I receive this warning
1 answer
The problem here is not the ties, but that your gene IDs in the pathway list (ensemble human genes) does not match the names of the stats vector (entrez mouse genes).
Hi,
I am experiencing the same warning. After looking through my DSEQ2 data, there doesn't seem to be any duplicates in the L2FC. Any suggestions other than adding a seed?
Log in to answer this question.
Please note: Warning != Error.
In this case there are no results in my fgsea object unfortunately