rdkit.ForceField.rdForceField module

Exposes the ForceField class

class rdkit.ForceField.rdForceField.ForceField

Bases: object

A force field

AddDistanceConstraint(self, idx1: int, idx2: int, minLen: float, maxLen: float, forceConstant: float) None

Adds a distance constraint to the UFF force field (deprecated, use UFFAddDistanceConstraint instead).

AddExtraPoint(self, x: float, y: float, z: float, fixed: bool = True) int

Adds an extra point, this can be useful for adding constraints.

AddFixedPoint(self, idx: int) None

Adds a fixed point to the force field.

CalcEnergy(self, pos: object | None = None) float

Returns the energy (in kcal/mol) of the current arrangement or of the supplied coordinate list (if non-empty)

CalcGrad(self, pos: object | None = None) tuple

Returns a tuple filled with the per-coordinate gradients of the current arrangement or of the supplied coordinate list (if non-empty)

Dimension(self) int

Returns the dimension of the ForceField

GetExtraPointPos(self, idx: int) tuple

returns the location of an extra point as a tuple

Initialize(self) None

initializes the force field (call this before minimizing)

MMFFAddAngleConstraint(self, idx1: int, idx2: int, idx3: int, relative: bool, minAngleDeg: float, maxAngleDeg: float, forceConstant: float) None

Adds an angle constraint to the MMFF force field; if relative == True, then minAngleDeg and maxAngleDeg are intended as relative to the current angle.

MMFFAddDistanceConstraint(self, idx1: int, idx2: int, relative: bool, minLen: float, maxLen: float, forceConstant: float) None

Adds a distance constraint to the MMFF force field; if relative == True, then minLen and maxLen are intended as relative to the current distance.

MMFFAddPositionConstraint(self, idx: int, maxDispl: float, forceConstant: float) None

Adds a position constraint to the MMFF force field.

MMFFAddTorsionConstraint(self, idx1: int, idx2: int, idx3: int, idx4: int, relative: bool, minDihedralDeg: float, maxDihedralDeg: float, forceConstant: float) None

Adds a dihedral angle constraint to the MMFF force field; if relative == True, then minDihedralDeg and maxDihedralDeg are intended as relative to the current dihedral angle.

Minimize(self, maxIts: int = 200, forceTol: float = 0.0001, energyTol: float = 1e-06) int

Runs some minimization iterations.

Returns 0 if the minimization succeeded.

MinimizeTrajectory(self, snapshotFreq: int, maxIts: int = 200, forceTol: float = 0.0001, energyTol: float = 1e-06) tuple

Runs some minimization iterations, recording the minimization trajectory every snapshotFreq steps.

Returns a (int, []) tuple; the int is 0 if the minimization succeeded, while the list contains Snapshot objects.

NumPoints(self) int

Returns the number of points the ForceField is handling

Positions(self) tuple

Returns a tuple filled with the coordinates of the points the ForceField is handling

UFFAddAngleConstraint(self, idx1: int, idx2: int, idx3: int, relative: bool, minAngleDeg: float, maxAngleDeg: float, forceConstant: float) None

Adds an angle constraint to the UFF force field; if relative == True, then minAngleDeg and maxAngleDeg are intended as relative to the current angle.

UFFAddDistanceConstraint(self, idx1: int, idx2: int, relative: bool, minLen: float, maxLen: float, forceConstant: float) None

Adds a distance constraint to the UFF force field; if relative == True, then minLen and maxLen are intended as relative to the current distance.

UFFAddPositionConstraint(self, idx: int, maxDispl: float, forceConstant: float) None

Adds a position constraint to the UFF force field.

UFFAddTorsionConstraint(self, idx1: int, idx2: int, idx3: int, idx4: int, relative: bool, minDihedralDeg: float, maxDihedralDeg: float, forceConstant: float) None

Adds a dihedral angle constraint to the UFF force field; if relative == True, then minDihedralDeg and maxDihedralDeg are intended as relative to the current dihedral angle.

class rdkit.ForceField.rdForceField.MMFFMolProperties(self, mol: rdkit.Chem.rdchem.Mol, mmffVariant: str = 'MMFF94', verbosity: int = MMFFVerbosity.MMFF_VERBOSITY_NONE)

Bases: object

MMFF molecular properties

GetMMFFAngleBendParams(self, mol: rdkit.Chem.rdchem.Mol, idx1: int, idx2: int, idx3: int) object

Retrieves MMFF angle bend parameters for atoms with indexes idx1, idx2, idx3 as a (angleType, ka, theta0) tuple, or None if no parameters could be found

GetMMFFAngleTerm(self) bool

Returns whether the angle term is included in the MMFF equation.

GetMMFFAtomType(self, idx: int) int

Retrieves MMFF atom type for atom with index idx

GetMMFFBondStretchParams(self, mol: rdkit.Chem.rdchem.Mol, idx1: int, idx2: int) object

Retrieves MMFF bond stretch parameters for atoms with indexes idx1, idx2 as a (bondType, kb, r0) tuple, or None if no parameters could be found

