rxn.reaction_preprocessing.annotations.molecule_replacer.MoleculeReplacer
- class rxn.reaction_preprocessing.annotations.molecule_replacer.MoleculeReplacer(replacements)[source]
Bases:
objectClass to replace SMILES strings by their improved alternatives (for instance from the catalyst annotations).
- Parameters
replacements (
Mapping[str,Union[str,List[str]]]) –
- __init__(replacements)[source]
- Parameters
replacements (
Mapping[str,Union[str,List[str]]]) – mapping between SMILES strings to replace, and what to replace them with (given as a string or list of strings). Use dots for fragment bonds!
Methods
__init__(replacements)- type replacements
Mapping[str,Union[str,List[str]]]
from_molecule_annotations(molecule_annotations)Instantiate from a list of molecule annotations.
replace_in_reaction_equation(reaction_equation)Do the molecule replacements in a ReactionEquation instance.
replace_in_reaction_smiles(smiles[, ...])Do the molecule replacements in a reaction SMILES.
replace_molecule_smiles(smiles)Do the molecule replacements in a molecule SMILES.
- classmethod from_molecule_annotations(molecule_annotations)[source]
Instantiate from a list of molecule annotations.
- Parameters
molecule_annotations (
Iterable[MoleculeAnnotation]) –- Return type
- replace_in_reaction_equation(reaction_equation)[source]
Do the molecule replacements in a ReactionEquation instance.
- Parameters
reaction_equation (
ReactionEquation) –- Return type
ReactionEquation