combine_states module

itrails.combine_states.combine_states(state_dict_1, state_dict_2, state_dict_sum, final_probs_1, final_probs_2)[source]

Function that combines two dictionaries of individual states and their final probabilities into a single dictionary of combined states and starting probabilities.

Parameters:
  • state_dict_1 (Numba Dictionary of Key: Tuple of int64 and Value: int64.) – Dictionary of states and indices for the first CTMC, can be 1 sequence or 2 sequence CTMC.

  • state_dict_2 (Numba Dictionary of Key: Tuple(int64, int64) and Value: int64) – Dictionary of states and indices for the second CTMC, can only be 1 sequence CTMC.

  • state_dict_sum (Numba Dictionary of Key: Tuple of int64 and Value: int64.) – Dictionary of states and indices for the combined CTMC.

  • final_probs_1 (Array of type: float64[:, :]) – Array of final probabilities for a single key of the first CTMC.

  • final_probs_2 (Array of type: float64[:, :]) – Array of final probabilities for the only key of the second CTMC.

Returns:

Array of starting probabilities for each combined state in the combined CTMC.

Return type:

Array of type: float64[:, :]

itrails.combine_states.combine_states_wrapper(state_dict_1, state_dict_2, state_dict_sum, final_probs_1, final_probs_2)[source]

Wrapper function that combines dictionaries of states and their final probabilities into a single dictionary of combined states and starting probabilities.

Parameters:
  • state_dict_1 (Numba Dictionary of Key: Tuple of int64 and Value: int64.) – Dictionary of states and indices for the first CTMC, can be 1 sequence or 2 sequence CTMC.

  • state_dict_2 (Numba Dictionary of Key: Tuple(int64, int64) and Value: int64.) – Dictionary of states and indices for the second CTMC, can only be 1 sequence CTMC.

  • state_dict_sum (Numba Dictionary of Key: Tuple of int64 and Value: int64.) – Dictionary of states and indices for the combined CTMC.

  • final_probs_1 (Numba Dictionary of Key: UniTuple(nb.types.UniTuple(int64, 3), 2) and Value: float64[:, :].) – Final probability dictionary for the first CTMC.

  • final_probs_2 (Numba Dictionary of Key: UniTuple(nb.types.UniTuple(int64, 3), 2) and Value: float64[:, :].) – Final probability dictionary for the second CTMC.

Raises:
  • NotImplementedError – Not implemented for more than 2 species in state_dict_1 or and more than 1 species in state_dict_2.

  • Exception – Fallback if invalid format in final_probs_1 or final_probs_2.

Returns:

Dictionary of combined states and starting probabilities for each state.

Return type:

Numba Dictionary of Key: UniTuple(nb.types.UniTuple(int64, 3), 2) and Value: float64[:, :].