tiledbsoma.Measurement¶
- class tiledbsoma.Measurement(handle: GroupWrapper, **kwargs: Any)¶
A set of observations defined by a dataframe, with measurements.
This is a common set of annotated variables (defined by the
var
dataframe) for which values (e.g., measurements or calculations) are stored in sparse and dense ND arrays.The observables are inherited from the parent
Experiment
’sobs
dataframe. Thesoma_joinid
of these observables (obsid
), along with those of the measurement’svar
dataframe (varid
), are the indices for all the other matrices stored in the measurement.In most cases, users interact with a measurement via querying the experiment which contains it, rather than directly accessing its fields.
- var¶
Primary annotations on the variable axis, for variables in this measurement (i.e., annotates columns of
X
). The contents of thesoma_joinid
column define the variable index domain, AKA var_id. All variables for this measurement must be defined in this dataframe.- Type:
- X¶
A collection of sparse matrices, each containing measured feature values. Each matrix is indexed by
[obsid, varid]
.- Type:
- obsm¶
A collection of dense matrices containing annotations of each
obs
row. Has the same shape asobs
, and is indexed withobsid
.- Type:
- obsp¶
A collection of sparse matrices containing pairwise annotations of each
obs
row. Indexed with[obsid_1, obsid_2]
.- Type:
- varm¶
A collection of dense matrices containing annotations of each
var
row. Has the same shape asvar
, and is indexed withvarid
.- Type:
- varp¶
A collection of sparse matrices containing pairwise annotations of each
var
row. Indexed with[varid_1, varid_2]
- Type:
Lifecycle
Experimental.
- __init__(handle: GroupWrapper, **kwargs: Any)¶
Internal-only common initializer steps.
This function is internal; users should open TileDB SOMA objects using the
create()
andopen()
factory class methods.
Methods
__init__
(handle, **kwargs)Internal-only common initializer steps.
add_new_collection
(key[, kind, uri, ...])Adds a new sub-collection to this collection.
add_new_dataframe
(key, *[, uri, ...])Adds a new DataFrame to this collection.
add_new_dense_ndarray
(key, *, cls[, uri, ...])Adds a new DenseNDArray to this Collection.
add_new_sparse_ndarray
(key, *, cls[, uri, ...])Adds a new SparseNDArray to this Collection.
clear
()close
()Release any resources held while the object is open.
create
(uri, *[, platform_config, context, ...])Creates and opens a new SOMA collection in storage.
exists
(uri[, context, tiledb_timestamp])Finds whether an object of this type exists at the given URI.
get
(k[,d])items
()keys
()open
(uri[, mode, tiledb_timestamp, context, ...])Opens this specific type of SOMA object.
pop
(k[,d])If key is not found, d is returned if given, otherwise KeyError is raised.
popitem
()as a 2-tuple; but raise KeyError if D is empty.
set
(key, value, *[, use_relative_uri])Adds an element to the collection.
setdefault
(k[,d])update
([E, ]**F)If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
values
()verify_open_for_writing
()Raises an error if the object is not open for writing.
Attributes
A collection of matrices containing feature values.
closed
True if the object has been closed.
context
A value storing implementation-specific configuration information.
metadata
The metadata of this SOMA object.
mode
The mode this object was opened in, either
r
orw
.Matrices containing annotations of each
obs
row.Matrices containg pairwise annotations of each
obs
row.soma_type
A string describing the SOMA type of this object.
tiledb_timestamp
The time that this object was opened in UTC.
tiledb_timestamp_ms
The time this object was opened, as millis since the Unix epoch.
uri
Accessor for the object's storage URI.
Primary annotations on the variable axis for vars on this meansurement.
Matrices containing annotations of each
var
row.Matrices containg pairwise annotations of each
var
row.