int_get_tab module

itrails.int_get_tab.get_tab_ABC_introgression(state_space_ABC, trans_mat_ABC, cut_ABC, pi_ABC, names_tab_AB, n_int_AB, tmp_path)[source]

This functions returns a table with joint probabilities of the states of the HMM after running a three-sequence CTMC

Parameters:
  • state_space_ABC (list of lists of tuples) – States of the whole state space of the three-sequence CTMC

  • trans_mat_ABC (numeric numpy matrix) – Transition rate matrix of the three-sequence CTMC

  • cut_ABC (list of floats) – Ordered cutpoints of the three-sequence CTMC

  • pi_ABC (list of floats) – Starting probabilities after merging a one-sequence and a two-sequence CTMCs.

  • names_tab_AB (list of tuples) – List of fates for the starting probabilities, as outputted by get_tab_AB().

  • n_int_AB (integer) – Number of intervals in the two-sequence CTMC

itrails.int_get_tab.get_tab_AB_introgression(state_space_AB, state_space_AB_miss, state_space_BC, state_space_BC_miss, state_space_A, state_space_C, state_space_ABC, pi_AB_full, pi_AB_miss, pi_BC_full, pi_BC_miss, final_A_bis, final_C_bis, pr_AB, pr_AB_miss, pr_BC, pr_BC_miss, n_int_AB)[source]
itrails.int_get_tab.mix_probs(state_space_AB_miss, state_space_BC_miss, state_space_AB, state_space_BC, state_space_A, state_space_C, state_space_ABC, final_AB_miss, final_BC_miss, final_AB_full, final_BC_full, final_A_bis, final_C_bis, pi_AB_miss, pi_BC_miss)[source]

This function mixes the probabilities of all CTMCs when reaching the second speciation event to get the starting probabilities of the three-sequence CTMC in deep time.

Parameters:
  • state_space_* (list of lists of tuples) –

    The state space for…

    *AB_miss (the left path when one B lineage is missing) *BC_miss (the right path when one B lineage is missing) *AB (the right path when no B lineages are missing) *BC (the left path when no B lineages are missing) *A (the one-sequence CTMC for A) *C (the one-sequence CTMC for C) *ABC (the three-sequence CTMC deep in time)

  • final_* (list of floats) –

    The final probabilities for…

    *AB_miss (the left path when one B lineage is missing) *BC_miss (the right path when one B lineage is missing) *AB_full (the right path when no B lineages are missing) *BC_full (the left path when no B lineages are missing) *A_bis (the one-sequence CTMC for A, from present to second speciatione event) *C_bis (the one-sequence CTMC for C, from present to second speciatione event)

itrails.int_get_tab.pool_AB_total(L, r, R)[source]