Module minimize
A module for force field energy evaluation and minimization.
API examples
A non-conformer serial minimization should use the minimize
function:
for st in structure.StructureReader('various_ligands.mae'):
minimize.minimize_structure(st)
st.append('various_ligands-mini-out.mae')
A conformer serial minimization can reduce atom-typing overhead by
using the Minimizer class:
for index, st in enumerate(structure.StructureReader('conformers.mae')):
if index == 0:
min = minimize.Minimizer(struct=st)
else:
min.updateCoordinates(st)
min.minimize()
st = min.getStructure()
st.append('conformers-out.mae')
|
__metaclass__
type(object) -> the object's type type(name, bases, dict) ->
a new type
|
|
Minimizer
A class to provide force field energy and minimization.
|
|
initialize(error_handler=None)
Initialize needed mmlibs. |
|
|
|
terminate()
Terminate the mmlibs initialized in the initialize method. |
|
|
|
get_converged(struct,
ffld_version)
Return the converged status for a Structure. |
|
|
|
get_rms_gradient(struct,
ffld_version)
Return the RMS of derivatives from force field minimization for a
Structure. |
|
|
|
get_energy(struct,
ffld_version)
Return the force field energy for a Structure. |
|
|
|
minimize_structure(struct,
ffld_version=OPLS_2005,
cleanup=False,
**kwargs)
Minimize the provided structure. |
|
|
|
_minimizer_int_property(mmffld_option,
doc=None,
readonly=True)
A function to generate an int property for minimizer settings. |
|
|
|
_minimizer_float_property(mmffld_option,
doc=None,
readonly=True)
A function to generate an float property for minimizer settings. |
|
|
|
OPLS_2005 = 14
|
|
OPLSv2 = 16
|
|
MinBFGS = mm.MMFfldMinBFGS
|
|
MinAUTO = mm.MMFfldMinAUTO
|
|
MinCG = mm.MMFfldMinCG
|
|
ffld_name = {}
|
|
OPLS_FFLD14_NAME = mm.mmcommon_get_ffld_name(OPLS_2005)
|
|
OPLS_FFLD16_NAME = mm.mmcommon_get_ffld_name(OPLSv2)
|
|
min_converged_prefix = "b_ff_Minimization_Converged-"
|
|
min_rms_gradient_prefix = "r_ff_RMS_Derivative-"
|
|
min_energy_prefix = "r_ff_Potential_Energy-"
|
|
_initialized = False
hash(x)
|
initialize(error_handler=None)
|
|
Initialize needed mmlibs.
This method is called by the Minimizer constructor, so if Minimizer
objects are used there is no need to explicitly call it.
|
Terminate the mmlibs initialized in the initialize method.
It's only necessary to call this method if you want to free resources
used by the underlying lib.
Note that this terminate method isn't automatically called in the
__del__ method of Minimizer. This is because there is significant
overhead to reading the force field data and it won't be re-read as long
as the library reference count is greater than zero.
|
get_converged(struct,
ffld_version)
|
|
Return the converged status for a Structure.
- Parameters:
ffld_version - One of the valid force fields from
mmcommon_get_valid_forcefields()
|
get_rms_gradient(struct,
ffld_version)
|
|
Return the RMS of derivatives from force field minimization for a
Structure.
- Parameters:
ffld_version - One of the valid force fields from
mmcommon_get_valid_forcefields()
|
get_energy(struct,
ffld_version)
|
|
Return the force field energy for a Structure. Units are kcal/mol.
- Parameters:
ffld_version - One of the valid force fields from
mmcommon_get_valid_forcefields()
|
minimize_structure(struct,
ffld_version=OPLS_2005,
cleanup=False,
**kwargs)
|
|
Minimize the provided structure.
Additional keyword arguments will be used to set properties of the
Minimizer instance. See the Minimizer.__init__() method for supported
property names.
- Parameters:
ffld_version (integer module constant) - The force field to use.
cleanup (bool) - If True, attempts to automatically clean up the structure will be
made. (This uses the C function mmlewis_apply() .)
Note that this can modify the atom types of the passed in
structure.
kwargs - Additional keyword arguments.
struct (schrodinger.structure.Structure)
|