bucket_path: Analysis-runner GCS bucket path

Description Usage Arguments Value See Also Examples

View source: R/utils.R

Description

Returns a full GCS path for the given bucket category and path. This is useful for specifying input files, as in contrast to the output_path function, bucket_path does not take the "output" parameter from the analysis-runner invocation into account. Requires the DATASET and ACCESS_LEVEL environment variables to be set.

Usage

1
bucket_path(path, bucket_category = NULL)

Arguments

path

A path to append to the bucket.

bucket_category

A category like "upload", "tmp", "web". If omitted, defaults to the "main" and "test" buckets based on the access level. See https://github.com/populationgenomics/team-docs/tree/main/storage_policies for a full list of categories and their use cases.

Value

Full GCS path.

See Also

output_path

Examples

1
2
3
4
5
# Assuming that the analysis-runner has been invoked with
# `--dataset tob-wgs --access-level test --output snp/v1`:
Sys.setenv("DATASET" = "proj1", "ACCESS_LEVEL" = "test", "OUTPUT" = "dirA/v1")
(b1 <- bucket_path("dir/v1/file.txt")) # gs://cpg-proj1-test/dir/v1/file.txt
(b2 <- bucket_path("dir/v1/report.html", "web")) # gs://cpg-proj1-test-web/dir/v1/report.html

populationgenomics/cpgr documentation built on Dec. 22, 2021, 9:48 a.m.