mantispy.pl.batch_variance#
- mantispy.pl.batch_variance(adata, keys, use_rep='X_pca', n_comps=None, ax=None)#
R^2 of each principal component on each covariate.
A covariate with high R^2 in the leading components accounts for much of the embedding’s structure.
- Parameters:
adata (
AnnData) – Object with the embedding to measure in.use_rep (
str(default:'X_pca')) –obsmkey of the embedding.n_comps (
int|None(default:None)) – Draw only the leading components, orNonefor every component the embedding holds.ax (
Axes|None(default:None)) – Axes to draw on, orNonefor a new figure.
- Return type:
- Returns:
The axes drawn on, with one line per entry of
keysand the y axis fixed to[0, 1].- Raises:
KeyError –
obsmholds nothing underuse_rep, orobshas no column for one ofkeys.