The tiledbsoma.io module

Functions

Data conversion to/from TileDB-SOMA

tiledbsoma.io.from_h5ad

Reads an .h5ad file and writes it to an Experiment.

tiledbsoma.io.from_anndata

Writes an AnnData object to an Experiment.

tiledbsoma.io.to_h5ad

Converts the experiment group to AnnData format and writes it to the specified .h5ad file.

tiledbsoma.io.to_anndata

Converts the experiment group to AnnData format.

Updating values within a TileDB-SOMA Experiment

tiledbsoma.io.add_X_layer

This is useful for adding X data, for example from Scanpy's scanpy.pp.normalize_total, scanpy.pp.log1p, etc.

tiledbsoma.io.add_matrix_to_collection

This is useful for adding X/obsp/varm/etc data, for example from Scanpy's scanpy.pp.normalize_total, scanpy.pp.log1p, etc.

tiledbsoma.io.create_from_matrix

Create and populate the soma_matrix from the contents of matrix.

tiledbsoma.io.update_obs

Given a new Pandas dataframe with desired contents, updates the SOMA experiment's entire obs to incorporate the changes.

tiledbsoma.io.update_var

Given a new Pandas dataframe with desired contents, updates the SOMA experiment's specified measurement's entire var to incorporate the changes.

tiledbsoma.io.update_matrix

Given a SparseNDArray or DenseNDArray already opened for write, writes the new data.

Growing a TileDB-SOMA Experiment

tiledbsoma.io.register_anndatas

Extends registration data from the baseline, already-written SOMA experiment to include multiple H5AD input files.

tiledbsoma.io.register_h5ads

Extends registration data from the baseline, already-written SOMA experiment to include multiple H5AD input files.

tiledbsoma.io.append_X

Appends new data to an existing X matrix.

tiledbsoma.io.append_obs

Writes new rows to an existing obs dataframe.

tiledbsoma.io.append_var

Writes new rows to an existing var dataframe.

tiledbsoma.io.show_experiment_shapes

For each dataframe/array contained within the SOMA Experiment pointed to by the given URI, shows the non_empty_domain (for dataframes), along with the shape and maxshape (for arrays) or domain and maxdomain (for dataframes).

tiledbsoma.io.upgrade_experiment_shapes

For each dataframe contained within the SOMA Experiment pointed to by the given URI, sets the domain to match the dataframe's current non_empty_domain.

tiledbsoma.io.resize_experiment

For each dataframe contained within the SOMA Experiment pointed to by the given URI, resizes the domain for the soma_joinid index column (if it is an indexed column) to match the desired new value.