Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve GROMACS parsing #737

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Improve GROMACS parsing #737

wants to merge 1 commit into from

Conversation

mattwthompson
Copy link
Member

Description

Checklist

  • Add tests
  • Lint
  • Update docstrings

@mattwthompson
Copy link
Member Author

from rich.pretty import pprint

from openff.interchange import Interchange
from openff.interchange.drivers import get_summary_data
from openff.interchange.drivers.gromacs import _run_gmx_energy

x = Interchange.from_gromacs("complex.top", "complex.gro")

pprint(
    get_summary_data(
        x,
        _engines=(
            "OpenMM",
            "GROMACS",
        ),
    ),
)
"""
│   │   │      Bond       Angle     Torsion  Electrostatics           vdW   RBTorsion
OpenMM   169.766615  893.146719  202.419998  -110750.242984  13047.227256         NaN
GROMACS  169.766602  893.146606  202.777481  -110755.550903  13047.001633  184.087524
"""

x.to_gromacs(prefix="gromacs", decimal=12)

for prefix in ["complex", "gromacs"]:
    pprint(
        _run_gmx_energy(
            top_file=f"{prefix}.top",
            gro_file=f"{prefix}.gro",
            mdp_file="../mdp/default.mdp",
            maxwarn=1,
        )["Per. Imp. Dih."],
    )
"""
<Quantity(50.2272034, 'kilojoule / mole')>
<Quantity(50.2272034, 'kilojoule / mole')>
"""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant