A cached resource using BiocFileCache.
Usage
BiocFileCache_database(
source,
bfc_path = NULL,
resource_name,
bfc_fun = cache_as_is,
import_fun = read.csv,
offline = FALSE,
...
)
Arguments
- source
(ANY) The source of annotation data.
- bfc_path
(character, NULL)
BiocFileCache
is used to cache the database locally and prevent unnecessary downloads. If a path is provided thenBiocFileCache
will use this location. If NULL it will use the default location (seeBiocFileCache::BiocFileCache()
for details). The default isNULL
.- resource_name
(character) The name given to this resource in the cache. (see
BiocFileCache::BiocFileCache()
for details).- bfc_fun
(function) A function to process the object before storing it in the cache, e.g. to store an unzipped file in the cache instead of the zipped version. This would prevent needing to unzip the resource each time it is retrieved from the cache, but would mean using more space on disk. The default function does nothing to the resource. See
BiocFileCache::bfcdownload()
for details.- import_fun
(function) A function to process the object after retrieving it from the cache e.g. it might need to be unzipped before importingas a data.frame. This function should take the path to the cached object as the first input and return a data.frame.
- offline
(logical) If
offline = FALSE
then checks to determine if the resource has expired will be skipped, and retrieved directly from the cache. The default isFALSE
.- ...
Additional slots and values passed to
struct_class
.
Inheritance
A BiocFileCache_database
object inherits the following struct
classes: [BiocFileCache_database]
-> [annotation_database]
->
[annotation_source]
-> [struct_class]
References
Shepherd L, Morgan M (2024). BiocFileCache: Manage Files Across Sessions. R package version 2.10.2.
See also
Other database:
sqlite_database
Examples
M <- BiocFileCache_database(
bfc_path = NULL,
resource_name = "bfc",
bfc_fun = function(){},
import_fun = function(){},
offline = FALSE,
tag = character(0),
data = data.frame(),
source = "ANY")