htmd.mutualinformation module#

class htmd.mutualinformation.MutualInformation(model: Model, mol: Molecule | None = None, fstep: float = 0.1, skip: int = 1)#

Bases: object

calculate(njobs: int = 1)#

Calculate the mutual information matrix.

Parameters:

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

loadMI(path: str)#

Load the mutual information matrix from a file.

Parameters:

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

saveMI(path: str)#

Save the mutual information matrix to a file.

Parameters:

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

save_graphml(path: str)#

Save the weighted graph to a GraphML file.

Parameters:

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

weightGraph(datacontacts: MetricData, mi_threshold: float, time_treshold: float = 0.6)#

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

Parameters:
  • datacontacts (MetricData object) – 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, optional) – Fraction of total frames a contact must be present to be included.