db.preload: Preload database files into R workspace for NetBID2

View source: R/pipeline_functions.R

db.preloadR Documentation

Preload database files into R workspace for NetBID2

Description

db.preload is a pre-processing function for NetBID2. It preloads needed data into R workspace, and saves it locally under db/ directory with specified species name and analysis level.

Usage

db.preload(
  use_level = "transcript",
  use_spe = "human",
  update = FALSE,
  TF_list = NULL,
  SIG_list = NULL,
  input_attr_type = "external_gene_name",
  main.dir = NULL,
  db.dir = sprintf("%s/db/", main.dir),
  useCache = TRUE
)

Arguments

use_level

character, users can choose "transcript" or "gene". Default is "gene".

use_spe

character, the name of an interested species (e.g. "human", "mouse", "rat"). Default is "human".

update

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

TF_list

a character vector, the list of TF (Transcription Factor) names. If NULL, the pre-defined list in the package will be used. Default is NULL.

SIG_list

a character vector, the list of SIG (Signaling Factor) names. If NULL, the pre-defined list in the package will be use. Default is NULL.

input_attr_type

character, the type of the TF_list and SIG_list. Details please check biomaRt, https://bioconductor.org/packages/release/bioc/vignettes/biomaRt/inst/doc/biomaRt.html. If TF_list and SIG_list are not specified, the list in the NetBID2 package will be used. This only support "external_gene_name" and "ensembl_gene_id". Default is "external_gene_name".

main.dir

character, the main directory for NetBID2. If NULL, will be system.file(package = "NetBID2"). Default is NULL.

db.dir

character, a path for saving the RData. Default is db directory under the main.dir, if main.dir is provided.

useCache

Boolean, parameter pass to getBM() indicating whether the results cache should be used. Setting to FALSE will disable reading and writing of the cache.

Details

Users need to set the species name (e.g. human, mouse) and analysis level (transcript or gene level). TF list and SIG list are optional, if not specified, list from package data will be used as default.

Value

Return TRUE if loading is successful, otherwise return FALSE. Two variables will be loaded into R workspace, tf_sigs and db_info.

Examples

db.preload(use_level='gene',use_spe='human',update=FALSE)

## Not run: 
db.preload(use_level='transcript',use_spe='human',update=FALSE)
db.preload(use_level='gene',use_spe='mouse',update=FALSE)

## End(Not run)

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