deepof.visuals.plot_normative_log_likelihood

deepof.visuals.plot_normative_log_likelihood(embeddings: deepof_table_dict, exp_condition: str, embedding_dataset: DataFrame, normative_model: str, ax: Any, add_stats: str, verbose: bool)

Plot a bar chart with normative log likelihoods per experimental condition, and compute statistics.

Parameters:
  • embeddings (table_dict) – table dictionary containing supervised annotations or unsupervised embeddings per animal.

  • exp_condition (str) – Name of the experimental condition to use when plotting. If None (default) the first one available is used.

  • embedding_dataset (pd.DataFrame) – global animal embeddings, alongside their respective experimental conditions

  • normative_model (str) – Name of the cohort to use as controls. If provided, fits a Gaussian density to the control global animal embeddings, and reports the difference in likelihood across all instances of the provided experimental condition. Statistical parameters can be controlled via **kwargs (see full documentation for details).

  • ax (plt.AxesSubplot) – matplotlib axes where to render the plot

  • add_stats (str) – test to use. Mann-Whitney (non-parametric) by default. See statsannotations documentation for details.

  • verbose (bool) – if True, prints test results and p-value cutoffs. False by default.

Returns:

embedding data frame with added normative scores per sample

Return type:

embedding_dataset (pd.DataFrame)