A molecular system object from the Open Force Field Initiative
Please note that this software in an early and experimental state and unsuitable for production.
The OpenFF System 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.
# Use the OpenFF Toolkit to generate a minimal chemical topology
from openff.toolkit.topology import Molecule, Topology
top = Molecule.from_smiles("C").to_topology()
# Load Parsley
from openff.system.stubs import ForceField # Primarily wraps the ForceField class from the OpenFF Toolkit
parsley = ForceField("openff-1.0.0.offxml")
# Create an OpenFF System
off_sys = parsley.create_openff_system(top)
# Define box vectors and assign atomic positions
import numpy as np
off_sys.box = [4, 4, 4] * np.eye(3)
off_sys.positions = np.random.rand(15).reshape((5, 3)) # Repalce with valid data
# Convert the OpenFF System to an OpenMM System ...
omm_sys = off_sys.to_openmm()
# ... or write to GROMACS files (partial support)
off_sys.to_gro("out.gro", writer="internal")
off_sys.to_top("top.gro", writer="internal")
Future releases will include support for conversion to other file formats such as those used by AMBER and GROMACS.
Other examples are available via binder, runnable in a web browser without installing anyting on your computer.
Copyright (c) 2020, Open Force Field Initiative
Project based on the Computational Molecular Science Python Cookiecutter version 1.2.