This is a test version of Biostars. For the public version, visit https://www.biostars.org.
genes underlying gseGO categories

Wondering how I can get a list of the genes I submitted that fall within each category/term represented on the eventual dotplot. Thanks.

library(clusterProfiler)
library(enrichplot)
library(ggplot2)
organism = org.Mm.eg.db
library(org.Mm.eg.db)


df = read.csv("subcluster3_001_genes.csv", header=TRUE)


original_gene_list <- df$log2FoldChange


names(original_gene_list) <- df$GENENAME


gene_list<-na.omit(original_gene_list)


gene_list = sort(gene_list, decreasing = TRUE)

gse <- gseGO(geneList=gene_list, 
             ont ="ALL", 
             keyType = "SYMBOL", 
             minGSSize = 3, 
             maxGSSize = 800, 
             pvalueCutoff = .05, 
             verbose = TRUE, 
             OrgDb = organism, 
             pAdjustMethod = "none")


gse_simplified <- simplify(gse, cutoff=0.5, by="pvalue", select_fun=min)

require(DOSE)

dotplot(gse_simplified, showCategory=10, split=".sign") + facet_grid(.~.sign)
gsego gsea clusterprofiler enrichplot

1 answer

If I understand correctly you are trying to plot each gene vs the category in which it was enriched. The gene can be enriched in several categories. I am not sure how a dot-plot would help. Have you checked: https://yulab-smu.top/biomedical-knowledge-mining-book/faq.html#showing-specific-pathways

Actually the plotting is not an issue, get what I need, I specifically need to know which of my genes falls within each category, even if there is overlap. Just trying to find a way to derive a list.

Your dataframe named gse should have a column with gene information enriched in each category. Try doing a as.data.frame(gse) to get the list.

Yes thats exactly what I need, thanks!

Log in to answer this question.