Skip to content

Extend Topology.from_openmm() to include positions argument #1478

@jchodera

Description

@jchodera

Is your feature request related to a problem? Please describe.
Currently, the idiom for creating a Topology object from an OpenMM setup pipeline (e.g. openmm.app.Modeller or pdbfixer) is

openff_topology = openff.toolkit.topology.Topology.from_openmm(modeller.topology, unique_molecules=molecules)
import openff.units.openmm
openff_topology.set_positions( openff.units.openmm.from_openmm(modeller.positions) )

Describe the solution you'd like
Adding an optional argument positions to Topology.from_topology() could simplify this to

openff_topology = openff.toolkit.topology.Topology.from_openmm(modeller.topology, positions=modeller.positions, unique_molecules=molecules)

with automatic conversion of the OpenMM positions as needed.

Describe alternatives you've considered
The verbose version is workable, but clunky and confusing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions