fGSEA collapsePathways function not working
Hello all,
I’m running the package fgsea and I’m having trouble with the collapsePathways
function. When not using that function, I get the expected data frame with 8 columns (pathway, pval, NES, etc.) that I can then plot using ggplot. However, when I try to use collapsePathways
, the output is a data frame with just the collapsed pathway names, meaning I have nothing to actually plot. Anybody know what’s wrong with the script below?
fgseaRes <- fgsea(pathways=pathways.hallmark,
minSize = 15,
maxSize = 1000,
eps = 0.0,
stats=ranks)
fgseaRes
fgseaRes <- collapsePathways(
fgseaRes,
pathways=pathways.hallmark,
stats=ranks,
pval.threshold = 0.05)
fgseaResTidy <- fgseaRes %>% as_tibble() %>% arrange(desc(NES))
fgseaResTidy <- apply(fgseaResTidy,2,as.character)
g <- ggplot(fgseaResTidy, aes(reorder(pathway, NES), NES))
g + geom_col(aes(fill=padj<0.05)) + coord_flip() + labs(x="Pathway", y="Normalized Enrichment Score", title="Hallmark Pathways NES from GSEA") + theme(axis.text.y = element_text(size = 2)) + theme_minimal()
• 14 views
Read more here: Source link