vibesketch.chem.relax¶
Relax a species’ 3D structure with FIRE on an RDKit force field, constraints held.
A conformer from embedding or a file is pulled to a nearby minimum of
MMFF94 (T. A. Halgren, J. Comput. Chem. 17, 490-519 (1996)) or UFF
(A. K. Rappé, C. J. Casewit, K. S. Colwell, W. A. Goddard III and W. M.
Skiff, J. Am. Chem. Soc. 114, 10024-10035 (1992)), RDKit supplying the
energy and gradient and vibesketch.chem.fire the minimiser. A job’s
constraints hold during the relaxation and are exact, not restraints:
A fixed atom (a
positionconstraint) feels no force, through FIRE’s mask.A distance, angle or dihedral is held by projection. Before the run and after every move, the coordinates are put back on the constraint surface with Newton steps of least norm along the constraint gradients, the SHAKE idea (J.-P. Ryckaert, G. Ciccotti and H. J. C. Berendsen, J. Comput. Phys. 23, 327-341 (1977)); the force the minimiser sees has its components along those gradients removed, so it only drives motion that keeps the constraints. The dihedral’s gradient follows A. Blondel and M. Karplus, J. Comput. Chem. 17, 1132-1141 (1996).
The force field is the caller’s choice and is not swapped silently: a species it has no parameters for is refused with the reason. The drawn stereochemistry is checked on the result as embedding checks it, and a relaxation that changed it is refused. Everything is deterministic.
Units: angstrom, kcal/mol and kcal/mol/angstrom, degrees in constraints.
Module Attributes
The force fields, in the order they are tried when the caller names none. |
|
|
the largest force component, in kcal/mol/angstrom. |
|
Integration steps before giving up. |
Functions
|
Relax |
Classes
|
A constraint and its value at the end, in angstrom or degrees. |
|
A relaxed 3D structure and what the relaxation did. |
Exceptions
The species could not be relaxed as asked. |
- vibesketch.chem.relax.FORCE_FIELDS: tuple[Literal['mmff94', 'uff'], ...] = ('mmff94', 'uff')¶
The force fields, in the order they are tried when the caller names none.
- class vibesketch.chem.relax.ConstraintCheck(kind, atoms, target, value)[source]¶
Bases:
objectA constraint and its value at the end, in angstrom or degrees.
- exception vibesketch.chem.relax.RelaxFailed[source]¶
Bases:
ValueErrorThe species could not be relaxed as asked.
- class vibesketch.chem.relax.Relaxed(conformer, force_field, energy_before, energy, fmax, steps, converged, constraints=<factory>, warnings=<factory>)[source]¶
Bases:
objectA relaxed 3D structure and what the relaxation did.
- Parameters:
- constraints: list[ConstraintCheck]¶
- vibesketch.chem.relax.relax_3d(species, *, constraints=None, force_field='mmff94', fmax=0.05, max_steps=5000)[source]¶
Relax
species’ first conformer, holdingconstraints.force_fieldismmff94oruff; a species it has no parameters for is refused. The run stops once no force component that can still move an atom exceedsfmax(kcal/mol/angstrom) or aftermax_stepssteps, and the result says which. RaisesRelaxFailedwith the reason when the species has no structure, the conformer does not match it, a constraint names an atom it lacks or cannot be satisfied, the force field lacks parameters, or the drawn stereochemistry was lost.