optimize a number of functions

- Major optimization of the put_atom_in_box() function.
- Major optimization of the protein_precheck() function.
- Minor optimization in radial_volume_desolvation()
- Optimization in top_up() to scale for large structures.
This commit is contained in:
Matvey Adzhigirey
2012-12-04 17:21:24 -08:00
committed by Mike Beachy
parent e0ed5da44b
commit 73c7a2a4be
5 changed files with 24 additions and 28 deletions

View File

@@ -390,19 +390,12 @@ class Conformation_container:
def top_up(self, other):
""" Tops up self with all atoms found in other but not in self """
my_residue_labels = { a.residue_label for a in self.atoms }
for atom in other.atoms:
if not self.have_atom(atom):
if not atom.residue_label in my_residue_labels:
self.copy_atom(atom)
return
def have_atom(self, atom):
res = False
for a in self.atoms:
if a.residue_label == atom.residue_label:
res = True
break
return res
def find_group(self, group):
for g in self.groups:
if g.atom.residue_label == group.atom.residue_label: