A project (and object) for storing, manipulating, and converting molecular mechanics data.
Please note that this software in an early and experimental state and unsuitable for production.
$ conda install openff-interchange -c conda-forgeThe OpenFF Iterchange object serves primarily as a container object for parametrized data. It can currently take in force fields and chemical topologies via objects in the OpenFF Toolkit and produce an object storing parametrized data.
from openff.toolkit import Molecule, ForceField
from openff.units import unit
from openff.interchange import Interchange
# Use the OpenFF Toolkit to generate a chemical topology
molecule = Molecule.from_smiles("CCO")
molecule.generate_conformers(n_conformers=1)
topology = molecule.to_topology()
topology.box_vectors = unit.Quantity([4, 4, 4], unit.nanometer)
# Load OpenFF 2.0.0 "Sage"
sage = ForceField("openff-2.0.0.offxml")
# Create an Interchange object
out = Interchange.from_smirnoff(force_field=sage, topology=topology)
# Convert the Interchnage object to an OpenMM System
omm_sys = out.to_openmm(combine_nonbonded_forces=True)
# or write to GROMACS files
out.to_gro("out.gro")
out.to_top("out.top")
# or roundtrip through JSON or other common serialization formats
roundtripped = Interchange.parse_raw(out.json())Future releases will include improved support for other file formats such as those used by AMBER, CHARMM, and LAMMPS.
Other examples are available via binder, executable in a web browser without installing anyting on your computer.
For more information, please consult the full documentation.
Copyright (c) 2020-2021, Open Force Field Initiative
Project based on the Computational Molecular Science Python Cookiecutter version 1.2.