Contents

1 Introduction

S4Arrays is an infrastructure package that provides a framework intended to facilitate implementation of array-like containers in other Bioconductor packages. Array-like containers are S4 objects that mimic the behavior of ordinary matrices or arrays in R. Please note that the package is not intended to be used directly by the end user.

2 Installation

Like any other Bioconductor package, S4Arrays should always be installed with BiocManager::install():

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

However, note that S4Arrays will usually get automatically installed as a dependency of other Bioconductor packages, so explicitly installing the package is usually not needed.

3 The Array virtual class

At the center of the framework provided by the S4Arrays package is the Array virtual class whose only purpose is to be extended by other S4 classes that wish to implement a container with an array-like semantic. Examples of such classes are:

Note that Array is a virtual class with no slots:

library(S4Arrays)

showClass("Array")
## Virtual Class "Array" [package "S4Arrays"]
## 
## No Slots, prototype of class "S4"
## 
## Known Subclasses: 
## Class "ArrayViewport", directly
## Class "ArrayGrid", directly
## Class "DummyArrayViewport", by class "ArrayViewport", distance 2
## Class "SafeArrayViewport", by class "ArrayViewport", distance 2
## Class "DummyArrayGrid", by class "ArrayGrid", distance 2
## Class "ArbitraryArrayGrid", by class "ArrayGrid", distance 2
## Class "RegularArrayGrid", by class "ArrayGrid", distance 2

4 The extract_array() generic function

The S4Arrays package also introduces the extract_array() S4 generic function that Arrays subclasses (a.k.a. Arrays extensions) are expected to support via specific methods. This allows some basic operations like type(), as.array() or as.matrix() to work out-of-the-box on instances of these Arrays subclasses (a.k.a. Arrays derivatives). It also allows them to be used as the seed of a DelayedArray object.

Please refer to the man page of the extract_array() function for more information: ?extract_array

5 Block processing of array-like objects

The S4Arrays package provides a framework that facilitates block processing of array-like objects. Note that block processing is typically used on on-disk objects, that is, on objects where the array data is stored on disk. This framework consists of:

6 Other functionalities

In addition to the above, the S4Arrays package provides the following functionalities:

7 Session information

sessionInfo()
## R version 4.3.2 Patched (2023-11-13 r85521)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 22.04.4 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.18-bioc/R/lib/libRblas.so 
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_GB              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: America/New_York
## tzcode source: system (glibc)
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
## [1] S4Arrays_1.2.1      IRanges_2.36.0      S4Vectors_0.40.2   
## [4] BiocGenerics_0.48.1 abind_1.4-5         Matrix_1.6-5       
## [7] BiocStyle_2.30.0   
## 
## loaded via a namespace (and not attached):
##  [1] crayon_1.5.2        cli_3.6.2           knitr_1.45         
##  [4] rlang_1.1.3         xfun_0.42           jsonlite_1.8.8     
##  [7] htmltools_0.5.7     sass_0.4.8          rmarkdown_2.25     
## [10] grid_4.3.2          evaluate_0.23       jquerylib_0.1.4    
## [13] fastmap_1.1.1       yaml_2.3.8          lifecycle_1.0.4    
## [16] bookdown_0.38       BiocManager_1.30.22 compiler_4.3.2     
## [19] lattice_0.22-5      digest_0.6.34       R6_2.5.1           
## [22] bslib_0.6.1         tools_4.3.2         cachem_1.0.8