Skip to content

Commit

Permalink
Reverse accidental file overwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
avirshup committed Feb 28, 2017
1 parent 97c1cfd commit 48a4b72
Showing 1 changed file with 36 additions and 15 deletions.
51 changes: 36 additions & 15 deletions moldesign/models/amber.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,47 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from moldesign.utils import exports

from .base import MMBase
from .jsonmodel import JsonModelBase
import moldesign as mdt
from moldesign.parameters import Parameter, WhenParam
from moldesign.utils import exports

IMAGE = 'nwchem'
from . import ForceField


@exports
class SanderMM(JsonModelBase, MMBase):
""" Interface with NWChem package (QM only)
class GAFF(ForceField):
""" Model the energy using the GAFF forcefield
Note:
This is the first interface based on our new wrapping strategy. This is slightly hacked,
but has the potential to become very general; very few things here are NWChem-specific
This is implemented as a special case of the ForceField energy model; it automates small
parameterization process
"""
IMAGE = 'ambertools'
MODELNAME = 'sander'
DEFAULT_PROPERTIES = ['potential_energy']
ALL_PROPERTIES = DEFAULT_PROPERTIES + ['forces']
# TODO: mechanism to store partial charges so they don't need to be constantly recomputed

PARAMETERS = [Parameter('partial_charges',
'Partial charge model',
type=str,
default='am1-bcc',
choices=['am1-bcc', 'gasteiger', 'esp']),
Parameter('gaff_version',
'GAFF version',
type=str,
choices='gaff gaff2'.split(),
default='gaff2')
] + ForceField.PARAMETERS

def prep(self, force=False):
self._parameterize()
return super(GAFF, self).prep()

def calculate(self, requests=None):
if not self._prepped:
self._parameterize()
return super(GAFF, self).calculate(requests=requests)

def _parameterize(self):
if not self.mol.ff:
mdt.parameterize(self.mol,
charges=self.params.partial_charges,
ffname=self.params.gaff_version)

RUNNER = 'runsander.py'
PARSER = 'parsesander.py'

0 comments on commit 48a4b72

Please sign in to comment.