Skip to contents

Downloads a gene set collection with msigdbr and returns it as a named list, using the identifier type that matches your gene IDs.

Usage

mx_gene_sets(
  db = c("Hallmarks", "Reactome", "KEGG", "WikiPathways", "GO_BP"),
  species = "Homo sapiens",
  id_type = c("symbol", "entrez", "ensembl")
)

Arguments

db

Character scalar. One of "Hallmarks" (default), "Reactome", "KEGG" (KEGG MEDICUS), "WikiPathways", "GO_BP".

species

Species name understood by msigdbr. Default: "Homo sapiens".

id_type

Gene identifier: "symbol" (default), "entrez" or "ensembl". NCBI GEO counts from mx_fetch_geo use Entrez IDs.

Value

A named list of character vectors (gene set name -> gene IDs). The MSigDB version is stored in attr(x, "version").

References

Liberzon, A. et al. (2015) The Molecular Signatures Database (MSigDB) hallmark gene set collection. Cell Systems, 1(6), 417–425. doi:10.1016/j.cels.2015.12.004

Examples

# Offline: the Hallmark collection ships with metaXpress
hallmarks <- readRDS(system.file("extdata", "hallmark_gene_sets.rds",
                                 package = "metaXpress"))
length(hallmarks)
#> [1] 50
head(hallmarks$HALLMARK_INFLAMMATORY_RESPONSE)
#> [1] "ABCA1"  "ABI1"   "ACVR1B" "ACVR2A" "ADGRE1" "ADM"   

# \donttest{
# Other collections are downloaded through msigdbr (needs internet)
if (requireNamespace("msigdbr", quietly = TRUE)) {
  reactome <- mx_gene_sets("Reactome")
  length(reactome)
}
#> Downloading gene sets (first use only, may take a few minutes)...
#> [1] 1839
# }