snapatac2.AnnDataSet#

class snapatac2.AnnDataSet(adatas, *, filename, add_key='sample', backend=None)#

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

  • backend (str) – The backend to use for the AnnDataSet object.

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

Data matrix of shape n_obs × n_vars.

adatas

View into the component AnnData objects.

backend

isbacked

Whether the AnnDataSet object is backed.

n_obs

Number of observations.

n_vars

Number of variables/features.

obs

Observation annotations.

obs_names

Names of observations.

obsm

obsp

shape

Shape of data matrix (n_obs, n_vars).

uns

Unstructured annotation (ordered dictionary).

var

Variable annotations.

var_names

Names of variables.

varm

varp

Methods

chunked_X([chunk_size])

type chunk_size:

close()

Close the AnnDataSet object.

is_closed()

If the AnnDataSet object has been closed.

obs_ix(names)

subset([obs_indices, var_indices, out, backend])

Subsetting the AnnDataSet object.

to_adata([obs_indices, var_indices, copy_x, ...])

Convert AnnDataSet to AnnData object.

var_ix(names)