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 :Parameters: * trajectories (list of obj:mdtraj.Trajectory) * n_frames_per_traj (int, default is 20) -- Stride the trajectories so that, on average, this number of frames is used to compute the contacts * kwargs_mdcontacts

contact_matrix_slim(trajectories[, cutoff_Ang])

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

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, **kwargs_mdcontacts)

Return a matrix with the contact frequency for all possible contacts over all available frames :Parameters: * trajectories (list of obj:mdtraj.Trajectory)

  • n_frames_per_traj (int, default is 20) – Stride the trajectories so that, on average, this number of frames is used to compute the contacts

  • kwargs_mdcontacts

Returns:

ctc_freq

Return type:

square 2D np.ndarray

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

Return a matrix with the contact frequency for all possible contacts over all available frames :Parameters: * trajectories (list of obj:mdtraj.Trajectory)

  • n_frames_per_traj (int, default is 20) – Stride the trajectories so that, on average, this number of frames is used to compute the contacts

  • kwargs_mdcontacts

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, **kwargs_mdcontacts)

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

Return type:

ctc_mat