partipy.plot_bootstrap_2D

partipy.plot_bootstrap_2D#

partipy.plot_bootstrap_2D(adata, dimensions=None, show_contours=True, contours_confidence_level=0.95, contours_size=2.0, contours_alpha=0.75, alpha=1.0, size=None, result_filters=None)#

Visualize the distribution and stability of archetypes across bootstrap samples in 2D PCA space.

Parameters:
  • adata (anndata.AnnData) – Annotated data object containing the archetype bootstrap data in adata.uns["AA_bootstrap"].

  • dimensions (list[int] | None, default None) – List of 2 dimension indices to plot. If None, uses the first two dimensions specified in the AA configuration.

  • show_contours (bool, default True) – If True, a multivariate Gaussian distribution is fit per archetype, and a contour line for one confidence level is shown.

  • contours_confidence_level (float, default 0.95) – Confidence level for the contour line (0.0 to 1.0).

  • alpha (float, default 1.0) – Opacity of the points in the scatter plot (0.0 to 1.0).

  • size (float | None, default None) – Size of the points in the scatter plot. If None, uses the default size of the plotting library.

  • result_filters (Mapping[str, Any] | None, default None) – Filters applied to ArchetypeConfig entries to select the optimization configuration whose bootstrap runs are visualized. If unspecified, there must be only one configuration stored.

  • contours_size (float)

  • contours_alpha (float)

Return type:

ggplot

Returns:

pn.ggplot A 2D scatter plot visualizing the bootstrap results for the archetypes.