deepof.visuals.plot_transitions
- deepof.visuals.plot_transitions(coordinates: deepof_coordinates, supervised_annotations: deepof_table_dict | None = None, soft_counts: deepof_table_dict | None = None, bin_size: int | str | None = None, bin_index: int | str | None = None, precomputed_bins: ndarray | None = None, samples_max: int = 20000, roi_number: int | None = None, animals_in_roi: list | None = None, exp_condition: str | None = None, delta_T: float = 0.0, silence_diagonal: bool = False, diagonal_behavior_counting: str = 'Transitions', normalize: bool = True, visualization='networks', ax: list | None = None, save: bool = False, **kwargs)
Compute and plots transition matrices for all data or per condition. Plots can be heatmaps or networks.
- Parameters:
coordinates (coordinates) – deepOF project where the data is stored.
supervised_annotations (table_dict) – table dict with supervised annotations.
soft_counts (table_dict) – table dict with soft cluster assignments per animal experiment across time.
bin_size (Union[int,str]) – bin size for time filtering.
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.
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
exp_condition (str) – Name of the experimental condition to use when plotting. If None (default) the first one available is used.
delta_T – Time after the offset of one behavior during which the onset of the next behavior counts as a transition
silence_diagonal (bool) – If True, diagonals are set to zero.
diagonal_behavior_counting (str) – How to count diagonals (self-transitions). Options: - “Frames”: Total frames where behavior is active (after extension) - “Time”: Total time where behavior is active - “Events”: number of instances of the behavior occuring - “Transitions”: number of frame-wise internal behavior transitions e.g. A behavior of 4 frames in length would have 3 transitions.
normalize (bool) – Row-normalizes transition probabilities if True. Default=True.
visualization (str) – visualization mode. Can be either ‘networks’, or ‘heatmaps’.
ax (list) – axes where to plot the current figure. If not provided, a new figure will be created.
save (bool) – Saves a time-stamped vectorized version of the figure if True.
kwargs – additional arguments to pass to the seaborn kdeplot function.