contacts
Create contact maps between two atom groups.
This module provides the MapContacts class, which creates the initial contact map between the two atom groups using a maximum cutoff (max_cutoff), which provides for quicker processing if creating results for multiple cutoffs. The ProcessContacts class takes the initial contact map and creates the processed contact map based on the prescribed cutoff.
- class contacts.CombineContacts(contact_files, output_name='combined_contacts.pkl', validate_compatibility=True)[source]
Class to combine contact timeseries from multiple repeat runs.
This class enables pooling data from multiple trajectory repeats and calculating posteriors from all data together, rather than analyzing each run separately.
- Parameters:
- class contacts.MapContacts(u, ag1, ag2, nproc=1, frames=None, max_cutoff=10.0, nslices=100)[source]
This class is used to create the map of contacts between two groups of atoms. A single cutoff is used to define a contact between the two groups, where if any atomic distance between the two groups is less than the cutoff, a contact is considered formed.
- Parameters:
u (MDAnalysis Universe) – Universe containing the topology and trajectory for which the contacts will be computed.
ag1 (MDAnalysis AtomGroup) – Primary AtomGroup for which contacts will be computed, typically a protein.
ag2 (MDAnalysis AtomGroup) – Secondary AtomGroup which forms contacts with ag1, typically lipids, ions, or other small molecules. Each residue of ag2 must have the same number of atoms.
nproc (int, optional) – Number of processes to use in computing contacts (default is 1).
frames (list or np.array, optional) – List of frames to use in computing contacts (default is None, meaning all frames are used).
max_cutoff (float, optional) – Maximum cutoff to use in computing contacts. A primary contact map is created upon which multiple cutoffs can be imposed, i.e. in the case where a proper cutoff is being determined. This can typically be left at its default value, unless a greater value is needed (default is 10.0).
nslices (int, optional) – Number of slices to break the trajectory into for processing. If device memory is limited, try increasing nslices (default is 100).