Skip to contents

SOMAExperiment is a specialized SOMACollection, representing one or more modes of measurement across a single collection of cells (aka a "multimodal dataset") with pre-defined fields: obs and ms (see Active Bindings below for details). (lifecycle: maturing)

Adding new objects to a collection

The SOMAExperiment class provides a number of type-specific methods for adding new a object to the collection, such as add_new_sparse_ndarray() and add_new_dataframe(). These methods will create the new object and add it as member of the SOMAExperiment. The new object will always inherit the parent context (see SOMATileDBContext) and, by default, its platform configuration (see PlatformConfig). However, the user can override the default platform configuration by passing a custom configuration to the platform_config argument.

Active bindings

obs

a SOMADataFrame containing primary annotations on the observation axis. The contents of the soma_joinid column define the observation index domain, obs_id. All observations for the SOMAExperiment must be defined in this dataframe.

ms

a SOMACollection of named SOMAMeasurements.

Methods

Inherited methods


Method axis_query()

Subset and extract data from a SOMAMeasurement by querying the obs/var axes.

Usage

SOMAExperiment$axis_query(measurement_name, obs_query = NULL, var_query = NULL)

Arguments

measurement_name

The name of the measurement to query.

obs_query, var_query

An SOMAAxisQuery object for the obs/var axis.

Returns

A SOMAExperimentAxisQuery object.


Method update_obs()

Update the obs SOMADataFrame to add or remove columns. See SOMADataFrame$update() for details.

Usage

SOMAExperiment$update_obs(values, row_index_name = NULL)

Arguments

values

A data.frame, arrow::Table, or arrow::RecordBatch.

row_index_name

An optional scalar character. If provided, and if the values argument is a data.frame with row names, then the row names will be extracted and added as a new column to the data.frame prior to performing the update. The name of this new column will be set to the value specified by row_index_name.


Method update_var()

Update the var SOMADataFrame to add or remove columns. See SOMADataFrame$update() for details.

Usage

SOMAExperiment$update_var(values, measurement_name, row_index_name = NULL)

Arguments

values

A data.frame, arrow::Table, or arrow::RecordBatch.

measurement_name

The name of the SOMAMeasurement whose var will be updated.

row_index_name

An optional scalar character. If provided, and if the values argument is a data.frame with row names, then the row names will be extracted and added as a new column to the data.frame prior to performing the update. The name of this new column will be set to the value specified by row_index_name.


Method clone()

The objects of this class are cloneable with this method.

Usage

SOMAExperiment$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.