Defines MacroModel optimizers.
-
exception
MacroModelConversionError¶ Bases:
Exception-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
args¶
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
class
MacroModelForceField(macromodel_path, output_dir=None, restricted=False, timeout=None, force_field=16, maximum_iterations=2500, minimum_gradient=0.05, use_cache=False)¶ Bases:
stk.calculators.optimization.macromodel._MacroModelUses MacroModel force fields to optimize molecules.
Methods
add_to_cache(self, mol[, value])Add a molecule to the cache.
get_cached_value(self, mol)Return the value stored in the cache for mol.
is_caching(self)Trueif the calculator has caching turned on.is_in_cache(self, mol)Return
Trueif mol is cached.optimize(self, mol)Optimize a molecule.
set_cache_use(self, use_cache)Set cache use on or off.
-
__init__(self, macromodel_path, output_dir=None, restricted=False, timeout=None, force_field=16, maximum_iterations=2500, minimum_gradient=0.05, use_cache=False)¶ Initialize a
MacroModelForceFieldobject.- Parameters
macromodel_path (
str) – The full path of the Schrodinger suite within the user’s machine. For example, on a Linux machine this may be something like'/opt/schrodinger2017-2'.output_dir (
str, optional) – The name of the directory into which files generated during the optimization are written, ifNonethenuuid.uuid4()is used.restricted (
bool, optional) – IfTruethen an optimization is performed only on the bonds added byconstruct(). IfFalsethen all bonds are optimized.timeout (
float, optional) – The amount in seconds the optimization is allowed to run before being terminated.Nonemeans there is no timeout.force_field (
int, optional) – The number of the force field to be used.maximum_iterations (
int, optional) – The maximum number of iterations done during the optimization. Cannot be more than999999.minimum_gradient (
float, optional) – The gradient at which optimization is stopped. Cannot be less than0.0001.use_cache (
bool, optional) – IfTrueoptimize()will not run twice on the same molecule.
-
add_to_cache(self, mol, value=None)¶ Add a molecule to the cache.
- Parameters
mol (
Molecule) – The molecule to be added to the cache.value (class:object, optional) – The cached value associated with the molecule.
- Returns
The calculator.
- Return type
-
get_cached_value(self, mol)¶ Return the value stored in the cache for mol.
- Parameters
mol (
Molecule) – The molecule whose cached value is to be returned.- Returns
The cached value.
- Return type
object
-
is_caching(self)¶ Trueif the calculator has caching turned on.- Returns
Trueif the calculator has caching turned on.- Return type
bool
-
is_in_cache(self, mol)¶ Return
Trueif mol is cached.- Parameters
mol (
Molecule) – The molecule being checked.- Returns
Trueif mol is cached.- Return type
bool
-
optimize(self, mol)¶ Optimize a molecule.
- Parameters
mol (
Molecule) – The molecule to be optimized.- Returns
None
- Return type
NoneType
-
set_cache_use(self, use_cache)¶ Set cache use on or off.
- Parameters
use_cache (
bool) –Trueif the cache is to be used.- Returns
The calculator.
- Return type
-
-
exception
MacroModelForceFieldError¶ Bases:
Exception-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
args¶
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
exception
MacroModelInputError¶ Bases:
Exception-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
args¶
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
exception
MacroModelLewisStructureError¶ Bases:
Exception-
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
args¶
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
class
MacroModelMD(macromodel_path, output_dir=None, timeout=None, force_field=16, temperature=750, conformers=50, time_step=1, eq_time=10, simulation_time=200, maximum_iterations=2500, minimum_gradient=0.05, restricted_bonds=None, restricted_bond_angles=None, restricted_torsional_angles=None, use_cache=False)¶ Bases:
stk.calculators.optimization.macromodel._MacroModelRuns a molecular dynamics conformer search using MacroModel.
Methods
add_to_cache(self, mol[, value])Add a molecule to the cache.
get_cached_value(self, mol)Return the value stored in the cache for mol.
is_caching(self)Trueif the calculator has caching turned on.is_in_cache(self, mol)Return
Trueif mol is cached.optimize(self, mol)Optimize a molecule.
set_cache_use(self, use_cache)Set cache use on or off.
-
__init__(self, macromodel_path, output_dir=None, timeout=None, force_field=16, temperature=750, conformers=50, time_step=1, eq_time=10, simulation_time=200, maximum_iterations=2500, minimum_gradient=0.05, restricted_bonds=None, restricted_bond_angles=None, restricted_torsional_angles=None, use_cache=False)¶ Initialize a
MacroModelMDinstance.- Parameters
macromodel_path (
str) – The full path of the Schrodinger suite within the user’s machine. For example, on a Linux machine this may be something like'/opt/schrodinger2017-2'.output_dir (
str, optional) – The name of the directory into which files generated during the optimization are written, ifNonethenuuid.uuid4()is used.timeout (
float, optional) – The amount in seconds the MD is allowed to run before being terminated.Nonemeans there is no timeout.force_field (
int, optional) – The number of the force field to be used.temperature (
float, optional) – The temperature in Kelvin at which the MD is run. Cannot be more than99999.99.conformers' (
int, optional) – The number of conformers sampled and optimized from the MD. Cannot be more than9999.simulation_time (
float, optional) – The simulation time inpsof the MD. Cannot be more than999999.99.time_step (
float, optional) – The time step infsfor the MD. Cannot be more than99999.99.eq_time (
float, optional) – The equilibriation time inpsbefore the MD is run. Cannot be more than999999.99.maximum_iterations (
int, optional) – The maximum number of iterations done during the optimization. Cannot be more than999999.minimum_gradient (
float, optional) – The gradient at which optimization is stopped. Cannot be less than0.0001.restricted_bonds (
set, optional) –A
setof the formrestricted_bonds = { frozenset((0, 10)), frozenset((3, 14)), frozenset((5, 6)) }
Where each
frozensetdefines which bonds should have a fixed length via the atom ids of atoms in the bond.restricted_bond_angles (
set, optional) –A
setof the formrestricted_bonds = { frozenset((0, 10, 12)), frozenset((3, 14, 7)), frozenset((5, 8, 2)) }
Where each
frozensetdefines which bond angles should have a fixed size via the atom ids of atoms in the bond angle.restricted_torsional_angles (
set, optional) –A
setof the formrestricted_bonds = { frozenset((0, 10, 12, 3)), frozenset((3, 14, 7, 4)), frozenset((5, 8, 2, 9)) }
Where each
frozensetdefines which torsional angles should have a fixed size via the atom ids of atoms in the torsional angle.use_cache (
bool, optional) – IfTrueoptimize()will not run twice on the same molecule.
-
add_to_cache(self, mol, value=None)¶ Add a molecule to the cache.
- Parameters
mol (
Molecule) – The molecule to be added to the cache.value (class:object, optional) – The cached value associated with the molecule.
- Returns
The calculator.
- Return type
-
get_cached_value(self, mol)¶ Return the value stored in the cache for mol.
- Parameters
mol (
Molecule) – The molecule whose cached value is to be returned.- Returns
The cached value.
- Return type
object
-
is_caching(self)¶ Trueif the calculator has caching turned on.- Returns
Trueif the calculator has caching turned on.- Return type
bool
-
is_in_cache(self, mol)¶ Return
Trueif mol is cached.- Parameters
mol (
Molecule) – The molecule being checked.- Returns
Trueif mol is cached.- Return type
bool
-
optimize(self, mol)¶ Optimize a molecule.
- Parameters
mol (
Molecule) – The molecule to be optimized.- Returns
None
- Return type
NoneType
-
set_cache_use(self, use_cache)¶ Set cache use on or off.
- Parameters
use_cache (
bool) –Trueif the cache is to be used.- Returns
The calculator.
- Return type
-