GangLiLab / genekitr

🧬 Gene analysis toolkit based on R
https://www.genekitr.fun
GNU General Public License v3.0
53 stars 7 forks source link

Combining pathway gene sets for ORA/GSEA analyses #29

Closed adityaparatus closed 5 months ago

adityaparatus commented 5 months ago

Hi Genekitr developers,

Is there a way to combine pathway gene sets from different sources like (mSigDB, Reactome, KEGG) into a single geneset for ORA or GSEA analysis?

Thank you in advance, Adi

reedliu commented 5 months ago

Hi Adi, If you need to combine pathways from different sources for enrichment analysis, you can select the gene sets of interest and create a list that includes "gene set" (class: dataframe), "gene set name" (class: dataframe), "organism" (class: character), and "type" (class: character). For example,

# Example IDs
library(genekitr)
data(geneList, package = "genekitr")
entrez_id <- names(geneList)[abs(geneList) > 2]

# If we build a new geneset includes both KEGG and Reactome
kegg_gs <- geneset::getKEGG(org = "human",category = 'pathway')
react_gs <- geneset::getReactome(org = "human")

all_gset <- rbind(kegg_gs$geneset, react_gs$geneset)
all_gsetname <- rbind(kegg_gs$geneset_name, react_gs$geneset_name)
new_gs <- list(geneset = all_gset, geneset_name = all_gsetname, organism = 'hsapiens', type = 'whatever')

ora <- genORA(entrez_id, geneset = new_gs)

image

However, caution is needed as not all gene sets follow the same format, and adjustments may be necessary during the integration process.

adityaparatus commented 5 months ago

Thank you!