mantispy.metrics.batch_variance_explained

mantispy.metrics.batch_variance_explained#

mantispy.metrics.batch_variance_explained(adata, keys, use_rep='X_pca')#

pc_regression() for several covariates, stacked into one frame.

Parameters:
  • adata (AnnData) – Object with the embedding to measure in.

  • keys (Sequence[str]) – obs columns to score, one row of the result each.

  • use_rep (str (default: 'X_pca')) – obsm key of the embedding.

Return type:

DataFrame

Returns:

A tidy frame holding one pc_regression row per entry of keys.

Raises:

KeyErrorobsm holds nothing under use_rep.