In contrast to the bucket_path function, output_path takes the "output" parameter from the analysis-runner invocation into account. Requires the DATASET, ACCESS_LEVEL, and OUTPUT environment variables to be set.

output_path(path_suffix, bucket_category = NULL)

Arguments

path_suffix

A suffix to append to the bucket + output directory.

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") (o1 <- output_path("report.html", "web")) # gs://cpg-proj1-test-web/dirA/v1/report.html
#> [1] "gs://cpg-proj1-test-web/dirA/v1/report.html"
(o2 <- output_path("output.txt")) # gs://cpg-proj1-test/dirA/v1/output.txt
#> [1] "gs://cpg-proj1-test/dirA/v1/output.txt"