Managing data downloads is important to save disk space and
avoid re-downloading data files. This can be done via the integrated
BiocFileCache
system.
Usage
cBioCache(..., ask = interactive())
setCache(
directory = tools::R_user_dir("cBioPortalData", "cache"),
verbose = TRUE,
ask = interactive()
)
removePackCache(cancer_study_id, dry.run = TRUE)
Arguments
- ...
For
cBioCache
, arguments passed tosetCache
- ask
logical (default TRUE when interactive session) Confirm the file location of the cache directory
- directory
The file location where the cache is located. Once set future downloads will go to this folder.
- verbose
Whether to print descriptive messages
- cancer_study_id
character(1)
ThestudyId
fromgetStudies
- dry.run
logical Whether or not to remove cache files (default TRUE).
cBioCache
Get the directory location of the cache. It will prompt the user to create
a cache if not already created. A specific directory can be used via
setCache
.
setCache
Specify the directory location of the data cache. By default, it will go to the user directory as given by:
removePackCache
Some files may become corrupt when downloading, this function allows
the user to delete the tarball associated with a cancer_study_id
in the
cache. This only works for the cBioDataPack
function. To remove the entire
cBioPortalData
cache, run unlink("~/.cache/cBioPortalData")
.
Examples
cBioCache()
#> [1] "/github/home/.cache/R/cBioPortalData"
removePackCache("acc_tcga", dry.run = TRUE)
#> # A tibble: 1 × 10
#> rid rname create_time access_time rpath rtype fpath last_modified_time etag
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 BFC4 acc_… 2025-04-22… 2025-04-22… /git… web http… 2024-12-26 20:18:… e27e…
#> # ℹ 1 more variable: expires <dbl>