partipy.set_obsm#
- partipy.set_obsm(adata, obsm_key, n_dimensions)#
Sets the
obsmkey and dimensionality to be used as input for archetypal analysis (AA).This function verifies that the specified
obsm_keyexists inadata.obsmand that the requested number of dimensions does not exceed the available dimensions in that matrix. The configuration is stored inadata.uns["AA_config"].- Parameters:
adata (anndata.AnnData) – AnnData object containing single-cell data. The specified
obsm_keyshould refer to a matrix inadata.obsmto be used as input for AA.obsm_key (str) – Key in
adata.obsmpointing 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:
- Returns:
None The AA configuration is stored in
adata.uns["AA_config"].