Package csb :: Package bio :: Package nmr :: Class ContactMap

[frames] | no frames]

# Class ContactMap

source code

    object --+
             |
            ContactMap

Describes a protein contact map. Atoms positioned at distance below a given cutoff are considered to be in contact.

Instance Methods

__contains__(self, atom) | source code

__init__(self, chain, cutoff=6.0, filter=None) x.__init__(...) initializes x; see help(type(x)) for signature | source code

__iter__(self) | source code

frozenset of Atom

atom_contacts(self, atom) Return all atoms within `self.cutoff` angstroms of `atom`. | source code

numpy.array (2D)

atom_matrix(self) Build a 2D binary contact matrix (0=no contact, 1=contact). | source code

build(self) Extract all contacts from the chain using the current distance cutoff. | source code

connect(self, atom1, atom2) Define a contact between `atom1` and `atom2`. | source code

connected(self, atom1, atom2) Return True if the specified atoms are in contact. | source code

draw(self, plot, color=`'``black``'`) Visualize this contact map. | source code

float

position(self, rank, atom_name) Compute the location of `atom` on the contact map. | source code

frozenset of Residue

residue_contacts(self, residue) Return all residues, having neighboring atoms within `self.cutoff` angstroms from any of the `residue`'s atoms. | source code

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Static Methods

ContactMapComparisonInfo

compare(query, reference, min_distance=0) Compare a query contact map against a reference. | source code

load(filename) Deserialize from a pickle. | source code

Class Variables
| DISTANCE_CUTOFF = `6.0`

Properties
tuple of Atom | atoms All atoms involved in this map, sorted by residue number
Chain | chain Source protein chain
iterator of 2-tuples | contacts All atom contacts: an iterator over all contacting (Atom, Atom) pairs.
float | cutoff Distance cutoff in Angstroms
Inherited from `object`: `__class__`

Method Details

### __init__(self, chain, cutoff=6.0, filter=None)
(Constructor)

source code

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  - `chain` (csb.bio.structure.Chain) - source protein chain
  - `cutoff` (float) - distance cutoff in angstroms
  - `filter` (lambda) - a callable with signature 'bool def(csb.bio.structure.Atom)', invoked for every atom, which determines whether a given atom should be skipped (False) or considered (True). See Filters
Overrides: object.__init__
  (inherited documentation)

### atom_contacts(self, atom)

source code

Return all atoms within `self.cutoff` angstroms of `atom`.

Parameters:
  - `atom` (Atom) - anchor atom
Returns: frozenset of Atom

### atom_matrix(self)

source code

Build a 2D binary contact matrix (0=no contact, 1=contact). The order of elements in each dimension will match the order of atoms in the contact map (see ContactMap.atoms and iter(ContactMap). That means, the atoms in each dimension are sorted by residue number first.

Returns: numpy.array (2D)

Deprecated: This method can be removed in future versions

### compare(query, reference, min_distance=0)
Static Method

source code

Compare a query contact map against a reference.

Parameters:
  - `min_distance` (int) - consider only contacts between atoms, separated by the given minimum number of residues
  - `query` (ContactMap)
  - `reference` (ContactMap)
Returns: ContactMapComparisonInfo
  precision and coverage

### connect(self, atom1, atom2)

source code

Define a contact between `atom1` and `atom2`.

Parameters:
  - `atom1` (Atom) - first atom
  - `atom2` (Atom) - second atom

### connected(self, atom1, atom2)

source code

Return True if the specified atoms are in contact.

Parameters:
  - `atom1` (Atom) - first atom
  - `atom2` (Atom) - second atom

### draw(self, plot, color=`'``black``'`)

source code

Visualize this contact map.

Parameters:
  - `plot` (matplotlib.AxesSubplot) - csb.io.plots.Chart's plot to draw on
  - `color` (str) - pixel color (must be a matplotlib color constant)

### position(self, rank, atom_name)

source code

Compute the location of `atom` on the contact map.

Parameters:
  - `rank` (int) - residue rank (1-based)
  - `atom_name` (str) - atom name
Returns: float

### residue_contacts(self, residue)

source code

Return all residues, having neighboring atoms within `self.cutoff` angstroms from any of the `residue`'s atoms.

Parameters:
  - `residue` (Residue) - anchor residue
Returns: frozenset of Residue

Property Details

### atoms

All atoms involved in this map, sorted by residue number

Get Method:
  unreachable.atoms(self) - All atoms involved in this map, sorted by residue number
Type:
  tuple of Atom

### chain

Source protein chain

Get Method:
  unreachable.chain(self) - Source protein chain
Type:
  Chain

### contacts

All atom contacts: an iterator over all contacting (Atom, Atom) pairs.

Get Method:
  unreachable.contacts(self) - All atom contacts: an iterator over all contacting (Atom, Atom) pairs.
Type:
  iterator of 2-tuples

### cutoff

Distance cutoff in Angstroms

Get Method:
  unreachable.cutoff(self) - Distance cutoff in Angstroms
Type:
  float