Create the commands required to populate FeatureSetTables with commonly used gene sets.
Usage
createGeneSetCommands(
collections = c("GO", "KEGG"),
organism = "org.Hs.eg.db",
identifier = "ENTREZID"
)
Value
A list of two character vectors describing how to create collections and retrieve gene sets.
This follows the expectations for commands
in registerFeatureSetCommands
.
Details
GO terms are extracted using the "GOALL"
mode,
which extracts both direct and indirect children of each term.
A description for each GO term is extracted using the GO.db package.
Mappings of genes to KEGG pathway are extracted from the organism package using the "PATH"
term.
Unfortunately, this is not up to date due to the licensing around KEGG terms.
Descriptions for each pathway are extracted from http://rest.kegg.jp/list/pathway.
The output of this function can be used as the commands
argument of registerFeatureSetCommands
.
It is also used by default in the FeatureSetTable
constructor when no collections are registered.
See also
FeatureSetTable, where the commands are intended for use.
registerFeatureSetCommands
, to use the commands globally.
Examples
out <- createGeneSetCommands()
cat(out$collections['GO'], "\n")
#> .all_terms <- AnnotationDbi::keys(org.Hs.eg.db::org.Hs.eg.db, keytype='GOALL');
#> tab <- AnnotationDbi::select(GO.db::GO.db, keys=.all_terms, columns='TERM');
#> rownames(tab) <- tab$GOID;
#> tab$GOID <- NULL;
cat(out$sets['GO'], "\n")
#> .genes_in_set <- tryCatch(AnnotationDbi::select(org.Hs.eg.db::org.Hs.eg.db, keys=.set_id, keytype='GOALL',
#> column="ENTREZID")[,"ENTREZID"], error=function(e) character(0));
#> selected <- intersect(rownames(se), .genes_in_set)