0

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.

ATpoint
  • 603
  • 5
  • 17
Nicola
  • 1
  • the problem should be caused because of your data format, which we can't see it. could you update your question with part of the dataset? `dput(res)` [How to make a great R reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – Vida Feb 07 '23 at 20:52

0 Answers0