| Title: | Bioconductor on the AnVIL compute environment |
|---|---|
| Description: | The AnVIL is a cloud computing resource developed in part by the National Human Genome Research Institute. The AnVIL package provides programatic access to the Dockstore, Leonardo, Rawls, TDR, and Terra RESTful programming interfaces. For platform-specific user-level functionality, see either the AnVILGCP or AnVILAz package. |
| Authors: | Marcel Ramos [aut, cre] (ORCID: <https://orcid.org/0000-0002-3242-0582>), Martin Morgan [aut] (ORCID: <https://orcid.org/0000-0002-5874-8148>), Kayla Interdonato [aut], Yubo Cheng [aut], Nitesh Turaga [aut], BJ Stubbs [ctb], Vincent Carey [ctb], Sehyun Oh [ctb], Sweta Gopaulakrishnan [ctb], Valerie Obenchain [ctb] |
| Maintainer: | Marcel Ramos <[email protected]> |
| License: | Artistic-2.0 |
| Version: | 1.25.1 |
| Built: | 2026-05-30 09:12:28 UTC |
| Source: | https://github.com/Bioconductor/AnVIL |
Functions documented on this page are primarily intended for package developers wishing to implement gadgets (graphical interfaces) to navigating AnVIL-generated tables.
.gadget_run() presents the user with a
tibble-navigating gadget, returning the value of DONE_FUN if
a row of the tibble is selected, or NULL.
.gadget_run(title, tibble, DONE_FUN).gadget_run(title, tibble, DONE_FUN)
title |
|
tibble |
a |
DONE_FUN |
a function of two arguments, |
.gadget_run() returns the result of DONE_FUN() if a row
has been selected by the user, or NULL if no row is selected
(the user presses Cancel, or Done prior to selecting any
row).
tibble <- avworkspaces(platform = AnVILGCP::gcp()) DONE_FUN <- function(tibble, row_selected) { selected <- slice(tibble, row_selected) with(selected, paste0(namespace, "/", name)) } .gadget_run("AnVIL Example", tibble, DONE_FUN)tibble <- avworkspaces(platform = AnVILGCP::gcp()) DONE_FUN <- function(tibble, row_selected) { selected <- slice(tibble, row_selected) with(selected, paste0(namespace, "/", name)) } .gadget_run("AnVIL Example", tibble, DONE_FUN)
anvil_set_auth_json() stores the content of an auth.json
file in the system keyring. This is the recommended way to store
credentials safely.
anvil_set_auth_json(service, path)anvil_set_auth_json(service, path)
service |
|
path |
|
anvil_set_auth_json() returns NULL invisibly.
jsonlite::write_json( list(token = "example_token"), "terratcgadata-test-key.json", ) anvil_set_auth_json( "terra", "terratcgadata-test-key.json" ) AnVIL:::.authenticate_get_access("terra") unlink("terratcgadata-test-key.json")jsonlite::write_json( list(token = "example_token"), "terratcgadata-test-key.json", ) anvil_set_auth_json( "terra", "terratcgadata-test-key.json" ) AnVIL:::.authenticate_get_access("terra") unlink("terratcgadata-test-key.json")
workspace() allows choice of workspace for
subsequent use. It is the equivalent of displaying workspaces
with avworkspaces(), and setting the selected workspace with
avworkspace().
browse_workspace() uses browseURL() to open a
browser window pointing to the Terra workspace.
table() allows choice of table in the current
workspace (selected by avworkspace() or workspace()) to be
returned as a tibble. It is equivalent to invoking avtables()
to show available tables, and avtable() to retrieve the
selected table.
workflow() allows choice of workflow for
retrieval. It is the equivalent of avworkflows() for listing
available workflows, and avworkflow_configuration_get() for
retrieving the workflow.
avworkspace_gadget() browse_workspace(use_avworkspace = TRUE) avtable_gadget() avworkflow_gadget()avworkspace_gadget() browse_workspace(use_avworkspace = TRUE) avtable_gadget() avworkflow_gadget()
use_avworkspace |
|
workspace() returns the selected workspace as a
character(1) using the format namespace/name, or character(0)
if no workspace is selected.
browse_workspace() returns the status of a system()
call to launch the browser, invisibly. The default app URL
prefix (https://app.terra.bio) can be changed with the
AnVIL.terra_app_url option.
table() returns a tibble representing the selected
AnVIL table.
workflow() returns an avworkflow_configuration object
representing the inputs and outputs of the selected
workflow. This can be edited and updated as described in the
"Running an AnVIL workflow within R" vigenette.
workspace() browse_workspace(use_avworkspace = FALSE) tbl <- table() wkflw <- avworkflow_gadget()workspace() browse_workspace(use_avworkspace = FALSE) tbl <- table() wkflw <- avworkflow_gadget()
RESTful service constructor
Service( service, host, config = httr::config(), authenticate = TRUE, api_url = character(), package = "AnVIL", schemes = "https", api_reference_url = api_url, api_reference_md5sum = character(), api_reference_version = character(), api_reference_headers = NULL, ... )Service( service, host, config = httr::config(), authenticate = TRUE, api_url = character(), package = "AnVIL", schemes = "https", api_reference_url = api_url, api_reference_md5sum = character(), api_reference_version = character(), api_reference_headers = NULL, ... )
service |
|
host |
|
config |
httr::config() curl options |
authenticate |
|
api_url |
optional |
package |
|
schemes |
|
api_reference_url |
|
api_reference_md5sum |
|
api_reference_version |
|
api_reference_headers |
|
... |
additional arguments passed to |
This function creates a RESTful interface to a service
provided by a host, e.g., "leonardo.dsde-prod.broadinstitute.org".
The function requires an OpenAPI .json or .yaml specification.
The specification file is located in the source directory of a
package, at <package>/inst/service/<service>/api.json, or at
api_url.
Authentication credentials can be stored securely in the system keyring using `anvil_set_auth_json()`.
When provided, the api_reference_md5sum is used to check that
the file described at api_reference_url has the same checksum
as an author-validated version.
The service is usually a singleton, created at the package
level during .onLoad().
An object of class Service.
.MyService <- setClass("MyService", contains = "Service") MyService <- function() { .MyService(Service("my_service", host="my.api.org")) }.MyService <- setClass("MyService", contains = "Service") MyService <- function() { .MyService(Service("my_service", host="my.api.org")) }
RESTful services useful for AnVIL developers
empty_object operations(x, ..., .deprecated = FALSE) ## S4 method for signature 'Service' operations(x, ..., auto_unbox = FALSE, .deprecated = FALSE) schemas(x) tags(x, .tags, .deprecated = FALSE) ## S4 method for signature 'Service' x$name Leonardo() Terra() Rawls() Dockstore() TDR()empty_object operations(x, ..., .deprecated = FALSE) ## S4 method for signature 'Service' operations(x, ..., auto_unbox = FALSE, .deprecated = FALSE) schemas(x) tags(x, .tags, .deprecated = FALSE) ## S4 method for signature 'Service' x$name Leonardo() Terra() Rawls() Dockstore() TDR()
x |
A |
... |
additional arguments passed to methods or, for
|
.deprecated |
optional |
auto_unbox |
|
.tags |
optional |
name |
A symbol representing a defined operation, e.g.,
|
An object of class list of length 0.
Note the services Terra(), Rawls(), and Leonardo() require the
GCPtools package for authentication to the Google Cloud Platform. See
?GCPtools::gcloud_access_token() for details.
When using $ to select a service, some arguments appear
in 'body' of the REST request. Specify these using the
.__body__= argument, as illustrated for
createBillingProjectFull(), below.
empty_object returns a representation to be used as
arguments in function calls expecting the empty json object
{}.
Leonardo() creates the API of the Leonardo container
deployment service at
https://leonardo.dsde-prod.broadinstitute.org/api-docs.yaml.
The default API url value can be changed with the
AnVIL.leonardo_api_url option.
Terra() creates the API of the Terra cloud computational
environment at https://api.firecloud.org/. The default
API url value can be changed with the AnVIL.firecloud_api_url
option.
Rawls() creates the API of the Rawls cloud computational
environment at https://rawls.dsde-prod.broadinstitute.org.
The default API url value can be changed with the
AnVIL.rawls_api_url option.
Dockstore() represents the API of the Dockstore platform to
share Docker-based tools in CWL or WDL or Nextflow at
https://dockstore.org. The default API url value can be
changed with the AnVIL.dockstore_api_url option.
TDR() creates the API of the Terra Data Repository to work with
snapshot data in the Terra Data Repository at https://data.terra.bio.
The default API url value can be changed with the
AnVIL.tdr_api_url option.
empty_object ## Arguments to be used as the 'body' (`.__body__=`) of a REST query Terra()$createBillingProjectFull # 6 arguments... ## ... passed as `.__body__ = list(...)` args(Terra()$createBillingProjectFull) library(GCPtools) if (gcloud_exists()) Leonardo() library(GCPtools) if (gcloud_exists()) { tags(Terra()) tags(Terra(), "Billing") } library(GCPtools) if (gcloud_exists()) { tags(Rawls()) tags(Rawls(), "billing") } Dockstore() library(GCPtools) if (gcloud_exists()) TDR()empty_object ## Arguments to be used as the 'body' (`.__body__=`) of a REST query Terra()$createBillingProjectFull # 6 arguments... ## ... passed as `.__body__ = list(...)` args(Terra()$createBillingProjectFull) library(GCPtools) if (gcloud_exists()) Leonardo() library(GCPtools) if (gcloud_exists()) { tags(Terra()) tags(Terra(), "Billing") } library(GCPtools) if (gcloud_exists()) { tags(Rawls()) tags(Rawls(), "billing") } Dockstore() library(GCPtools) if (gcloud_exists()) TDR()
add_libpaths(): Add local library paths to
.libPaths().
add_libpaths(paths)add_libpaths(paths)
paths |
|
add_libpaths(): updated .libPaths(), invisibly.
add_libpaths("/tmp/host-site-library")add_libpaths("/tmp/host-site-library")