schrodinger.forcefield.common module¶
OPLS context managers.
Copyright Schrodinger LLC, All Rights Reserved.
- exception schrodinger.forcefield.common.AtomTypingFailure(msg='')[source]¶
Bases:
schrodinger.infra.mmcheck.MmException
- __init__(msg='')[source]¶
Initialize with the wrapped function, arguments used, and the return code.
- args¶
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- schrodinger.forcefield.common.mmffld_environment()[source]¶
A context manager for loading the mmffld environment.
- class schrodinger.forcefield.common.ForceFieldOptions(version: int = 16, archive_path: Optional[os.PathLike] = None, bend_conj_amines: bool = False, no_cm1a_bcc: bool = False, charges_from_ct: bool = False, no_restrain_zob: bool = False, nonbond_cutoff: float = 14.0)[source]¶
Bases:
tuple
Class for assigning the mmffld force field options.
- version: int¶
Alias for field number 0
- archive_path: Optional[os.PathLike]¶
Alias for field number 1
- bend_conj_amines: bool¶
Alias for field number 2
- no_cm1a_bcc: bool¶
Alias for field number 3
- charges_from_ct: bool¶
Alias for field number 4
- no_restrain_zob: bool¶
Alias for field number 5
- nonbond_cutoff: float¶
Alias for field number 6
- __contains__(key, /)¶
Return key in self.
- __len__()¶
Return len(self).
- count(value, /)¶
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.
- schrodinger.forcefield.common.opls_force_field(ffld_options: Optional[schrodinger.forcefield.common.ForceFieldOptions] = None, **kwargs) int [source]¶
A context manager for creating a force field handle, using default precedence for loading ffld datafiles.
- Parameters
ffld_options –
common.ForceFieldOptions
object with options that affect ffld paramskwargs – Allows passing
ffld_option
keywords seaparately to the function. See options forcommon.ForceFieldOptions
for available options.
- Returns
mmffld handle
- schrodinger.forcefield.common.assign_force_field(mmffld_handle: pymmlibs.MMFfldHandle, st: schrodinger.structure._structure.Structure, apply_mmlewis: bool = True)[source]¶
A context manager to runs typing by loading the structure into mmffld. Note: If cm1a is turned on, enterMol calculates charges which is a fairly lengthy operation.
- Parameters
handle – mmffld handle
st – structure to assign atom types
apply_mmlewis – whether to apply mmlewis to the incoming structure
- Raises
AtomTypingFailure – if mmffld_enterMol() fails
- schrodinger.forcefield.common.generate_partial_charges(st: schrodinger.structure._structure.Structure, version: pymmlibs.OPLSVersion = 16)[source]¶
Generates partial charges for a given structure. Results will be stored in the
PARTIAL_CHARGE_PROP
atom-level property.- Parameters
st – Structure for which partial charges are generated.