rmcgibbo/mixtape — pull request #308 by schwancr (2014-11-18 20:06:58+00:00)
Title: [WIP] Add TPT to mixtape

So the msmbuilder2 code has these functions:

```def _ensure_iterable(arg):
def _check_sources_sinks(sources, sinks):
def get_top_path_scipy(sources, sinks, net_flux):
def get_top_path(sources, sinks, net_flux):
def get_paths(sources, sinks, net_flux, num_paths=np.inf, flux_cutoff=(1-1E-10)):
def _get_enumerated_paths(sources, sinks, net_flux, num_paths=1):
def _find_top_paths_cut(sources, sinks, tprob, num_paths=10, node_wipe=False, net_flux=None):
def _Dijkstra(sources, sinks, net_flux):
def _back_relax(s, b, pi, NFlux):
def _backtrack(B, b, pi, NFlux):
def find_path_bottleneck(path, net_flux):
def calculate_fluxes(sources, sinks, tprob, populations=None, committors=None):
def calculate_net_fluxes(sources, sinks, tprob, populations=None, committors=None):
def calculate_ensemble_mfpt(sources, sinks, tprob, lag_time):
def calculate_avg_TP_time(sources, sinks, tprob, lag_time):
def calculate_mfpt(sinks, tprob, lag_time=1.):
def calculate_all_to_all_mfpt(tprob, populations=None):
def calculate_committors(sources, sinks, tprob):
def calculate_fraction_visits(tprob, waypoint, source, sink, return_cond_Q=False):
def calculate_hub_score(tprob, waypoint):
def calculate_all_hub_scores(tprob): ```

We need to decide which ones we want to keep in mixtape. I came up with the following decomposition:

paths.py : contains code for finding paths from a net flux matrix
fluxes.py : contains code for computing flux matrices (and commitors) from an msm
mfpts.py : contains code for calculating mfpt's from an msm
hubs.py : contains hub-score stuff

So, I think the first three we should definitely keep. We can debate the last one (@tjlane, do you care?)

I don't think any of these really make sense as an estimator (and the current API doesn't really fit that anyway since they'd be transforming an MSM, which is not a transform of sequences), so I'm just going to have a bunch of functions.

Finally, for the path stuff as we debated in pandegroup/msmbuilder#257, there will be two algorithms for computing multiple paths:
1) bottleneck : find the next path by removing the bottleneck of the last path calculated
2) subtraction : subtract the flux of the path (bottleneck flux) from *all* edges in the last path

I'll probably set (2) as the default.