Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_PDB_KDTree.NeighborTest Class Reference

List of all members.

Public Member Functions

def test_neighbor_search

Public Attributes

 coord

Detailed Description

Definition at line 31 of file test_PDB_KDTree.py.


Member Function Documentation

NeighborSearch: Find nearby randomly generated coordinates.
 
Based on the self test in Bio.PDB.NeighborSearch.

Definition at line 32 of file test_PDB_KDTree.py.

00032 
00033     def test_neighbor_search(self):
00034         """NeighborSearch: Find nearby randomly generated coordinates.
00035          
00036         Based on the self test in Bio.PDB.NeighborSearch.
00037         """
00038         class RandomAtom:
00039             def __init__(self):
00040                 self.coord = 100 * random(3)
00041             def get_coord(self):
00042                 return self.coord
00043         for i in range(0, 20):
00044             atoms = [RandomAtom() for j in range(100)]
00045             ns = NeighborSearch(atoms)
00046             hits = ns.search_all(5.0)
00047             self.assertTrue(isinstance(hits, list), hits)
00048             self.assertTrue(len(hits) >= 0, hits)
00049         x = array([250,250,250]) #Far away from our random atoms
00050         self.assertEqual([], ns.search(x, 5.0, "A"))
00051         self.assertEqual([], ns.search(x, 5.0, "R"))
00052         self.assertEqual([], ns.search(x, 5.0, "C"))
00053         self.assertEqual([], ns.search(x, 5.0, "M"))
00054         self.assertEqual([], ns.search(x, 5.0, "S"))
00055 

Here is the call graph for this function:


Member Data Documentation

Definition at line 39 of file test_PDB_KDTree.py.


The documentation for this class was generated from the following file: