contact_map.ContactDifference¶
-
class
contact_map.
ContactDifference
(positive, negative)[source]¶ Contact map comparison (atomic and residue).
This can compare single frames or entire trajectories (or even mix the two!) While this can be directly instantiated by the user, the more common way to make this object is by using the
-
operator, i.e.,diff = map_1 - map_2
.Methods
__init__
(positive, negative)contact_map
(*args, **kwargs)from_file
(filename)Load this object from a given file most_common_atoms_for_contact
(contact_pair)Most common atom contacts for a given residue contact pair most_common_atoms_for_residue
(residue)Most common atom contact pairs for contacts with the given residue save_to_file
(filename[, mode])Save this object to the given file. -
cutoff
¶ float – cutoff distance for contacts, in nanometers
-
from_file
(filename)¶ Load this object from a given file
Parameters: filename (string) – the file to read from Returns: the reloaded object Return type: ContactObject
See also
save_to_file()
- save to a file
-
haystack
¶ list of int – indices of atoms to include as haystack
-
most_common_atoms_for_contact
(contact_pair)¶ Most common atom contacts for a given residue contact pair
Parameters: contact_pair (length 2 list of Residue or int) – the residue contact pair for which the most common atom contact pairs will be calculated Returns: Atom contact pairs for the residue contact pair, in order of frequency. Referring to the list as l
, each element of the listl[e]
consists of two parts:l[e][0]
is a list containing the two MDTraj Atom objects that make up the contact, andl[e][1]
is the measure of how often the contact occurs.Return type: list
-
most_common_atoms_for_residue
(residue)¶ Most common atom contact pairs for contacts with the given residue
Parameters: residue (Residue or int) – the Residue object or index representing the residue for which the most common atom contact pairs will be calculated Returns: Atom contact pairs involving given residue, order of frequency. Referring to the list as l
, each element of the listl[e]
consists of two parts:l[e][0]
is a list containing the two MDTraj Atom objects that make up the contact, andl[e][1]
is the measure of how often the contact occurs.Return type: list
-
n_neighbors_ignored
¶ int – number of neighbor residues (in same chain) to ignore
-
query
¶ list of int – indices of atoms to include as query
-
residue_ignore_atom_idxs
¶ dict – maps query residue index to atom indices to ignore
-
residue_query_atom_idxs
¶ dict – maps query residue index to atom indices in query
-
save_to_file
(filename, mode='w')¶ Save this object to the given file.
Parameters: - filename (string) – the file to write to
- mode ('w' or 'a') – file writing mode. Use ‘w’ to overwrite, ‘a’ to append. Note that writing by bytes (‘b’ flag) is automatically added.
See also
from_file()
- load from generated file
-
topology
¶ mdtraj.Topology
– topology object for this systemThe topology includes information about the atoms, how they are grouped into residues, and how the residues are grouped into chains.
-