drs: Manipulate 'DRS' (Data Repository Service) URLs

Description Usage Arguments Details Value Examples

Description

drs_stat() resolves zero or more DRS URLs to their google bucket location.

drs_cp() copies 0 or more DRS URIs to a google bucket or local folder

Usage

1
2
3
drs_stat(source = character())

drs_cp(source, destination, ...)

Arguments

source

character() DRS URLs (beginning with 'drs://') to resources managed by the 'martha' DRS resolution server.

destination

character(1) directory path in which to retrieve files.

...

additional arguments, passed to gsutil_cp() for file copying.

Details

drs_stat() uses the AnVIL 'pet' account associated with a runtime. The pet account is discovered by default when evaluated on an AnVIL runtime (e.g., in RStudio or a Jupyter notebook in the AnVIL), or can be found in the return value of avruntimes().

Value

drs_stat() returns a tbl with the following columns:

drs_cp() returns a tibble like drs_stat(), but with additional columns

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
drs_eg_hca <- paste0(
    "drs://drs.data.humancellatlas.org/",
    "4cf48dbf-cf09-452e-bb5b-fd016af0c747?version=2019-09-14T024754.281908Z"
)

drs_eg_anvil <- c(
    "drs://dg.ANV0/975bd45f-f022-4fad-b9a2-3a00c3b8792c",
    "drs://dg.ANV0/00008531-03d7-418c-b3d3-b7b22b5381a0"
)

if (gcloud_exists())
    # no pet account needed for HCA data
    drs_stat(drs_eg_hca)

if (gcloud_exists() && startsWith(gcloud_account(), "pet-")) {
    ## from within AnVIL
    drs_stat(drs_eg_anvil)
}

if (gcloud_exists()) {
    destination <- tempfile()
    dir.create(destination)
    tbl <- drs_cp(drs_eg_hca, destination)
    readLines(tbl$destination, warn = FALSE)
}

AnVIL documentation built on Nov. 8, 2020, 4:57 p.m.