ctlab / fgsea

Fast Gene Set Enrichment Analysis
Other
379 stars 67 forks source link

Stats should be named #129

Closed been9312 closed 1 year ago

been9312 commented 1 year ago

Hi.

I'm trying my hand at gene set enrichment analysis via FGSEA for the first time, and I wanted to do it with files ranked by log2 fold change values.

` gene_expression <- read.csv("D:/BM2.csv", header = TRUE, row.names = 1)

gene_sets <- gmtPathways("D:/msigdb.v2022.1.Hs.symbols.gmt")

gene_expression_matrix <- as.matrix(gene_expression) gene_expression_matrix[is.na(gene_expression_matrix)] <- 0

fgsea_result <- fgsea(pathways = gene_sets, stats= gene_expression_matrix, nperm = 1000)

fgsea_result <- fgsea(pathways = gene_sets, stats= gene_expression_matrix, nperm = 1000) Error in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : stats should be named In addition: Warning message: In fgsea(pathways = gene_sets, stats = gene_expression_matrix, nperm = 1000) : You are trying to run fgseaSimple. It is recommended to use fgseaMultilevel. To run fgseaMultilevel, you need to remove the nperm argument in the fgsea function call. `

The expression data is organized as follows > gene_expression_matrix[,1:5] COL7A1 RMC1 LRRC14 ZNF599 TRIM2 -1.3219659 0.1986384 0.3105584 0.1137011 -0.2048005

What do I need to fix?

Thank you

assaron commented 1 year ago

@been9312 fgsea function implements pre-ranked algorithm, which takes the vector of gene-level statistics (such as differential gene expression statistic), not the expression matrix.