partipy.set_obsm

Contents

partipy.set_obsm#

partipy.set_obsm(adata, obsm_key, n_dimensions)#

Sets the obsm key and dimensionality to be used as input for archetypal analysis (AA).

This function verifies that the specified obsm_key exists in adata.obsm and that the requested number of dimensions does not exceed the available dimensions in that matrix. The configuration is stored in adata.uns["AA_config"].

Parameters:
  • adata (anndata.AnnData) – AnnData object containing single-cell data. The specified obsm_key should refer to a matrix in adata.obsm to be used as input for AA.

  • obsm_key (str) – Key in adata.obsm pointing to the matrix to be used for AA.

  • n_dimensions (int | list[int]) – Number of dimensions to retain from adata.obsm[obsm_key]. Must be less than or equal to the number of columns in that matrix.

Return type:

None

Returns:

None The AA configuration is stored in adata.uns["AA_config"].