schrodinger.forcefield.minimizer module

class schrodinger.forcefield.minimizer.Restraint(force_constant, target_value, atom_index1, atom_index2, atom_index3, atom_index4, flat_bottom_half_width)

Bases: object

Class representing restraints.

__init__(force_constant, target_value, atom_index1, atom_index2, atom_index3, atom_index4, flat_bottom_half_width)
classmethod from_atom_indices(st: schrodinger.structure._structure.Structure, atom_indices: Tuple[int, int, int, int], force_constant: float = 5.0, flat_bottom_half_width: float = 0.0, target_torsion_angle: Optional[float] = None)

Given structure and atom indices, return a restraint for mmffld minimization with default force constant, flat bottom half width, and target torsion angle.

Parameters
  • st – structure

  • atom_indices – atom indices for a torsion

  • force_constant – restraint force constant

  • flat_bottom_half_width – flat bottom half width for restraints

  • target_torsion_angle – target torsion angle in degrees if None is given, the current torsion angle will be used

Returns

torsion restraint for minimization

class schrodinger.forcefield.minimizer.Constraint(atom_index1, atom_index2, type_index1, type_index2, use_rigorous=False)

Bases: object

Class representing constraints.

__init__(atom_index1, atom_index2, type_index1, type_index2, use_rigorous=False)
schrodinger.forcefield.minimizer.minimize_structure(st: schrodinger.structure._structure.Structure, options: Optional[schrodinger.forcefield.ffld_options.MinimizationOptions] = None, force_field: Optional[Union[int, schrodinger.forcefield.ffld_options.ForceFieldOptions]] = None)

Minimizes a single structure. For minimizing multiple structures, the performance improves drastically if the forcefield environment instantiation happens outside the iteration loop.

Parameters
  • st – structure

  • options – mmffld minimization options

  • force_field – either an existing force field handle or ForceFieldOptions, from which a handle will be created

Returns

minimization results

Return type

mm.MinimizeResults

schrodinger.forcefield.minimizer.assign_structure_for_minimization(mmffld_handle, st)
schrodinger.forcefield.minimizer.minimize_structure_preassigned(mmffld_handle: int, options: Optional[schrodinger.forcefield.ffld_options.MinimizationOptions] = None) pymmlibs.MinimizeResults

Minimizes a structure with force field assigned. This is ideal for minimizing a series of conformers inside a single shared forcefield assignment context (and corresponding pbc settings).

Parameters
  • mmffld_handle – mmffld_handle that has st assigned.

  • options – mmffld minimization options

Returns

minimization results

schrodinger.forcefield.minimizer.iterate_minimize_structure(st: schrodinger.structure._structure.Structure, iteration: int, options: Optional[schrodinger.forcefield.ffld_options.MinimizationOptions] = None) pymmlibs.MinimizeResults

Minimize a single structure multiple times. This function instantiates the forcefield handle before the iteration loop and hence increases the performance by eliminating instantiation repetitions.

Parameters
  • st – structure

  • iteration – iteration number

  • options – mmffld minimization options

Returns

minimization results

schrodinger.forcefield.minimizer.minimize_substructure(st: schrodinger.structure._structure.Structure, atoms_to_minimize: Iterable[schrodinger.structure._structure.StructureAtom]) schrodinger.structure._structure.Structure

Given a structure, minimizes the specified atoms in it, and returns it

Parameters
  • st – The structure containing the atoms to be minimized

  • atoms_to_minimize – The subset of atoms in the structure to be minimize

Returns

The structure with the atoms minimized

schrodinger.forcefield.minimizer.minimize_ligands(st: schrodinger.structure._structure.Structure, **kwargs) schrodinger.structure._structure.Structure

Given a structure, returns that structure with all the ligands minimized.

Parameters
  • st – The structure containing ligands to be minimized

  • **kwargs – Any options to supply to analyze.find_ligands

Returns

The structure with the ligands minimized

schrodinger.forcefield.minimizer.write_restraints(filename: str, restraints: List[schrodinger.forcefield.minimizer.Restraint])

Writes restraints into filename.

Parameters
  • filename – restraint filename

  • restraints – a list to be filled with restraints

schrodinger.forcefield.minimizer.read_restraints(filename: str, restraints: Optional[List[schrodinger.forcefield.minimizer.Restraint]] = None, constraints: Optional[List[schrodinger.forcefield.minimizer.Constraint]] = None)

Reads restraints and constraints arguments from a file and creates separate lists for Restraint and Constraint objects.

Parameters
  • filename – restraint/constraint filename

  • restraints – a list to be filled with restraints

  • constraints – a list to be filled with constraints

schrodinger.forcefield.minimizer.assign_option(mmffld_handle: int, mm_option_enum: int, typed_value: Union[int, float, str, bool])

A context manager to assign the value of an option.

Parameters
  • mmffld_handle – force field handle

  • enum_option – mmffld option

  • typed_value – typed value of the option