schrodinger.application.steps.utils module¶
-
exception
schrodinger.application.steps.utils.
StepsError
[source]¶ Bases:
RuntimeError
-
__init__
(*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.
-
-
schrodinger.application.steps.utils.
to_string
(obj)[source]¶ Convert the mol or scored mol to a string representation.
To be used in logging and file writing.
- Parameters
obj (Chem.Mol or object) – a step input or output object
- Returns
text representation
- Return type
str
-
schrodinger.application.steps.utils.
mol_to_structure
(mol, step, generate_coordinates=False)[source]¶ Convert a mol to a structure object catching and reporting exceptions.
- Parameters
mol (Chem.Mol) – the mol to convert
step (stepper._BaseStep) – Step this conversion is being performed for
generate_coordinates (bool) – whether coordinates should be generated
- Returns
the structure or None if there were issues
- Return type
structure.Structure or NoneType
-
schrodinger.application.steps.utils.
structure_to_mol
(st, step, input_mol=None)[source]¶ Convert a structure to a mol object catching and reporting exceptions.
- Parameters
st (Structure.Structure) – the structure to convert
step (stepper._BaseStep) – Step this conversion is being performed for
input_mol – the input molecule for this step
- Returns
the molecule or None if there were issues
- Return type
Chem.Mol or NoneType
-
schrodinger.application.steps.utils.
fragment_to_molecule
(fragment)[source]¶ Create a molecule from a fragment with implicit H.
- Parameters
fragment (Chem.Mol) – the fragment
- Returns
the molecule version of the fragment
- Return type
Chem.Mol
-
schrodinger.application.steps.utils.
validate_core_smarts
(step, core_smarts)[source]¶ Validation of a required core smarts for a step.
- Parameters
step (stepper.BaseStep) – The step that the validation is for
core_smarts (str or NoneType) – the SMARTS to validate
- Returns
the list of validation issues
- Return type
-
schrodinger.application.steps.utils.
validate_file
(step, settings_attr_name)[source]¶ Validation of an optional file.
- Parameters
step (stepper.BaseStep) – the step that the validation is for
settings_attr_name (str) – the settings attribute name
- Returns
the list of validation issues
- Return type
List[stepper.ValidationIssues]
-
schrodinger.application.steps.utils.
apply_config_settings_to_step
(config_dict, step)[source]¶ Applies all possible items from settings to the configuration settings of the step.
- Parameters
config_dict (dict) – the configuration dictionary
step (stepper.BaseStep) – the steps to apply the settings to
-
schrodinger.application.steps.utils.
update_params
(to_params, from_params)[source]¶ Update the to_params with the values in from_params.
- Parameters
to_params (parameters.CompoundParam) – the parameters to update
from_params (parameters.CompoundParam) – the parameters to get the values from
-
schrodinger.application.steps.utils.
validate_smasher_file
(smasher_fname)[source]¶ Validate a Smasher input archive
- Parameters
smasher_fname (str) – Filename of the Smasher input to validate
- Returns
A string error if issues are encountered, None otherwise.
- Return type
str or NoneType
-
schrodinger.application.steps.utils.
need_Hs
(mol, sma)[source]¶ Determine whether the SMARTS of the underlying
sma
has explicit hydrogens, so that a molecule that has only implicit H’s needs to have hydrogens added in order to be able to have a substructure match.- Parameters
mol (Chem.Mol) – the mol to check
sma (Chem.Mol) – the smarts mol to check against
- Returns
True if addHs is needed, False if it wasn’t needed and None if it can not be determined, i.e., SMARTS never matched
- Return type
bool or NoneType