AnnotationArray: Base class for Annotation Arrays

AnnotationArrayR Documentation

Base class for Annotation Arrays

Description

This is a base class for Annotation arrays that provides common methods for creating empty arrays and ingesting data.

Duplicates

Duplicates are always disabled in the schemas created for AnnotationArray objects to guarantee each array cell is associated with a unique value. This also means that updates to an array cell will overwrite the previous value (although previous values are still available via time-travel). For example, consider the following AnnotationDataframe (a child of AnnotationArray) with a single cell:

uri <- file.path(tempdir(), "annotdf")
df <- data.frame(value = 1, row.names = "a")
annotdf <- AnnotationDataframe$new(uri, verbose = FALSE)
annotdf$from_dataframe(df, "id")

If we update the cell to value = 2 the previous value 1 will be overwritten.

df$value <- 2
annotdf$from_dataframe(df, "id")
annotdf$object[]
#> $id
#> [1] "a"
#> 
#> $value
#> [1] 2
#> 
#> attr(,"query_status")
#> [1] "COMPLETE"

If duplicates were allowed the result would be:

## $id
## [1] "a" "a"
##
## $value
## [1] 1 2
##
## attr(,"query_status")
## [1] "COMPLETE"

Super classes

tiledbsc::TileDBObject -> tiledbsc::TileDBArray -> AnnotationArray

Methods

Public methods

Inherited methods

Method clone()

The objects of this class are cloneable with this method.

Usage
AnnotationArray$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


TileDB-Inc/tiledbsc documentation built on Aug. 26, 2023, 2:32 p.m.