msm_we.utils

Adapted from the original NMpathAnalysis package, https://github.com/ZuckermanLab/NMpathAnalysis

Functions

check_tmatrix(t_matrix[, accept_null_rows])

Check if the given matrix is actually a row-stochastic transition matrix

clean_tmatrix(transition_matrix[, rm_absorbing])

Removes the states/indexes with no transitions and that are absorbing

get_shape(trajectory)

Get the shape of a trajectory array in tuple (n_snapshots, n_variables)

map_to_integers(sequence[, mapping_dict])

Map a sequence of elements to a sequence of integers for intance, maps [1, 'a', 1, 'b', 2.2] to [0, 1, 0, 2, 3]

normalize(my_vector)

Normalize a vector

normalize_markov_matrix(transition_matrix[, ...])

Transform a matrix of positive elements to a markov-like matrix

num_of_nonzero_elements(my_vector)

Returns the number of non-zero elements in a vector

pops_from_nm_tmatrix(transition_matrix)

Computes the populations of the real/physical states

pops_from_tmatrix(transition_matrix)

Calculate the eigen values and eigen vectors of the transposed transition matrix

pseudo_nm_tmatrix(markovian_tmatrix, stateA, ...)

Obtain a pseudo non-Markovian transition matrix from a Markovian transiton matrix

random_markov_matrix([n_states, seed])

Returns a random transition markov matrix

reverse_sort_lists(list_1, list_2)

Reverse sorting two list based on the first one

weighted_choice(list_[, weights])

Select an element from a list with probability from weights

Classes

Interval(interval_set, n_variables)

Intervals are in general defined as half-open interval [start,end).