Entering edit mode
3.7 years ago
LacquerHed
▴
30
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)
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!