nmf_models.plotting.factor_biplot
- factor_biplot(nmf_model, TX=0, TY=1, n_labs=5, modality='rna', labs=None, select=None, title=None, x_lab=None, y_lab=None, mode='abs')[source]
Plot nmf embedding. With features projected on. Plot is scaled so that the projected features don’t exceed 1.
- Parameters:
nmf_model (intNMF) – intNMF model with embed to view (.fit has been run)
TX (int) – factor/topic for x-axis
TY (int) – factor/topic for y-axis
n_labs (int) – number of features to plot per topic (i.e. 2)
modality (str, 'rna' | 'atac') – select modality from which features are projected from.
labs (list) – cell labels used to colour plot. Discrete or continuos determined by fraction of unique elements
select (list) – list of features to project
title (str) – plot title, default None
y_lab (str) – y-axis label, default None
x_lab (str) – x-axis label, default None
mode (str, 'abs' | 'diff') – select features to plot by absolute value or by difference
- Returns:
matplotlib ax
list of features annotated