GetMMFFBondTerm(self) bool

Returns whether the bond term is included in the MMFF equation.

GetMMFFDielectricConstant(self) float

Returns the currently configured MMFF dielectric constant.

GetMMFFDielectricModel(self) int

Returns the currently configured MMFF dielectric model (1: constant; 2: distance-dependent).

GetMMFFEleTerm(self) bool

Returns whether the electrostatic term is included in the MMFF equation.

GetMMFFFormalCharge(self, idx: int) float

Retrieves MMFF formal charge for atom with index idx

GetMMFFOopBendParams(self, mol: rdkit.Chem.rdchem.Mol, idx1: int, idx2: int, idx3: int, idx4: int) object

Retrieves MMFF out-of-plane bending force constant for atoms with indexes idx1, idx2, idx3, idx4 as a koop float value

GetMMFFOopTerm(self) bool

Returns whether the out-of-plane bend term is included in the MMFF equation.

GetMMFFPartialCharge(self, idx: int) float

Retrieves MMFF partial charge for atom with index idx

GetMMFFStretchBendParams(self, mol: rdkit.Chem.rdchem.Mol, idx1: int, idx2: int, idx3: int) object

Retrieves MMFF stretch-bend parameters for atoms with indexes idx1, idx2, idx3 as a (stretchBendType, kbaIJK, kbaKJI) tuple, or None if no parameters could be found

GetMMFFStretchBendTerm(self) bool

Returns whether the stretch-bend term is included in the MMFF equation.

GetMMFFTorsionParams(self, mol: rdkit.Chem.rdchem.Mol, idx1: int, idx2: int, idx3: int, idx4: int) object

Retrieves MMFF torsion parameters for atoms with indexes idx1, idx2, idx3, idx4 as a (torsionType, V1, V2, V3) tuple, or None if no parameters could be found

GetMMFFTorsionTerm(self) bool

Returns whether the torsional term is included in the MMFF equation.

GetMMFFVariant(self) str

Returns the currently configured MMFF variant (“MMFF94” or “MMFF94s”).

GetMMFFVdWParams(self, idx1: int, idx2: int) object

Retrieves MMFF van der Waals parameters for atoms with indexes idx1, idx2 as a (R_ij_starUnscaled, epsilonUnscaled, R_ij_star, epsilon) tuple, or None if no parameters could be found

GetMMFFVdWTerm(self) bool

Returns whether the Van der Waals term is included in the MMFF equation.

SetMMFFAngleTerm(self, state: bool = True) None

Sets the angle term to be included in the MMFF equation (defaults to True)

SetMMFFBondTerm(self, state: bool = True) None

Sets the bond term to be included in the MMFF equation (defaults to True)

SetMMFFDielectricConstant(self, dielConst: float = 1.0) None

Sets the DielConst MMFF property (defaults to 1.0)

SetMMFFDielectricModel(self, dielModel: int = 1) None

Sets the DielModel MMFF property (1: constant; 2: distance-dependent; defaults to constant)

SetMMFFEleTerm(self, state: bool = True) None

Sets the electrostatic term to be included in the MMFF equation (defaults to True)

SetMMFFOopTerm(self, state: bool = True) None

Sets the out-of-plane bend term to be included in the MMFF equation (defaults to True)

SetMMFFStretchBendTerm(self, state: bool = True) None

Sets the stretch-bend term to be included in the MMFF equation (defaults to True)

SetMMFFTorsionTerm(self, state: bool = True) None

Sets the torsional term to be included in the MMFF equation (defaults to True)

SetMMFFVariant(self, mmffVariant: str = 'MMFF94') None

Sets the MMFF variant to be used (“MMFF94” or “MMFF94s”; defaults to “MMFF94”)

SetMMFFVdWTerm(self, state: bool = True) None

Sets the Van der Waals term to be included in the MMFF equation (defaults to True)

SetMMFFVerbosity(self, verbosity: int = 0) None

Sets the MMFF verbosity (0: none; 1: low; 2: high; defaults to 0)

class rdkit.ForceField.rdForceField.MMFFVerbosity(*values)

Bases: Enum

MMFF_VERBOSITY_HIGH = 2
MMFF_VERBOSITY_LOW = 1
MMFF_VERBOSITY_NONE = 0
class rdkit.ForceField.rdForceField.Snapshot

Bases: object

A snapshot of atomic coordinates from a minimization trajectory

GetEnergy(self) float

Returns the energy for this Snapshot

GetPoint2D(self, pointNum: int) rdkit.Geometry.rdGeometry.Point2D

Returns the coordinates at pointNum as a Point2D object; requires the Trajectory dimension to be == 2

GetPoint3D(self, pointNum: int) rdkit.Geometry.rdGeometry.Point3D

Returns the coordinates at pointNum as a Point3D object; requires the Trajectory dimension to be >= 2

SetEnergy(self, energy: float) None

Sets the energy for this Snapshot