partipy.compute_t_ratio

partipy.compute_t_ratio#

partipy.compute_t_ratio(adata, /, *, result_filters=None, save_to_anndata=True, return_result=False)#

Compute the t-ratio from an AnnData object that contains archetypes.

Parameters:
  • adata (anndata.AnnData) – AnnData object with AA configuration and stored archetypes.

  • result_filters (Mapping[str, Any] | None, optional) – Filters passed to get_aa_result() to disambiguate which AA result to use when multiple configurations are cached. Ignored when adata.uns["AA_results"] uses the legacy format.

  • save_to_anndata (bool, default True) – Whether to store the computed t-ratio in adata.uns["AA_t_ratio"].

  • return_result (bool, default False) – If True, return the t-ratio value.

Return type:

float | None

Returns:

Optional[float] The computed t-ratio when return_result is True or save_to_anndata is False. Otherwise, None.