From 3e2e68e286ad71bab1fc8ce051322ce85a814831 Mon Sep 17 00:00:00 2001 From: Christoph Klein Date: Sun, 22 Feb 2015 16:09:18 -0600 Subject: [PATCH] updated opls145B; fixed unneccessary rebuilding of compound.atoms in traj.update_compound --- mosdef_gomc/tools/parameterize/oplsaa.py | 9 ++------- mosdef_gomc/trajectory.py | 9 ++++----- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/mosdef_gomc/tools/parameterize/oplsaa.py b/mosdef_gomc/tools/parameterize/oplsaa.py index 7d4ce041..94f6ae2d 100755 --- a/mosdef_gomc/tools/parameterize/oplsaa.py +++ b/mosdef_gomc/tools/parameterize/oplsaa.py @@ -121,17 +121,12 @@ def opls_145(atom): @Element('C') @NeighborCount(3) @NeighborsExactly('C', 3) +@NeighborsExactly('145', 3) @Whitelist('145B') @Blacklist([145]) def opls_145B(atom): """Biphenyl C1 """ - # Store for checking neighbors outside the first ring. - ring_one = benzene(atom) - if ring_one: - for neighbor in atom.neighbors: - if neighbor not in ring_one: - if benzene(neighbor): - return True + return True @Element('H') diff --git a/mosdef_gomc/trajectory.py b/mosdef_gomc/trajectory.py index 5a00fabe..1523ff45 100755 --- a/mosdef_gomc/trajectory.py +++ b/mosdef_gomc/trajectory.py @@ -84,12 +84,11 @@ def from_compound(cls, compound, show_ports=False, **kwargs): return traj def update_compound(self, compound, frame=0): - assert(isinstance(compound, Compound)) + assert isinstance(compound, Compound) - for chain in self.topology.chains: - for res in chain.residues: - for atom in res.atoms: - compound.atoms[atom.index].pos = self.xyz[frame, atom.index] + atoms = compound.atoms + for atom in self.topology.atoms: + atoms[atom.index].pos = self.xyz[frame, atom.index] def to_compound(self, part=None, frame=0): if part is None: