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)Initialize self.
contact_map(*args, **kwargs)Returns atom and residue contact maps for the given frame.
convert_atom_contacts(atom_contacts)from_dict(dct)Create object from dict.
from_file(filename)Load this object from a given file
from_json(json_string)Create object from JSON string
idx_to_s_idx(idx)function to convert a real atom index to a sliced one
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
s_idx_to_idx(idx)function to convert a sliced atom index back to real index
save_to_file(filename[, mode])Save this object to the given file.
slice_trajectory(trajectory)to_dict()Convert object to a dict.
to_json()JSON-serialized version of this object.
Attributes
all_atomsall atom indices used in the contact map
atom_contactscontactscontact dict for these contacts
cutoffcutoff distance for contacts, in nanometers
haystackindices of atoms to include as haystack
haystack_residue_rangemin and (max + 1) of haystack residue indices
haystack_residuesresidues for atoms in the haystack
n_neighbors_ignorednumber of neighbor residues (in same chain) to ignore
queryindices of atoms to include as query
query_residue_rangemin and (max + 1) of query residue indices
query_residuesresidues for atoms in the query
residue_contactsresidue_ignore_atom_idxsmaps query residue index to atom indices to ignore
residue_query_atom_idxsmaps query residue index to atom indices in query
topologymdtraj.Topology: topology object for this systemuse_atom_sliceIndicates if mdtraj.atom_slice() is used before calculating the contact map