moleculekit.openmmtools module#
- moleculekit.openmmtools.minimize_soft_potential(mol, mobile_atom_indices, max_iterations=200)#
Run a soft-potential energy minimization on selected atoms.
All other atoms are frozen (mass = 0). Uses a soft repulsive
CustomNonbondedForceso overlapping atoms are gently pushed apart rather than exploding. Only interactions involving at least one mobile atom are computed.Harmonic bond and angle restraints are added for bonds in
mol.bondsinvolving at least one mobile atom; equilibrium values are taken from the current coordinates. This keeps bond lengths and angles close to their starting geometry so the minimization resolves clashes by rotating dihedrals rather than distorting covalent structure.- Parameters:
- Returns:
True if minimization was performed, False if OpenMM is unavailable.
- Return type:
- moleculekit.openmmtools.openmm_to_molecule(topology, positions)#
Convert an OpenMM topology and positions into a Molecule.
Atom names, elements, residue names, residue ids, chains, insertion codes, formal charges, coordinates and bonds are copied from the OpenMM topology into a new
Moleculeobject.- Parameters:
topology (
openmm.app.Topology) – The OpenMM topology describing the atoms, residues, chains and bonds.positions (
openmm.unit.Quantity) – The atom positions as an OpenMM Quantity (e.g. with nanometer units). They are converted to Angstrom in the resulting Molecule.
- Returns:
mol – The molecule built from the OpenMM topology and positions.
- Return type: