deepof.post_hoc.compute_transition_matrix_per_condition

deepof.post_hoc.compute_transition_matrix_per_condition(soft_counts: deepof_table_dict, exp_conditions: dict, silence_diagonal: bool = False, bin_info: dict | None = None, roi_number: int | None = None, animals_in_roi: list | None = None, aggregate: str = True, normalize: str = True)

Compute the transition matrices specific to each condition.

Parameters:
  • soft_counts (TableDict) – A dictionary of soft counts, where the keys are the names of the experimental conditions, and the values are the soft counts for each condition.

  • exp_conditions (dict) – A dictionary of experimental conditions, where the keys are the names of the experiments, and the values are the names of their corresponding

  • silence_diagonal (bool) – If True, diagonal elements on the transition matrix are set to zero.

  • bin_info (dict) – A dictionary containing start and end positions or indices of all sections for given embeddings and ROI information

  • 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

  • aggregate (str) – Whether to aggregate the embeddings across time.

  • normalize (str) – Whether to normalize the population of each cluster across conditions.

Returns:

A dictionary of transition matrices, where the keys are the names of the experimental conditions, and the values are the transition matrices for each condition.