mantispy.metrics.batch_variance_explained#
- mantispy.metrics.batch_variance_explained(adata, keys, use_rep='X_pca')[source]#
pc_regression()for several covariates, stacked into one frame.- Parameters:
adata (
AnnData) – Object with the embedding to measure in.keys (
Sequence[str]) –obscolumns to score, one row of the result each. Any column works, numeric or categorical, not only the batch: a plate position, a cell count or a treatment label are all valid covariates.use_rep (
str(default:'X_pca')) –obsmkey of the embedding.
- Return type:
- Returns:
A tidy frame holding one
pc_regressionrow per entry ofkeys.- Raises:
KeyError –
obsmholds nothing underuse_rep.