Skip to contents

A SOMAMeasurement is a sub-element of a SOMAExperiment, and is otherwise a specialized SOMACollection with pre-defined fields: X, var, obsm/varm, and obsp/varp (see Active Bindings below for details). (lifecycle: experimental)

Adding new objects to a collection

The SOMAMeasurement 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 SOMAMeasurement. 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

var

a SOMADataFrame containing primary annotations on the variable axis, for variables in this measurement (i.e., annotates columns of X). The contents of the soma_joinid column define the variable index domain, var_id. All variables for this measurement must be defined in this dataframe.

X

a SOMACollection of SOMASparseNDArrays, each contains measured feature values indexed by [obsid, varid].

obsm

a SOMACollection of SOMADenseNDArrays containing annotations on the observation axis. Each array is indexed by obsid and has the same shape as obs.

obsp

a SOMACollection of SOMASparseNDArrays containing pairwise annotations on the observation axis and indexed with [obsid_1, obsid_2].

varm

a SOMACollection of SOMADenseNDArrays containing annotations on the variable axis. Each array is indexed by varid and has the same shape as var.

varp

a SOMACollection of SOMASparseNDArrays containing pairwise annotations on the variable axis and indexed with [varid_1, varid_2].