This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to run GSEA with spesific background

Hello,

I am trying to run GSEA with a specific background that contains all expressed genes, instead of choosing just "org.Mm.eg.db." How can I do that?

I filtered out all rows that don't have at least one value greater than 20. Here's how I run the normal GSEA:

gse_veh_Relapse_exF1 <- gseGO(
    gene_list_veh_Relapse_exF1_filtered,
    ont = "BP",
    keyType = "ENSEMBL",
    OrgDb = "org.Mm.eg.db"
)

Thank you!

rna-seq gsea

I don't know how to change the set of genes to test enrichment against using gseGO, but I know you can using the gprofiler2 package, though it can be a little fiddly generating the data for the GMT files.

Though can you give some more details on your logic? Unless I am misunderstanding your question, I don't think removing genes from a background is a appropriate unless you have a good reason. Not being expressed in your dataset doesn't sound like a compelling reason to remove them from background set to me.

I have been playing around with GSEA myself recently and I found 2 helpful ways of being more precise on selecting the gene background.

  • one version is to use the GSEA() function in R from the clusterProfiler package. Here you provide a background gene list (TERM2GENE arg) that can be defined by selecting a more specified msigdbr database. For example:

    msigdbr(species = "Mus musculus", category = "C5", subcategory = "BP")

For this I found a good video here

  • the other option was as dthorbur mentioned to download the desired GMT files and generate a custom one yourself. It is indeed a bit of work but I found a decent tutorial (also the video) here

Hope this helps

0 answers

No answers yet.

Log in to answer this question.