Hi there,
Ran into an issue with fgsea and I wasn't able to find an appropriate solution anywhere.
The code:
fgsea$Entrez = convert2EntrezID(fgsea$ensembl_gene_id, "org.Hs.eg.db", "ensembl_gene_id")
gseaDat <- filter(fgsea, !is.na(entrez))
ranks <- gseaDat$log2FoldChange
names(ranks) <- gseaDat$entrez
head(ranks)
load("mouse_H_v5-1.rdata")
pathwaysH <- Mm.H
fgseaRes <- fgsea(pathwaysH, ranks, minSize=15, maxSize = 500, nperm=1000)
This is resulting in fgseaRes being 0 obs. of 8 variables.
Please let me know if there is an error I am making or something else I should be doing in the code. Thanks!
It looks like you are mixing both human and mouse data at the same time?
org.Hs.eg.db
is a homo sapiens (Hs) database, while later you are loading mouse pathways.Great catch, thanks! However, even after replacing org.Hs.eg.db with org.Mm.eg.db fgseaRes comes out as 0 obs. of 8 variables, not sure why.
Empty data.table (0 rows and 8 cols): pathway,pval,padj,ES,NES,nMoreExtreme...
In the first line you write "Entrez", while in the others "entrez", that could be a reason.