gp_covariate

Contents

gp_covariate#

mofaflex.pl.gp_covariate(model, ci_opacity=0.3, group='facet', color='black', size=1, figsize=None)#

Plot the fitted GP mean for each factor in each group at the data covariate locations.

If the model covariates are 2D, plot the covariate on X and Y and encode the GP posterior mean with color. If the model covariates are 1D, plot the covariate on X and the GP posterior mean and 95% confidence interval on Y.

Parameters:
  • model (MOFAFLEX) – The MOFA-FLEX model.

  • ci_opacity (float (default: 0.3)) – Opacity of the 95% CI band. Only relevant for 1D covariates.

  • group (Literal['facet', 'color'] (default: 'facet')) – Whether to encode the sample groups by color or by faceting. Only relevant for 1D covariates.

  • color (str (default: 'black')) – Color of the line and CI and. Only relevant for 1D covariates and group="facet".

  • size (int (default: 1)) – The point size. Only relevant for 2D covariates.

  • figsize (tuple[float, float] | None (default: None)) – Figure size in inches.

Return type:

plotnine.ggplot