Bio :: PDB :: NeighborSearch :: NeighborSearch :: Class NeighborSearch
[hide private]
[frames] | no frames]

Class NeighborSearch

source code

object --+
         |
        NeighborSearch


This class can be used for two related purposes:

1. To find all atoms/residues/chains/models/structures within radius
of a given query position.

2. To find all atoms/residues/chains/models/structures that are within
a fixed radius of each other.

NeighborSearch makes use of the Bio.KDTree C++ module, so it's fast.

Instance Methods [hide private]
 
__init__(self, atom_list, bucket_size=10)
o atom_list - list of atoms.
source code
 
_get_unique_parent_pairs(self, pair_list) source code
 
search(self, center, radius, level="A")
Neighbor search.
source code
 
search_all(self, radius, level="A")
All neighbor search.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, atom_list, bucket_size=10)
(Constructor)

source code 

o atom_list - list of atoms. This list is used in the queries.
It can contain atoms from different structures.
o bucket_size - bucket size of KD tree. You can play around
with this to optimize speed if you feel like it.

Overrides: object.__init__

search(self, center, radius, level="A")

source code 
Neighbor search.

Return all atoms/residues/chains/models/structures
that have at least one atom within radius of center.
What entitity level is returned (e.g. atoms or residues)
is determined by level (A=atoms, R=residues, C=chains,
M=models, S=structures).

o center - Numeric array
o radius - float
o level - char (A, R, C, M, S)

search_all(self, radius, level="A")

source code 
All neighbor search.

Search all entities that have atoms pairs within
radius.

o radius - float
o level - char (A, R, C, M, S)