This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Load MF, CC and BP from org.Hs.eg.db

Hi!

I would like to load all the pathways related to CC, MF and BP from the org.Hs.eg.db, converting into a dataset that has as columns pathway, gene_symbols.

In order that after this I filter the pathways that have genes in common with the metabolism pathways from KEGG. So that I can see which of my DGE genes in the metabolism also participate in this CC, MF and BP.

enrichGO(gene = row.names(dge_nos_leiomyo_over),
                    universe = row.names(dge_nos_leiomyo),
                    OrgDb = org.Hs.eg.db,
                    keyType="SYMBOL",
                    ont = "ALL",
                    pAdjustMethod = "fdr",
                    pvalueCutoff = 0.05,
                    readable = TRUE)

enrichGo gets those pathways in the internal code which I read, some of the methods seem to be very complicated such as get_GO_data(OrgDb, ont, keyType)

Is there any simple line of code that would just get all the pathways in CC, MF and BP and the gene symbols included in those into a dataset?

Thank you!

org.hs.eg.db go dge enrichgo

1 answer

Easily done via msigdbr or numerous other similar packages.

install.packages("msigdbr")
library(msigdbr)

go_bp_genesets = msigdbr(species = "mouse", category = "C5", subcategory = "BP")
go_mf_genesets = msigdbr(species = "mouse", category = "C5", subcategory = "MF")
go_cc_genesets = msigdbr(species = "mouse", category = "C5", subcategory = "CC")

Thank you much! Just to confirm, these are the same datasets used in?

enrichGO(gene = row.names(dge_nos_leiomyo_over),
                    universe = row.names(dge_nos_leiomyo),
                    OrgDb = org.Hs.eg.db,
                    keyType="SYMBOL",
                    ont = "ALL",
                    pAdjustMethod = "fdr",
                    pvalueCutoff = 0.05,
                    readable = TRUE)

Well, mine is pulling mouse, and it's from the MSigDb, so probably slight differences. Plus using gene symbols as a key type always results in some wonkiness.

If you just want a list of all GO terms and associated entrez IDs, you can pull them like:

xx <- as.list(org.Hs.egGO2ALLEGS)

I'd recommend taking a look at the org.Hs.eg.db vignette.

Log in to answer this question.