deepof.visuals.plot_distance_between_conditions

deepof.visuals.plot_distance_between_conditions(coordinates: deepof_coordinates, embedding: dict, soft_counts: dict, breaks: dict, exp_condition: str, embedding_aggregation_method: str = 'median', distance_metric: str = 'wasserstein', n_jobs: int = -1, save: bool = False, ax: Any | None = None)

Plot the distance between conditions across a growing time window.

Finds an optimal separation binning based on the distance between conditions, and plots it across all non-overlapping bins. Useful, for example, to measure habituation over time.

Parameters:
  • coordinates (coordinates) – coordinates object for the current project. Used to get video paths.

  • embedding (dict) – embedding object for the current project. Used to get video paths.

  • soft_counts (dict) – dictionary with soft_counts per experiment.

  • breaks (dict) – dictionary with break lengths for each video.

  • exp_condition (str) – experimental condition to use for the distance calculation.

  • embedding_aggregation_method (str) – method to use for aggregating the embedding. Options are ‘time_on_cluster’ and ‘mean’.

  • distance_metric (str) – distance metric to use for the distance calculation. Options are ‘wasserstein’ and ‘euclidean’.

  • n_jobs (int) – number of jobs to use for the distance calculation.

  • save (bool) – if True, saves the figure to the project directory.

  • ax (plt.AxesSubplot) – axes where to plot the current figure. If not provided, new figure will be created.