parmed.openmm.load_topology

parmed.openmm.load_topology(topology, system=None, xyz=None, box=None, condense_atom_types=True)[source]

Creates a parmed.structure.Structure instance from an OpenMM Topology, optionally filling in parameters from a System

Parameters
topologysimtk.openmm.app.Topology

The Topology instance with the list of atoms and bonds for this system

systemsimtk.openmm.System or str, optional

If provided, parameters from this System will be applied to the Structure. If a string is given, it will be interpreted as the file name of an XML-serialized System, and it will be deserialized into a System before used to supply parameters

xyzstr or array of float

Name of a file containing coordinate information or an array of coordinates. If file has unit cell information, it also uses that information unless box (below) is also specified

boxarray of 6 floats

Unit cell dimensions

condense_atom_typesbool, default=True

If True, create unique atom types based on de-duplicating properties. If False, create one atom type for each atom in the system, even if its properties match an existing atom type.

Returns
structStructure

The structure from the provided topology

Raises
OpenMMWarning if parameters are found that cannot be interpreted or
processed by ParmEd
TypeError if there are any mismatches between the provided topology and
system (e.g., they have different numbers of atoms)
IOError if system is a string and it is not an existing file

Notes

Due to its flexibility with CustomForces, it is entirely possible that the functional form of the potential will be unknown to ParmEd. This function will try to use the energy expression to identify supported potential types that are implemented as CustomForce objects. In particular, quadratic improper torsions, when recognized, will be extracted.

Other CustomForces, including the CustomNonbondedForce used to implement NBFIX (off-diagonal L-J modifications) and the 12-6-4 potential, will not be processed and will result in an unknown functional form.

If an OpenMM Atom.id attribute is populated by a non-integer, it will be used to name the corresponding ParmEd AtomType object.