gs.preload: Load MSigDB Database into R Workspace

View source: R/pipeline_functions.R

gs.preloadR Documentation

Load MSigDB Database into R Workspace

Description

gs.preload downloads data from MSigDB and stores it into two variables in R workspace, all_gs2gene and all_gs2gene_info. all_gs2gene is a list object with elements of gene sets collections. all_gs2gene_info is a data.frame contains the description of each gene sets.

Usage

gs.preload(
  use_spe = "Homo sapiens",
  update = FALSE,
  main.dir = NULL,
  db.dir = sprintf("%s/db/", main.dir)
)

Arguments

use_spe

character, name of interested species (e.g. "Homo sapiens", "Mus musculus"). Users can call msigdbr_show_species() to access the full list of available species names. Default is "Homo sapiens".

update

logical, if TRUE, the previous loaded RData will be updated. Default is FALSE.

main.dir

character, the main file path of user's NetBID2 project. If NULL, will be set to system.file(package = "NetBID2"). Default is NULL.

db.dir

character, the file path to save the RData. Default is db directory under the main.dir, if one has a main.dir.

Details

This is a pre-processing function for NetBID2 advanced analysis. User only need to input the species name (e.g. "Homo sapiens", "Mus musculus"). It will call msigdbr to download data from MSigDB and save it as RData under the db/ directory with species name.

Value

Reture a logical value. If TRUE, MsigDB database is loaded successfully, with all_gs2gene and all_gs2gene_info created in the workspace.

Examples

gs.preload(use_spe='Homo sapiens',update=FALSE)
gs.preload(use_spe='Mus musculus',update=FALSE)
print(all_gs2gene_info)
# contain the information for all gene set category, category info, category size,
## sub category,sub category info, sub category size
print(names(all_gs2gene)) # the first level of the list is the category and sub-category IDs
print(str(all_gs2gene$`CP:KEGG`))

## Not run: 
gs.preload(use_spe='Homo sapiens',update=TRUE)

## End(Not run)

jyyulab/NetBID documentation built on Dec. 23, 2024, 6:34 a.m.