cells¶

Cell list to facilitate neighbor searching.

class pdb2pqr.cells.Cells(cellsize)[source]

Accelerate the search for nearby atoms.

A pure all versus all search is O(n^2) - for every atom, every other atom must be searched. This is rather inefficient, especially for large biomolecules where cells may be tens of angstroms apart. The cell class breaks down the xyz biomolecule space into several 3-D cells of desired size - then by simply examining atoms that fall into the adjacent cells one can quickly find nearby cells.

__init__(cellsize)[source]

Initialize the cells.

Parameters: cellsize (int) – the size of each cell (in Angstroms)
add_cell(atom)[source]

Add an atom to the cell.

Parameters: atom (Atom) – the atom to add
assign_cells(biomolecule)[source]

Place each atom in a virtual cell for easy neighbor comparison.

Parameters: biomolecule (Biomolecule) – biomolecule with atoms to assign to cells
get_near_cells(atom)[source]

Find all atoms in cells bordering an atom.

Parameters: atom (Atom) – the atom to test a list of nearby atoms [Atom]
remove_cell(atom)[source]

Remove an atom from a cell.

Parameters: atom (Atom) – the atom to remove