deepof.visuals.plot_enrichment
- deepof.visuals.plot_enrichment(coordinates: deepof_coordinates, embeddings: deepof_table_dict | None = None, soft_counts: deepof_table_dict | None = None, supervised_annotations: deepof_table_dict | None = None, bin_index: int | str | None = None, bin_size: int | str | None = None, precomputed_bins: ndarray | None = None, samples_max: int = 100000, roi_number: int | None = None, animals_in_roi: list | None = None, roi_mode: str = 'mousewise', in_roi_criterion: str = 'Center', polar_depiction: bool = False, plot_speed: bool = False, add_stats: str = 'Mann-Whitney', exp_condition: str | None = None, exp_condition_order: list | None = None, normalize: bool = False, verbose: bool = False, unit_time: str = 's', unit_distance: str = 'm', ax: Any | None = None, save: bool = False)
Violin plots per cluster per condition.
- Parameters:
coordinates (coordinates) – deepOF project where the data is stored.
embeddings (table_dict) – table dict with neural embeddings per animal experiment across time.
soft_counts (table_dict) – table dict with soft cluster assignments per animal experiment across time.
supervised_annotations (table_dict) – table dict with supervised annotations per animal experiment across time.
bin_index (Union[int,str]) – index of the bin of size bin_size to select along the time dimension. Denotes exact start position in the time domain if given as string.
bin_size (Union[int,str]) – bin size for time filtering.
precomputed_bins (np.ndarray) – precomputed time bins. If provided, bin_size and bin_index are ignored.
samples_max (int) – Maximum number of samples taken for plotting to avoid excessive computation times. If the number of rows in a data set exceeds this number the data is downsampled accordingly.
roi_number (int) – Number of the ROI that should be used for the plot (all behavior that occurs outside of the ROI gets excluded)
animals_in_roi (list) – List of ids of the animals that need to be inside of the active ROI. All frames in which any of the given animals are not inside of the ROI get excluded
roi_mode (str) – Determines how the rois should be applied to different behaviors. Options are “mousewise” (default, selected mice needs to be inside the ROI) and “behaviorwise” (only mice involved in a behavior need to be inside of the ROI, only for supervised behaviors)
in_roi_criterion (str) – Criterion for in roi check, can be a single bodypart, a list of bodyparts or “all” bodyparts of a mouse
polar_depiction (bool) – if True, display as polar plot.
plot_speed (bool) – if supervised annotations are provided, display only speed. Useful to visualize speed.
add_stats (str) – test to use. Mann-Whitney (non-parametric) by default. See statsannotations documentation for details.
exp_condition (str) – Name of the experimental condition to use when plotting. If None (default) the first one available is used.
exp_condition_order (list) – Order in which to plot experimental conditions. If None (default), the order is determined by the order of the keys in the table dict.
normalize (bool) – whether to represent time fractions or actual time in seconds on the y axis.
verbose (bool) – if True, prints test results and p-value cutoffs. False by default.
unit_time (str) – Time unit (frames, seconds, minutes, hours) to display the result in the given unit
unit_distance (str) – Distance unit (millimeters, centimeters, meters) to display the result in the given unit
ax (plt.AxesSubplot) – axes where to plot the current figure. If not provided, new figure will be created.
save (bool) – Saves a time-stamped vectorized version of the figure if True.