I am attempting to run an fgsea analysis on my saved data:
res <- read.delim ("Rank_fgsea_data.rnk", header=T, colClasses = c("numeric", "character"))
res$Gene.ID <- gsub("\\..*", "", res$Gene.ID)
res <- as.data.frame(res)
res <- unlist(res)
res <- setnames(res$log2FoldChange, res$Gene.ID)
str(res)
##loading pathways
pathways <- gmtPathways("GOCC_RIBOSOME.v2022.1.Hs.gmt")
str(head(pathways))
##running fgsea
fgseaRes <- fgsea(GOCC_RIBOSOME_v2022_1_Hs, res, minSize=15, maxSize=500) #need to load GOCC_RIBOSOME pathway
head(fgseaRes)`
After writing this in R I am receiving the following error:
Error in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, :
Not all stats values are finite numbers
I'm relatively new to R does anyone know what this error means and/or how to fix it?
I have attempted to read my data as a list but this has not solved the issue.