Skip to content

Commit

Permalink
Merge pull request #34 from martimunicoy/torsions_fix
Browse files Browse the repository at this point in the history
Improve dihedral compatibility
  • Loading branch information
martimunicoy committed Sep 1, 2020
2 parents 2c99fbf + 5661205 commit 52ae845
Show file tree
Hide file tree
Showing 7 changed files with 771 additions and 55 deletions.
3 changes: 2 additions & 1 deletion docs/releasehistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ Bugfixes
""""""""
- `PR #22 <https://github.com/martimunicoy/offpele/pull/22>`_: Fixes many bugs. For example, the default output name of the solvent parameters template is changed to `ligandParams.txt`, which is the name that PELE expects.
- `PR #32 <https://github.com/martimunicoy/offpele/pull/32>`_: Minor fixes in ToolkitWrapper classes.
- `PR #34 https://github.com/martimunicoy/offpele/pull/34: Improves the translation of dihedrals coming from the Open Force Fielf Toolkit and corrects the lack of exclusions in PELE 1-4 list that result from Impact's dihedral definitions.

Tests added
"""""""""""
- `PR #31 <https://github.com/martimunicoy/offpele/pull/31>`_: Adds tests to validate some functions of the new SchrodingerToolkitWrapper.

- `PR #34 https://github.com/martimunicoy/offpele/pull/34: Adds tests to further validate the assignment of parameters from the Open Force Field Toolkit.

0.2.1
-----
Expand Down
15 changes: 10 additions & 5 deletions offpele/template/impact.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ def _write_bond(self, file):
# Atom 2 id
file.write('{:5d}'.format(idx2))
file.write(' ')
# Spring constant (PELE works with half of the OFF's spring)
file.write('{: 9.3f}'.format(spring / 2.0))
# Spring constant
file.write('{: 9.3f}'.format(spring))
file.write(' ')
# Equilibrium distance
file.write('{: 6.3f}\n'.format(eq_dist))
Expand Down Expand Up @@ -283,8 +283,8 @@ def _write_thet(self, file):
# Atom 3 id
file.write('{:5d}'.format(idx3))
file.write(' ')
# Spring constant (PELE works with half of the OFF's spring)
file.write('{: 11.5f}'.format(spring / 2.0))
# Spring constant
file.write('{: 11.5f}'.format(spring))
# Equilibrium angle
file.write('{: 11.5f}\n'.format(eq_angl))

Expand Down Expand Up @@ -973,6 +973,8 @@ def __init__(self, proper):
prefactor=proper.prefactor,
constant=proper.constant)

self.exclude = proper.exclude

@property
def atom1_idx(self):
"""
Expand Down Expand Up @@ -1007,7 +1009,10 @@ def atom3_idx(self):
atom3_idx : int
The index of the third atom involved in this Proper object
"""
return super().atom3_idx + 1
if self.exclude:
return (super().atom3_idx + 1) * -1
else:
return super().atom3_idx + 1

@property
def atom4_idx(self):
Expand Down
Loading

0 comments on commit 52ae845

Please sign in to comment.