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.

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

Examples

# 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
#> [1] "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
#> [1] "gs://cpg-proj1-test-web/dir/v1/report.html"