getGeneSets: Get a collection of gene sets from the msigdb

View source: R/getGeneSets.R

getGeneSetsR Documentation

Get a collection of gene sets from the msigdb

Description

This function retrieves gene sets from msigdb and caches the downloaded object for future calls. It allows subsetting by main collection (library), subcollection, or specific gene sets, and only supports human ("Homo sapiens") and mouse ("Mus musculus").

Usage

getGeneSets(
  species = c("Homo sapiens", "Mus musculus"),
  library = NULL,
  subcategory = NULL,
  gene.sets = NULL,
  version = "7.4",
  id = "SYM"
)

Arguments

species

'"Homo sapiens"' (default) or '"Mus musculus"'.

library

Character. Optional vector of main collection codes (e.g. '"H"', '"C5"').

subcategory

Character. Optional vector of sub-collection codes (e.g. '"GO:BP"').

gene.sets

Character. Optional vector of specific gene-set names.

version

MSigDB version (character, default '"7.4"').

id

Identifier type (default '"SYM"' for symbols).

Value

A named 'list' of character vectors (gene IDs).

Examples

## Not run: 
# Get all hallmark gene sets from human.
gs <- getGeneSets(species = "Homo sapiens", 
                  library = "H")

# Get a subset based on main collection and subcollection.
gs <- getGeneSets(species = "Homo sapiens", 
                  library = c("C2", "C5"), 
                  subcategory = "GO:BP")

## End(Not run)


ncborcherding/escape documentation built on June 12, 2025, 1 p.m.