partipy.t_ratio_significance

partipy.t_ratio_significance#

partipy.t_ratio_significance(adata, *, n_iter=100, seed=42, n_jobs=-1, save_permutation_results=False, result_filters=None)#

Assesses the significance of the polytope spanned by the archetypes by comparing the t-ratio of the original data to t-ratios computed from randomized datasets.

Parameters:
  • adata (anndata.AnnData) – An AnnData object containing adata.obsm["X_pca"] and adata.uns["AA_config"]["n_dimensions"], optionally adata.uns["AA_t_ratio"]. If adata.uns["AA_t_ratio"] doesn’t exist it is computed.

  • n_iter (int, default 100) – Number of randomized datasets to generate.

  • seed (int, default 42) – Random seed to use for reproducible results.

  • n_jobs (int, default -1) – Number of jobs for parallelization. Use -1 to use all available cores.

  • result_filters (Mapping[str, Any] | None, optional) – Filters forwarded to get_aa_result() to select which cached AA result is evaluated when multiple configurations are present.

  • save_permutation_results (bool)

Returns:

float The proportion of randomized datasets with a t-ratio greater than the original t-ratio (p-value).