Clustering::MPP Namespace Reference

functions related to "Most Probable Path"-clustering More...

Typedefs

using SparseMatrixF = boost::numeric::ublas::mapped_matrix< float >
 BOOST implementation of a sparse matrix for floats.
 
using Neighborhood = Clustering::Tools::Neighborhood
 Neighborhood per frame.
 

Functions

SparseMatrixF read_transition_probabilities (std::string fname)
 read (row-normalized) transition matrix from file
 
SparseMatrixF transition_counts (std::vector< std::size_t > trajectory, std::vector< std::size_t > concat_limits, std::size_t n_lag_steps, std::size_t i_max)
 
SparseMatrixF weighted_transition_counts (std::vector< std::size_t > trajectory, std::vector< std::size_t > concat_limits, std::size_t n_lag_steps)
 
SparseMatrixF row_normalized_transition_probabilities (SparseMatrixF count_matrix, std::set< std::size_t > microstate_names)
 compute transition matrix from counts by normalization of rows
 
SparseMatrixF updated_transition_probabilities (SparseMatrixF transition_matrix, std::map< std::size_t, std::size_t > sinks, std::map< std::size_t, std::size_t > pops)
 update transition matrix after lumping states into sinks
 
std::map< std::size_t, std::size_t > single_step_future_state (SparseMatrixF transition_matrix, std::set< std::size_t > cluster_names, float q_min, std::map< std::size_t, float > min_free_energy)
 
std::map< std::size_t, std::vector< std::size_t > > most_probable_path (std::map< std::size_t, std::size_t > future_state, std::set< std::size_t > cluster_names)
 
std::map< std::size_t, std::size_t > microstate_populations (std::vector< std::size_t > clusters, std::set< std::size_t > cluster_names)
 compute cluster populations
 
std::map< std::size_t, float > microstate_min_free_energy (const std::vector< std::size_t > &clustering, const std::vector< float > &free_energy)
 
std::map< std::size_t, std::size_t > path_sinks (std::vector< std::size_t > clusters, std::map< std::size_t, std::vector< std::size_t >> mpp, SparseMatrixF transition_matrix, std::set< std::size_t > cluster_names, float q_min, std::vector< float > free_energy)
 
std::vector< std::size_t > lumped_trajectory (std::vector< std::size_t > trajectory, std::map< std::size_t, std::size_t > sinks)
 
std::tuple< std::vector< std::size_t >, std::map< std::size_t, std::size_t >, SparseMatrixFfixed_metastability_clustering (std::vector< std::size_t > initial_trajectory, SparseMatrixF trans_prob, float q_min, std::vector< float > free_energy)
 run clustering for given Q_min value
 
void main (boost::program_options::variables_map args)
 MPP clustering control function and user interface. More...
 

Detailed Description

functions related to "Most Probable Path"-clustering

This module contains all function for dynamical clustering. In contrast to density-based clustering, can it only be applied to previously clustered trajectories. The idea is to create, based on a microstate input, a coarse-grained model (macrostates). The most probable path depends strongly on the selected timescale (mpp time). If the input was dynamically cored, the mpp time needs to be greater than the coring time.

Function Documentation

◆ lumped_trajectory()

std::vector< std::size_t > Clustering::MPP::lumped_trajectory ( std::vector< std::size_t >  trajectory,
std::map< std::size_t, std::size_t >  sinks 
)

lump states based on path sinks and return new trajectory. new microstates will have IDs of sinks.

Definition at line 400 of file mpp.cpp.

◆ main()

void Clustering::MPP::main ( boost::program_options::variables_map  args)

MPP clustering control function and user interface.

Parameters
inputinput file with microstate trajectory
basenamename format for output files
lagtimelag for transition estimation in units of frame numbers
qmin-fromlower limit for metastability (Q_min)
qmin-toupper limit for metastability (Q_min)
qmin-stepstepping for metastability (Q_min)
concat-nframesno. of frames per trajectory.
concat-limitslength of concated trajectories.
Returns
void
Note
Lagtime should be greater than the coring time/ smallest timescale.

Definition at line 487 of file mpp.cpp.

◆ microstate_min_free_energy()

std::map< std::size_t, float > Clustering::MPP::microstate_min_free_energy ( const std::vector< std::size_t > &  clustering,
const std::vector< float > &  free_energy 
)

assign every state the lowest free energy value of all of its frames.

Definition at line 320 of file mpp.cpp.

◆ most_probable_path()

std::map< std::size_t, std::vector< std::size_t > > Clustering::MPP::most_probable_path ( std::map< std::size_t, std::size_t >  future_state,
std::set< std::size_t >  cluster_names 
)

for every state, compute most probable path by following the 'future_state'-mapping recursively

Definition at line 288 of file mpp.cpp.

◆ path_sinks()

std::map< std::size_t, std::size_t > Clustering::MPP::path_sinks ( std::vector< std::size_t >  clusters,
std::map< std::size_t, std::vector< std::size_t >>  mpp,
SparseMatrixF  transition_matrix,
std::set< std::size_t >  cluster_names,
float  q_min,
std::vector< float >  free_energy 
)

compute path sinks, i.e. states of highest metastability, and lowest free energy per path. these sinks will be states all other states of the given path will be lumped into.

Definition at line 337 of file mpp.cpp.

◆ single_step_future_state()

std::map< std::size_t, std::size_t > Clustering::MPP::single_step_future_state ( SparseMatrixF  transition_matrix,
std::set< std::size_t >  cluster_names,
float  q_min,
std::map< std::size_t, float >  min_free_energy 
)

compute immediate future (i.e. without lag) of every state from highest probable transitions; exclude self-transitions.

Definition at line 234 of file mpp.cpp.

◆ transition_counts()

SparseMatrixF Clustering::MPP::transition_counts ( std::vector< std::size_t >  trajectory,
std::vector< std::size_t >  concat_limits,
std::size_t  n_lag_steps,
std::size_t  i_max = 0 
)

count transitions from one to the other cluster with certain lag and return as count matrix (row/col := from/to)

Definition at line 78 of file mpp.cpp.

◆ weighted_transition_counts()

SparseMatrixF Clustering::MPP::weighted_transition_counts ( std::vector< std::size_t >  trajectory,
std::vector< std::size_t >  concat_limits,
std::size_t  n_lag_steps 
)

same as 'transition_counts', but with reweighting account for differently sized trajectory chunks (as given by concat_limits)

Definition at line 113 of file mpp.cpp.