Class Grid
java.lang.Object
org.biojava.nbio.structure.contact.Grid
A grid to be used for calculating atom contacts through geometric hashing algorithm.
The grid is composed of cells of size of the cutoff so that the distances that need to be calculated
are reduced to those within each cell and to the neighbouring cells.
- Author:
- duarte_j
-
Constructor Summary
ConstructorDescriptionGrid
(double cutoff) Creates aGrid
, the cutoff is in Angstroms and can be specified to a precision of 0.01A -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a set of atoms, subsequent call to getContacts will produce the interatomic contacts.void
Adds the i and j atoms and fills the grid.void
addAtoms
(Atom[] atoms, BoundingBox bounds) Adds a set of atoms, subsequent call to getContacts will produce the interatomic contacts.void
addAtoms
(Atom[] iAtoms, BoundingBox icoordbounds, Atom[] jAtoms, BoundingBox jcoordbounds) Adds the i and j atoms and fills the grid, passing their bounds (array of size 6 with x,y,z minima and x,y,z maxima) This way the bounds don't need to be recomputed.Returns all contacts, i.e.double
boolean
Tells whether (after having added atoms to grid) the i and j grids are not overlapping.
-
Constructor Details
-
Grid
public Grid(double cutoff) Creates aGrid
, the cutoff is in Angstroms and can be specified to a precision of 0.01A- Parameters:
cutoff
-
-
-
Method Details
-
addAtoms
Adds the i and j atoms and fills the grid. Their bounds will be computed.- Parameters:
iAtoms
-jAtoms
-
-
addAtoms
public void addAtoms(Atom[] iAtoms, BoundingBox icoordbounds, Atom[] jAtoms, BoundingBox jcoordbounds) Adds the i and j atoms and fills the grid, passing their bounds (array of size 6 with x,y,z minima and x,y,z maxima) This way the bounds don't need to be recomputed.- Parameters:
iAtoms
-icoordbounds
-jAtoms
-jcoordbounds
-
-
addAtoms
Adds a set of atoms, subsequent call to getContacts will produce the interatomic contacts. The bounding box of the atoms will be computed based on input array- Parameters:
atoms
-
-
addAtoms
Adds a set of atoms, subsequent call to getContacts will produce the interatomic contacts. The bounds calculated elsewhere can be passed, or if null they are computed.- Parameters:
atoms
-bounds
-
-
getContacts
Returns all contacts, i.e. all atoms that are within the cutoff distance. If both iAtoms and jAtoms are defined then contacts are between iAtoms and jAtoms, if jAtoms is null, then contacts are within the iAtoms.- Returns:
-
getCutoff
public double getCutoff() -
isNoOverlap
public boolean isNoOverlap()Tells whether (after having added atoms to grid) the i and j grids are not overlapping. Overlap is defined as enclosing bounds of the 2 grids being no more than one cell size apart.- Returns:
- true if the 2 grids don't overlap, false if they do
-