mantispy.pl.batch_variance#
- mantispy.pl.batch_variance(adata, keys, use_rep='X_pca', n_comps=None, ax=None)[source]#
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.
- keys
Sequence[str] obscolumns to score, one line each.- use_rep
str(default:'X_pca') obsmkey of the embedding.- n_comps
int|None(default:None) Draw only the leading components, or
Nonefor every component the embedding holds.- ax
Axes|None(default:None) Axes to draw on, or
Nonefor a new figure.
- adata
- Return type:
- Returns:
The axes when the caller passed
ax, elseNonebecause the plot then owns the figure it created. When returned they hold one line per entry ofkeysand the y axis fixed to[0, 1].- Raises:
KeyError –
obsmholds nothing underuse_rep, orobshas no column for one ofkeys.