get_db: Get cRegulome.db file

Description Usage Arguments Value Examples

View source: R/get_data.R

Description

This function calls download.file to download the pre-build database file of cRegulome. Additionally, the function checks the validity of the pre-defined URL and whether the database file exists in the current working directory to avoid redownloading it. Typically, users would run this function once at the first time the use the package or to update the database to the latest version.

Usage

1
get_db(test = FALSE, destfile, ...)

Arguments

test

A logical, default FALSE. When TRUE downloads a database file with the same structure with a subset of the data for speed.

destfile

A character vector for the desired path for the database file. By default, when not specified, is constructed by using tempdir as a directory and the string cRegulome.db.gz

...

Optional arguments passed to download.file

Value

Downloads a compressed sqlite file to the current working directory. The file is named cRegulome.db.gz by default and it's not advised to change the name to avoid breaking the other functions that calls the database.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
# download a test set of the database
get_db(test = TRUE)

# download the full database file
get_db(test = FALSE)

## End(Not run)

# load the test db file from shipped with the pacakge
db_file <- system.file("extdata", "cRegulome.db", package = "cRegulome")
file.info(db_file)

cRegulome documentation built on Jan. 3, 2019, 9:04 a.m.