cBioCache: Manage cache / download directories for study data

Description Usage Arguments Value cBioCache setCache removePackCache Examples

View source: R/cache.R

Description

Managing data downloads is important to save disk space and re-downloading data files. This can be done effortlessly via the integrated BiocFileCache system.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
cBioCache(...)

setCache(
  directory = tools::R_user_dir("cBioPortalData", "cache"),
  verbose = TRUE,
  ask = interactive()
)

removePackCache(cancer_study_id, dry.run = TRUE)

removeDataCache(
  api,
  studyId = NA_character_,
  genePanelId = NA_character_,
  molecularProfileIds = NULL,
  sampleListId = NULL,
  sampleIds = NULL,
  dry.run = TRUE,
  ...
)

Arguments

...

For cBioCache, arguments passed to setCache

directory

The file location where the cache is located. Once set future downloads will go to this folder.

verbose

Whether to print descriptive messages

ask

logical (default TRUE when interactive session) Confirm the file location of the cache directory

cancer_study_id

A single string from studiesTable associated with a study tarball

dry.run

logical Whether or not to remove cache files (default TRUE).

api

An API object of class 'cBioPortal' from the 'cBioPortal' function

studyId

character(1) Indicates the "studyId" as taken from 'getStudies'

genePanelId

character(1) Identifies the gene panel, as obtained from the 'genePanels' function

molecularProfileIds

character() A vector of molecular profile IDs

sampleListId

character(1) A sample list identifier as obtained from 'sampleLists()“

sampleIds

character() Sample identifiers

Value

cBioCache: The path to the cache location

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:

1
    tools::R_user_dir("cBioPortalData", "cache")

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
cBioCache()

removePackCache("acc_tcga", dry.run = TRUE)


cbio <- cBioPortal()

cBioPortalData(
    cbio, by = "hugoGeneSymbol",
    studyId = "acc_tcga",
    genePanelId = "AmpliSeq",
    molecularProfileIds =
        c("acc_tcga_rppa", "acc_tcga_linear_CNA", "acc_tcga_mutations")
)

removeDataCache(
    cbio,
    studyId = "acc_tcga",
    genePanelId = "AmpliSeq",
    molecularProfileIds =
        c("acc_tcga_rppa", "acc_tcga_linear_CNA", "acc_tcga_mutations"),
    dry.run = TRUE
)

cBioPortalData documentation built on April 17, 2021, 6:07 p.m.