Skip to content

Commit

Permalink
Add NAMD test set that contains restarts (#55)
Browse files Browse the repository at this point in the history
* Add scaffolding for NAMD restarted IDWS fepout test (see alchemistry/alchemlyb#135 )
* Add dataset for NAMD FEP run that was restarted a few times
* Add test
* Add entry for restarted dataset to docs/namd.rst
  • Loading branch information
ttjoseph authored Aug 31, 2021
1 parent d106caf commit 3090d01
Show file tree
Hide file tree
Showing 20 changed files with 65 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/namd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ engine. They can be accessed using the following accessor functions:
.. include:: ../src/alchemtest/namd/idws/descr.rst

.. autofunction:: alchemtest.namd.load_idws

.. _namd_restarted:

.. include:: ../src/alchemtest/namd/restarted/descr.rst

.. autofunction:: alchemtest.namd.load_restarted
1 change: 1 addition & 0 deletions src/alchemtest/namd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

from .access import load_tyr2ala
from .access import load_idws
from .access import load_restarted
22 changes: 22 additions & 0 deletions src/alchemtest/namd/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,25 @@ def load_idws():

return Bunch(data=data,
DESCR=fdescr)

def load_restarted():
"""Load the NAMD IDWS dataset.
Returns
-------
data : Bunch
Dictionary-like object, the interesting attributes are:
- 'data' : the data files by alchemical leg
- 'DESCR': the full description of the dataset
"""

module_path = dirname(__file__)
data = {'both': glob(join(module_path, 'restarted', 'restarted*.fepout.bz2'))}

with open(join(module_path, 'restarted', 'descr.rst')) as rst_file:
fdescr = rst_file.read()

return Bunch(data=data,
DESCR=fdescr)
34 changes: 34 additions & 0 deletions src/alchemtest/namd/restarted/descr.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
NAMD: free energy of tyrosine to alanine in vacuo
=================================================

Free energy change from mutating a Tyr into Ala in vacuo.
Uses Interleaved Double-Wide Sampling (Hénin and Brannigan).
Each lambda window was run separately, and NAMD was interrupted
and restarted multiple times, such that one window may span
multiple fepout files.

Derived from NAMD FEP Tutorial, available at:
https://www.ks.uiuc.edu/Training/Tutorials/namd/FEP/

Notes
-----
Data Set Characteristics:
:Number of Legs: 1 (forward mutation with IDWS sampling)
:Number of Windows: 11
:Length of Windows: 50 ps
:System Size: 57 atoms
:Temperature: 300 K
:Alchemical Pathway: Mutation of Tyr into Ala using hybrid molecule.
Nonbonded interactions of perturbed atoms are scaled
with their environment.
:Missing Values: None
:Energy unit: kcal/mol
:Time unit: step
:Date: August 2021
:Donor: Thomas T. Joseph
:License: `CC0 <https://creativecommons.org/publicdomain/zero/1.0/>`_
Public Domain Dedication

This dataset was generated using the `NAMD
<http://http://www.ks.uiuc.edu/Research/namd/>`_ molecular dynamics
engine.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion src/alchemtest/tests/test_namd.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'''Tests for all the NAMD datasets'''
import pytest

from alchemtest.namd import load_tyr2ala, load_idws
from alchemtest.namd import load_tyr2ala, load_idws, load_restarted

from . import BaseDatasetTest

Expand All @@ -10,6 +10,7 @@ class TestNAMD(BaseDatasetTest):
@pytest.fixture(scope="class",
params = [(load_tyr2ala, ('forward', 'backward'), (1, 1)),
(load_idws, ('forward', ), (2,)),
(load_restarted, ('both', ), (15,))
])
def dataset(self, request):
return super(TestNAMD, self).dataset(request)

0 comments on commit 3090d01

Please sign in to comment.