Class Grid
- java.lang.Object
-
- org.biojava.nbio.structure.contact.Grid
-
public class Grid extends java.lang.Object
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
Constructors Constructor Description Grid(double cutoff)
Creates aGrid
, the cutoff is in Angstroms and can be specified to a precision of 0.01A
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAtoms(Atom[] atoms)
Adds a set of atoms, subsequent call to getContacts will produce the interatomic contacts.void
addAtoms(Atom[] iAtoms, Atom[] jAtoms)
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.AtomContactSet
getContacts()
Returns all contacts, i.e.double
getCutoff()
boolean
isNoOverlap()
Tells whether (after having added atoms to grid) the i and j grids are not overlapping.
-
-
-
Method Detail
-
addAtoms
public void addAtoms(Atom[] iAtoms, Atom[] jAtoms)
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
public void addAtoms(Atom[] atoms)
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
public void addAtoms(Atom[] atoms, BoundingBox bounds)
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
public AtomContactSet 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
-
-