getGenesets {EnrichmentBrowser} | R Documentation |
Functionality for retrieving gene sets for an organism under investigation from databases such as GO and KEGG. Parsing and writing a list of gene sets from/to a flat text file in GMT format is also supported.
The GMT (Gene Matrix Transposed) file format is a tab delimited file format that describes gene sets. In the GMT format, each row represents a gene set. Each gene set is described by a name, a description, and the genes in the gene set. See references.
getGenesets( org, db = c("go", "kegg", "msigdb", "enrichr"), cache = TRUE, return.type = c("list", "GeneSetCollection"), ... ) writeGMT(gs, gmt.file)
org |
An organism in (KEGG) three letter code, e.g. ‘hsa’ for ‘Homo sapiens’. Alternatively, this can also be a text file storing gene sets in GMT format. See details. |
db |
Database from which gene sets should be retrieved. Currently, either 'go' (default), 'kegg', 'msigdb', or 'enrichr'. |
cache |
Logical. Should a locally cached version used if available?
Defaults to |
return.type |
Character. Determines whether gene sets are returned
as a simple list of gene sets (each being a character vector of gene IDs), or
as an object of class |
... |
Additional arguments for individual gene set databases.
For
For
For
|
gs |
A list of gene sets (character vectors of gene IDs). |
gmt.file |
Gene set file in GMT format. See details. |
For getGenesets
: a list of gene sets (vectors of gene IDs).
For writeGMT
: none, writes to file.
Ludwig Geistlinger <Ludwig.Geistlinger@sph.cuny.edu>
KEGG Organism code: http://www.genome.jp/kegg/catalog/org_list.html
MSigDB: http://software.broadinstitute.org/gsea/msigdb/collections.jsp
Enrichr: https://amp.pharm.mssm.edu/Enrichr/#stats
GMT file format: http://www.broadinstitute.org/cancer/software/gsea/wiki/index.php/Data_formats
annFUN
for general GO2gene mapping used in the
'GO.db' mode, and the biomaRt package for general queries to BioMart.
keggList
and keggLink
for accessing the KEGG REST
server.
msigdbr::msigdbr
for obtaining gene sets from the MSigDB.
# (1) Typical usage for gene set enrichment analysis with GO: # Biological process terms based on BioC annotation (for human) go.gs <- getGenesets(org="hsa", db="go") # eq.: # go.gs <- getGenesets(org="hsa", db="go", onto="BP", mode="GO.db") # Alternatively: # downloading from BioMart # this may take a few minutes ... go.gs <- getGenesets(org="hsa", db="go", mode="biomart") # (2) Defining gene sets according to KEGG kegg.gs <- getGenesets(org="hsa", db="kegg") # (3) Obtaining *H*allmark gene sets from MSigDB hall.gs <- getGenesets(org="hsa", db="msigdb", cat="H") # (4) Obtaining gene sets from Enrichr tfppi.gs <- getGenesets(org="hsa", db="enrichr", lib="Transcription_Factor_PPIs") # displaying available Enrichr gene set libraries getGenesets(org="hsa", db="enrichr", show.libs=TRUE) # (6) parsing gene sets from GMT gmt.file <- system.file("extdata/hsa_kegg_gs.gmt", package="EnrichmentBrowser") gs <- getGenesets(gmt.file) # (7) writing gene sets to file writeGMT(gs, gmt.file)