R/utilityFunctions.R
setMesaAnnoDb.RdRecord a preferred OrgDb package to use when functions such as
annotateWindows() are called without an explicit annoDb.
setMesaAnnoDb(annoDb)Invisibly returns TRUE on success.
This sets the session option options(mesa_annoDb = <annoDb>). When present,
helpers like annotateWindows() will use this OrgDb by default (particularly
for GRCh38 workflows) unless an explicit annoDb is provided. Use
setMesaGenome() and setMesaTxDb() to configure complementary defaults for
the genome and TxDb, respectively.
# Set default annoDb for human (only if the package is installed)
if (requireNamespace("org.Hs.eg.db", quietly = TRUE)) {
setMesaAnnoDb("org.Hs.eg.db")
getOption("mesa_annoDb")
}
#> [1] "org.Hs.eg.db"
# Set default annoDb for mouse (only if the package is installed)
if (requireNamespace("org.Mm.eg.db", quietly = TRUE)) {
setMesaAnnoDb("org.Mm.eg.db")
getOption("mesa_annoDb")
}
#> [1] "org.Mm.eg.db"
# Unset the default annoDb
setMesaAnnoDb(NULL)
is.null(getOption("mesa_annoDb"))
#> [1] TRUE