SOMACollection: SOMA Collection

SOMACollectionR Documentation

SOMA Collection

Description

Class for representing a SOMACollection, which may contain of one or more SOMAs.

Super classes

tiledbsc::TileDBObject -> tiledbsc::TileDBGroup -> SOMACollection

Public fields

uns

Named list of unstructured objects.

Active bindings

somas

Retrieve SOMA members.

Methods

Public methods

Inherited methods

Method new()

Create a new SOMACollection. The existing TileDB group is opened at the specified array uri if one is present, otherwise a new array group is created. The members field is populated with SOMA objects for each URI passed explicitly to soma_uris, as well SOMA objects discovered within the SOMACollection object's TileDB group.

Usage
SOMACollection$new(uri, verbose = TRUE, config = NULL, ctx = NULL)
Arguments
uri

URI of the TileDB group

verbose

Print status messages

config

optional configuration

ctx

optional tiledb context


Method set_query()

Set query parameters to slice by dimension values or filter by attribute values that are applied to all SOMAs within the collection.

Usage
SOMACollection$set_query(
  obs_ids = NULL,
  var_ids = NULL,
  obs_attr_filter = NULL,
  var_attr_filter = NULL
)
Arguments
obs_ids, var_ids

character vector containing observation- or variable-identifiers.

obs_attr_filter, var_attr_filter

a TileDB query condition for attribute filtering pushdown.

Details

See SOMA$set_query() for more information about querying mechanics.


Method reset_query()

Reset query dimensions and attribute filters.

Usage
SOMACollection$reset_query()
Returns

NULL


Method from_seurat()

Convert a Seurat object to a TileDB-backed SOMACollection.

Assays

Each ⁠[SeuratObject::Assay⁠] is converted to a SOMA and written to a nested TileDB group with a URI of ⁠./soma_<assay>⁠ where ⁠<assay>⁠ is the name of the Seurat assay.

Identities

Cell identities in the SeuratObject::Seurat are maintained by creating an active_ident attribute in obs that stores the factor levels as a character vector.

Dimensionality Reductions

Dimensionality reduction results are stored as obsm and varm arrays within an SOMA. The SeuratObject::DimReduc object's key slot is used to determine which SOMA to store the results in. The array names are ⁠(obsm|varm)_dimreduction_<name>⁠, where ⁠<name>⁠ is the name of the dimensionality reduction method (e.g., "pca").

Usage
SOMACollection$from_seurat(object)
Arguments
object

A SeuratObject::Seurat object.


Method to_seurat()

Convert to a SeuratObject::Seurat object.

Usage
SOMACollection$to_seurat(
  project = "SeuratProject",
  somas = NULL,
  batch_mode = FALSE
)
Arguments
project

SeuratObject::Project name for the Seurat object

somas

character vector, names of SOMAs to include as SeuratObject::Assays in the Seurat object. If NULL, all SOMAs are included. Can also be a named list of character vectors, where each element corresponds to a SOMA name and the value is a character vector of X layers from that SOMA to include as assays (e.g., list("RNA" = c("counts", "logcounts"))).

batch_mode

logical, if TRUE, batch query mode is enabled for retrieving X layers. See AssayMatrix$to_dataframe() for more information.


Method soma_uris()

List the SOMA URIs in the collection.

Usage
SOMACollection$soma_uris()
Returns

A vector of URIs for each SOMA in the collection.


Method clone()

The objects of this class are cloneable with this method.

Usage
SOMACollection$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


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