mantispy.metrics.evaluate_correction

mantispy.metrics.evaluate_correction#

mantispy.metrics.evaluate_correction(adata, reps=('X_pca',), label_key='Metadata_Perturbation', batch_key='Metadata_Batch', map_key=None)[source]#

Run every metric for every representation and stack the results.

Parameters:
  • adata (AnnData) – Object holding the representations in obsm.

  • reps (Sequence[str] (default: ('X_pca',))) – Representations to compare, e.g. ("X_pca", "X_pca_harmony").

  • label_key (str (default: 'Metadata_Perturbation')) – obs column with the biological grouping.

  • batch_key (str (default: 'Metadata_Batch')) – obs column with the nuisance grouping.

  • map_key (str | None (default: None)) – Name of a table written by map(), to add its mean mAP as one more row per representation.

Return type:

DataFrame

Returns:

A tidy frame with metric, representation, key, value and better, the last saying which direction is an improvement for that metric.