download: Access and download objects from Gen3 google buckets

Description Usage Arguments Details Value Examples

Description

download_stat() returns information about objects available for download from Gen3.

download_object_id() retieves the object id to a local file system or another google bucket for which the user has write access.

Usage

1
2
3
download_stat(object_id)

download_object_id(object_id, destination)

Arguments

object_id

character(1) object identifier returned from a query of form values("sequences", "object_id", ...).

destination

character(1) location to retrieve the file, either a local path or a 'gs://' uri with appropriate write permissions, e.g., as returned by AnVIL::avbucket() in AnVIL.

Details

These functions must be run in the AnVIL environment, or with gcloud command line tools available and configured to such that AnVIL::gcloud_project() returns a billing account (e.g., belonging to AnVIL) that will allow 'requester pays' downloads.

1
2
3
`download_stat()` fails if the object is not available,
the user does not have permission to access the object, or the
user does not have billing enabled.

Value

download_stat() returns an object of class gcloud_sdk_result, which when printed displays statistics on the object.

download_object_id() returns the path or bucket in which the object was stored.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## object_id of smallest object at time of writing; see vignette
object_id <- "dg.ANV0/76050167-ff6a-445d-9376-c3d9192fd02b"

## Not run: 
## Who will pay for the downloads?
AnVIL::gcloud_project()

download_stat(object_id)

## End(Not run)

## Not run: 
destination <- download_object_id(object_id, tempfile())
file.info(destination) %>% as_tibble()

destination <- download_object_id(object_id, AnVIL::avbucket())
destination
AnVIL::avfiles_stat(destination)

## End(Not run)

Bioconductor/Gen3 documentation built on Aug. 13, 2020, 4:13 p.m.