Introduction to AnVILBase

Installation

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("AnVILBase")
library(AnVILBase)

Introduction

The AnVILBase package defines S4 generics for AnVIL packages. The package is designed to be used in conjunction with either AnVILGCP or AnVILAz packages. The AnVILBase package is not intended to be used as a standalone package.

Overview

The AnVILBase package defines S4 generics for the AnVIL package. These include methods for copying, listing, removing, and backing up files in the cloud. All generics in the package have methods defined for ‘missing’ and ‘ANY’ signatures.

Cloud Platforms

The AnVILBase package is designed to support packages that work with the AnVIL cloud platforms. Downstream packages expose Google Cloud Platform (AnVILGCP) and the Azure Cloud Platform (AnVILAz) application programming interfaces (APIs). To increase usability, the AnVILBase package attempts to deduce the user’s cloud platform from environment variables. This is codified in the cloud_platform function:

cloud_platform()

Developer Note

Packages that use the AnVILBase package can conditionally run tests using the avplatform_namespace() function. It will return either AnVILGCP or AnVILAz depending on the cloud environment variables that are set. If no environment variables are set, the function will return "".

avplatform_namespace()
## [1] ""

Base generics

The following generics are defined in the AnVILBase package:

  • avcopy(): Copy a file to and from the cloud
  • avlist(): List files in the cloud storage location
  • avremove(): Remove a file from the cloud
  • avbackup(): Backup files to the cloud
  • avrestore(): Restore files from the cloud
  • avstorage(): Get the storage address in the cloud

Table generics

The following generics are defined in the AnVILBase package for tables:

  • avtable : Get a table by name from a workspace
  • avtables : List tables in the workspace(s)
  • avtable_import: Upload a table to a workspace
  • avtable_import_set: Create a set (grouped) table from an existing table
  • avtable_delete: Remove a table from a workspace
  • avtable_delete_values: Delete values from a table

Workspace generics

The following generics are defined in the AnVILBase package for workspaces:

  • avworkspace: Set the active workspace
  • avworkspaces: List current workspace(s) on AnVIL
  • avworkspace_name: Get the workspace name
  • avworkspace_namespace: Get the workspace namespace

Note that the AnVILBase package also includes helper functions that are used across AnVIL cloud platforms. These include functions mainly for working with the AnVIL API responses.

Workflow generics

The following generics are defined in the AnVILBase package for workflows:

  • avworkflow_jobs: Get the execution status of a workflow

Notebook generics

The following generics are defined in the AnVILBase package for notebooks:

  • avnotebooks: List notebooks in the workspace
  • avnotebooks_localize: Download notebooks from a cloud to a workspace
  • avnotebooks_delocalize: Upload notebooks from a workspace to a cloud

sessionInfo

sessionInfo()
## R version 4.4.2 (2024-10-31)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 24.04.1 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C              
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## time zone: Etc/UTC
## tzcode source: system (glibc)
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] AnVILBase_1.1.0  BiocStyle_2.35.0
## 
## loaded via a namespace (and not attached):
##  [1] vctrs_0.6.5         httr_1.4.7          cli_3.6.3          
##  [4] knitr_1.49          rlang_1.1.4         xfun_0.49          
##  [7] jsonlite_1.8.9      glue_1.8.0          buildtools_1.0.0   
## [10] htmltools_0.5.8.1   maketools_1.3.1     sys_3.4.3          
## [13] sass_0.4.9          fansi_1.0.6         rmarkdown_2.29     
## [16] rappdirs_0.3.3      tibble_3.2.1        evaluate_1.0.1     
## [19] jquerylib_0.1.4     fastmap_1.2.0       yaml_2.3.10        
## [22] lifecycle_1.0.4     httr2_1.0.7         BiocManager_1.30.25
## [25] compiler_4.4.2      pkgconfig_2.0.3     digest_0.6.37      
## [28] R6_2.5.1            utf8_1.2.4          pillar_1.9.0       
## [31] magrittr_2.0.3      bslib_0.8.0         tools_4.4.2        
## [34] cachem_1.1.0