htmd.mutualinformation module#

class htmd.mutualinformation.MutualInformation(model, mol=None, fstep=0.1, skip=1)#

Bases: object

calculate(njobs=1)#

Calculate the mutual information matrix.

Parameters:

njobs (int) – Number of parallel jobs to spawn for the calculation of MI.

loadMI(path)#

Load the mutual information matrix from a file.

Parameters:

path (str) – Path of the .npy file to load the matrix from.

saveMI(path)#

Save the mutual information matrix to a file.

Parameters:

path (str) – Path of the .npy file to save the matrix to.

save_graphml(path)#

Save the weighted graph to a GraphML file.

Parameters:

path (str) – Path of the GraphML file to write.

weightGraph(datacontacts, mi_threshold, time_treshold=0.6)#

Build a weighted graph from the MI matrix filtered by contact frequency.

Parameters:
  • datacontacts (MetricData) – A MetricData object containing contact data used to filter MI edges.

  • mi_threshold (float) – Only edges with MI value above this threshold are kept.

  • time_treshold (float) – Fraction of total frames a contact must be present to be included.