mdciao.utils.contact_matrix

Functions related to contact-map operations (WIP)

Functions

contact_map([topology, trajectories, …])

contact_map_to_dict(imat, top[, res_idxs, …])

contact_matrix(trajectories[, cutoff_Ang, …])

Return a matrix with the contact frequency for all possible contacts over all available frames :param trajectories: :type trajectories: list of obj:mdtraj.Trajectory :param n_frames_per_traj: Stride the trajectories so that, on average, this number of frames is used to compute the contacts :type n_frames_per_traj: int, default is 20 :param mdcontacts_kwargs:

contact_matrix_slim(trajectories[, cutoff_Ang])

Return a matrix with the contact frequency for all possible contacts over all available frames :param trajectories: :type trajectories: list of obj:mdtraj.Trajectory :param n_frames_per_traj: Stride the trajectories so that, on average, this number of frames is used to compute the contacts :type n_frames_per_traj: int, default is 20 :param mdcontacts_kwargs:

per_xtc_ctc_mat_dict(top, itraj, …)

xtcs2ctc_mat_dict(xtcs, top, list_ctc_cutoff_Ang)

Returns the full contact map of residue-residue contacts from a list of trajectory files

mdciao.utils.contact_matrix.contact_matrix(trajectories, cutoff_Ang=3, n_frames_per_traj=20, **mdcontacts_kwargs)

Return a matrix with the contact frequency for all possible contacts over all available frames :param trajectories: :type trajectories: list of obj:mdtraj.Trajectory :param n_frames_per_traj: Stride the trajectories so that, on average, this number of frames

is used to compute the contacts

Parameters

mdcontacts_kwargs

Returns

ctc_freq

Return type

square 2D np.ndarray

mdciao.utils.contact_matrix.contact_matrix_slim(trajectories, cutoff_Ang=3, **mdcontacts_kwargs)

Return a matrix with the contact frequency for all possible contacts over all available frames :param trajectories: :type trajectories: list of obj:mdtraj.Trajectory :param n_frames_per_traj: Stride the trajectories so that, on average, this number of frames

is used to compute the contacts

Parameters

mdcontacts_kwargs

Returns

ctc_freq

Return type

square 2D np.ndarray

mdciao.utils.contact_matrix.xtcs2ctc_mat_dict(xtcs, top, list_ctc_cutoff_Ang, stride=1, return_time=False, res_COM_cutoff_Ang=25, chunksize=100, n_jobs=1, progressbar=False, **mdcontacts_kwargs)

Returns the full contact map of residue-residue contacts from a list of trajectory files

Parameters
  • xtcs (list of strings) – list of filenames with trajectory data. Typically xtcs, but can be any type of file readable by :obj:mdtraj

  • top (str or mdtraj.Topology) – Topology that matches :obj:xtcs

  • stride (int, default is 1) – Stride the trajectory data down by this value

  • chunksize (integer, default is 100) – How many frames will be read into memory for computation of the contact time-traces. The higher the number, the higher the memory requirements

  • n_jobs (int, default is 1) – to how many processors to parallellize

Returns

Return type

ctc_mat