snapatac2.AnnDataSet#

class snapatac2.AnnDataSet(*, adatas, filename, add_key)#

Similar to AnnData, AnnDataSet contains annotations of observations obs (obsm, obsp), variables var (varm, varp), and unstructured annotations uns. Additionally it provides lazy access to concatenated component AnnData objects, including X, obs, obsm, obsp.

Parameters
  • adatas (list[(str, Path)] | list[(str, AnnData)]) – List of key and file name (or backed AnnData object) pairs.

  • filename (Path) – File name of the output file containing the AnnDataSet object.

  • add_key (str) – The column name in obs to store the keys

Note

AnnDataSet does not copy underlying AnnData objects. It stores the references to individual anndata files. If you move the anndata files to a new location, remember to update the anndata file locations when opening an AnnDataSet object.

See also

read_dataset

Attributes

X

Vertically concatenated data matrices of shape n_obs x n_vars.

adatas

View into the component AnnData objects.

isbacked

Whether the AnnDataSet object is backed.

n_obs

Number of observations.

n_vars

Number of variables/features.

obs

One-dimensional annotation.

obs_names

Names of observations.

obsm

PyAxisArrays.

obsp

PyAxisArrays.

shape

Shape of data matrix (n_obs, n_vars).

uns

Unstructured annotation (ordered dictionary).

var

One-dimensional annotation.

var_names

Names of variables.

varm

PyAxisArrays.

varp

PyAxisArrays.

Methods

chunked_X(chunk_size, /)

Return an iterator over the rows of the data matrix X.

close()

Close the AnnDataSet object.

copy(dirname)

Copy the AnnDataSet object to a new location.

is_closed()

If the AnnDataSet object has been closed.

obs_ix(names)

subset(obs_indices, var_indices, out)

Subsetting the AnnDataSet object.

to_adata(file, copy_X, /)

Convert the AnnDataSet object to an AnnData object.

var_ix(names)