peach.tl.assign_archetypes

peach.tl.assign_archetypes#

peach.tl.assign_archetypes(adata, *, percentage_per_archetype=0.1, obsm_key='archetype_distances', obs_key='archetypes', include_central_archetype=True, verbose=True, **kwargs)[source]#

Assign cells to archetypes based on distances.

Parameters:
  • adata (AnnData) – Annotated data object with archetype distances

  • percentage_per_archetype (float, default: 0.1) – Percentage of cells to assign to each archetype

  • obsm_key (str, default: "archetype_distances") – Key in adata.obsm containing distance matrix

  • obs_key (str, default: "archetypes") – Key to store assignments in adata.obs

  • include_central_archetype (bool, default: True) – Whether to include a central archetype (cells far from all extreme archetypes)

  • verbose (bool, default: True) – Whether to print progress messages

  • **kwargs – Additional arguments passed to bin_cells_by_archetype

Return type:

None