Skip to content

Neutralize

RXN_DATA = (('[Ov1-1:1]', '[Ov2+0:1]-[H]'), ('[#7v4+1:1]-[H]', '[#7v3+0:1]'), ('[Ov2-:1]', '[Ov2+0:1]'), ('[#7v3+1:1]', '[#7v3+0:1]'), ('[#7v2-1:1]', '[#7+0:1]-[H]'), ('[H]-[N:1]-[N:2]#[N:3]', '[N:1]=[N+1:2]=[N:3]-[H]'))

MoleculeNeutralizer(rxn_data=None)

High-level class to take SMILES, handle preprocessing, add Hs, run neutralization, and return a clean SMILES.

registry = ReactionRegistry(rxn_data)

neutralize_smiles(smiles)

NeutralizationReaction(smarts_reactant, smarts_product)

Represents a single neutralization reaction defined by a pair of SMARTS strings

PARAMETER DESCRIPTION
smarts_reactant

SMARTS for detecting the reactants of a defined neutralization reaction.

TYPE: str

smarts_product

SMARTS for what the detected smarts_reactant should be transformed to.

TYPE: str

smarts_product = smarts_product

smarts_reactant = smarts_reactant

__repr__()

__str__()

apply(mol)

Apply the neutralization reaction to the molecule. Returns the first product. If multiple products are generated, only the first is returned.

matches(mol)

Check if this reaction can be applied to the given molecule.

ReactionRegistry(rxn_data)

Holds a collection of NeutralizationReaction objects and applies them repeatedly until no further matches are found.

reactions = []

neutralize(mol)

Apply all registered neutralization reactions to the molecule in a loop until no further transformations are possible. Assumes explicit H atoms have already been added.