Skip to contents

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.


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



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


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


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.


if (FALSE) {
# download a test set of the database
get_db(test = TRUE)

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

# load the test db file from shipped with the pacakge
db_file <- system.file("extdata", "cRegulome.db", package = "cRegulome")
#>                                                                 size isdir mode
#> /usr/local/lib/R/site-library/cRegulome/extdata/cRegulome.db 1204224 FALSE  644
#>                                                                            mtime
#> /usr/local/lib/R/site-library/cRegulome/extdata/cRegulome.db 2024-02-29 06:30:02
#>                                                                            ctime
#> /usr/local/lib/R/site-library/cRegulome/extdata/cRegulome.db 2024-02-29 06:30:05
#>                                                                            atime
#> /usr/local/lib/R/site-library/cRegulome/extdata/cRegulome.db 2024-02-29 06:30:09
#>                                                              uid gid uname
#> /usr/local/lib/R/site-library/cRegulome/extdata/cRegulome.db   0   0  root
#>                                                              grname
#> /usr/local/lib/R/site-library/cRegulome/extdata/cRegulome.db   root