rdkit.Chem.MolStandardize.rdMolStandardize module

Module containing functions for molecular standardization

class rdkit.Chem.MolStandardize.rdMolStandardize.AllowedAtomsValidation(self, atoms: object)

Bases: ValidationMethod

class rdkit.Chem.MolStandardize.rdMolStandardize.ChargeCorrection(self, name: str, smarts: str, charge: int)

Bases: object

property Charge

(self) -> int

property Name

(self) -> str

property Smarts

(self) -> str

class rdkit.Chem.MolStandardize.rdMolStandardize.CleanupParameters(self)

Bases: object

Parameters controlling molecular standardization

property acidbaseFile

file containing the acid and base definitions

property doCanonical

apply atom-order dependent normalizations (like uncharging) in a canonical order

property fragmentFile

file containing the acid and base definitions

property largestFragmentChooserCountHeavyAtomsOnly

whether LargestFragmentChooser should only count heavy atoms (defaults to False)

property largestFragmentChooserUseAtomCount

Whether LargestFragmentChooser should use atom count as main criterion before MW (defaults to True)

property maxRestarts

maximum number of restarts

property maxTautomers

maximum number of tautomers to generate (defaults to 1000)

property maxTransforms

maximum number of transforms to apply during tautomer enumeration (defaults to 1000)

property normalizationsFile

file containing the normalization transformations

property preferOrganic

prefer organic fragments to inorganic ones when deciding what to keep

property tautomerReassignStereo

call AssignStereochemistry on all generated tautomers (defaults to True)

property tautomerRemoveBondStereo

remove stereochemistry from double bonds involved in tautomerism (defaults to True)

property tautomerRemoveIsotopicHs

remove isotopic Hs from centers involved in tautomerism (defaults to True)

property tautomerRemoveSp3Stereo

remove stereochemistry from sp3 centers involved in tautomerism (defaults to True)

property tautomerTransformsFile

file containing the tautomer transformations

class rdkit.Chem.MolStandardize.rdMolStandardize.DisallowedAtomsValidation(self, atoms: object)

Bases: ValidationMethod

class rdkit.Chem.MolStandardize.rdMolStandardize.DisallowedRadicalValidation(self)

Bases: ValidationMethod

class rdkit.Chem.MolStandardize.rdMolStandardize.FeaturesValidation(self, allowEnhancedStereo: bool = False, allowAromaticBondType: bool = False, allowDativeBondType: bool = False, allowQueries: bool = False, allowDummies: bool = False, allowAtomAliases: bool = False)

Bases: ValidationMethod

property allowAromaticBondType

(self) -> bool

property allowAtomAliases

(self) -> bool

property allowDativeBondType

(self) -> bool

property allowDummies

(self) -> bool

property allowEnhancedStereo

(self) -> bool

property allowQueries

(self) -> bool

class rdkit.Chem.MolStandardize.rdMolStandardize.FragmentRemover(self)
class rdkit.Chem.MolStandardize.rdMolStandardize.FragmentRemover(self, fragmentFilename: str = '', leave_last: bool = True, skip_if_all_match: bool = False)

Bases: object

remove(self, mol: rdkit.Chem.rdchem.Mol) rdkit.Chem.rdchem.Mol
removeInPlace(self, mol: rdkit.Chem.rdchem.Mol) None

modifies the molecule in place

class rdkit.Chem.MolStandardize.rdMolStandardize.FragmentValidation(self)

Bases: ValidationMethod

class rdkit.Chem.MolStandardize.rdMolStandardize.Is2DValidation(self, threshold: float = 0.001)

Bases: ValidationMethod

property threshold

(self) -> float

class rdkit.Chem.MolStandardize.rdMolStandardize.IsotopeValidation(self, strict: bool = False)

Bases: ValidationMethod

property strict

(self) -> bool

class rdkit.Chem.MolStandardize.rdMolStandardize.LargestFragmentChooser(self, preferOrganic: bool = False)
class rdkit.Chem.MolStandardize.rdMolStandardize.LargestFragmentChooser(self, params: rdkit.Chem.MolStandardize.rdMolStandardize.CleanupParameters)

Bases: object

choose(self, mol: rdkit.Chem.rdchem.Mol) rdkit.Chem.rdchem.Mol
chooseInPlace(self, mol: rdkit.Chem.rdchem.Mol) None

modifies the molecule in place

class rdkit.Chem.MolStandardize.rdMolStandardize.Layout2DValidation(self, clashLimit: float = 0.15, bondLengthLimit: float = 25.0, allowLongBondsInRings: bool = True, allowAtomBondClashExemption: bool = True, minMedianBondLength: float = False)

Bases: ValidationMethod

property allowAtomBondClashExemption

(self) -> bool

property allowLongBondsInRings

(self) -> bool

property bondLengthLimit

(self) -> float

property clashLimit

(self) -> float

property minMedianBondLength

(self) -> float

class rdkit.Chem.MolStandardize.rdMolStandardize.MetalDisconnector(self, options: rdkit.Chem.MolStandardize.rdMolStandardize.MetalDisconnectorOptions | None = None)

Bases: object

a class to disconnect metals that are defined as covalently bonded to non-metals

Disconnect(self, mol: rdkit.Chem.rdchem.Mol) rdkit.Chem.rdchem.Mol

performs the disconnection

DisconnectInPlace(self, mol: rdkit.Chem.rdchem.Mol) None

performs the disconnection, modifies the input molecule

property MetalNof

SMARTS defining the metals to disconnect if attached to Nitrogen, Oxygen or Fluorine

property MetalNon

SMARTS defining the metals to disconnect other inorganic elements

SetMetalNof(self, mol: rdkit.Chem.rdchem.Mol) None

Set the query molecule defining the metals to disconnect if attached to Nitrogen, Oxygen or Fluorine.

SetMetalNon(self, mol: rdkit.Chem.rdchem.Mol) None

Set the query molecule defining the metals to disconnect from other inorganic elements.

class rdkit.Chem.MolStandardize.rdMolStandardize.MetalDisconnectorOptions(self)

Bases: object

Metal Disconnector Options

property adjustCharges

Whether to adjust charges on ligand atoms. Default true.

property removeHapticDummies

Whether to remove the dummy atoms representing haptic bonds. Such dummies are bonded to the metal with a bond that has the MolFileBondEndPts prop set. Default false.

property splitAromaticC

Whether to split metal-aromatic C bonds. Default false.

property splitGrignards

Whether to split Grignard-type complexes. Default false.

class rdkit.Chem.MolStandardize.rdMolStandardize.MolVSValidation(self)
class rdkit.Chem.MolStandardize.rdMolStandardize.MolVSValidation(self, validations: object)

Bases: ValidationMethod

class rdkit.Chem.MolStandardize.rdMolStandardize.NeutralValidation(self)

Bases: ValidationMethod

class rdkit.Chem.MolStandardize.rdMolStandardize.NoAtomValidation(self)

Bases: ValidationMethod

class rdkit.Chem.MolStandardize.rdMolStandardize.Normalizer(self)
class rdkit.Chem.MolStandardize.rdMolStandardize.Normalizer(self, normalizeFilename: str, maxRestarts: int)

Bases: object

normalize(self, mol: rdkit.Chem.rdchem.Mol) rdkit.Chem.rdchem.Mol
normalizeInPlace(self, mol: rdkit.Chem.rdchem.Mol) None

modifies the input molecule

class rdkit.Chem.MolStandardize.rdMolStandardize.Pipeline(self)
class rdkit.Chem.MolStandardize.rdMolStandardize.Pipeline(self, options: rdkit.Chem.MolStandardize.rdMolStandardize.PipelineOptions)

Bases: object

run(self, molData: str) rdkit.Chem.MolStandardize.rdMolStandardize.PipelineResult
class rdkit.Chem.MolStandardize.rdMolStandardize.PipelineLog(self)
class rdkit.Chem.MolStandardize.rdMolStandardize.PipelineLog(self, arg: rdkit.Chem.MolStandardize.rdMolStandardize.PipelineLog)
class rdkit.Chem.MolStandardize.rdMolStandardize.PipelineLog(self, arg: collections.abc.Iterable[rdkit.Chem.MolStandardize.rdMolStandardize.PipelineLogEntry], /)

Bases: object

Overloaded function.

  1. __init__(self) -> None

Default constructor

  1. __init__(self, arg: rdkit.Chem.MolStandardize.rdMolStandardize.PipelineLog) -> None

Copy constructor

  1. __init__(self, arg: collections.abc.Iterable[rdkit.Chem.MolStandardize.rdMolStandardize.PipelineLogEntry], /) -> None

Construct from an iterable object

append(self, arg: rdkit.Chem.MolStandardize.rdMolStandardize.PipelineLogEntry, /) None

Append arg to the end of the list.

clear(self) None

Remove all items from list.

count(self, arg: rdkit.Chem.MolStandardize.rdMolStandardize.PipelineLogEntry, /) int

Return number of occurrences of arg.

extend(self, arg: rdkit.Chem.MolStandardize.rdMolStandardize.PipelineLog, /) None

Extend self by appending elements from arg.

insert(self, arg0: int, arg1: rdkit.Chem.MolStandardize.rdMolStandardize.PipelineLogEntry, /) None

Insert object arg1 before index arg0.

pop(self, index: int = -1) rdkit.Chem.MolStandardize.rdMolStandardize.PipelineLogEntry

Remove and return item at index (default last).

remove(self, arg: rdkit.Chem.MolStandardize.rdMolStandardize.PipelineLogEntry, /) None

Remove first occurrence of arg.

class rdkit.Chem.MolStandardize.rdMolStandardize.PipelineLogEntry

Bases: object

property detail

(self) -> str

property status

(self) -> rdkit.Chem.MolStandardize.rdMolStandardize.PipelineStatus

class rdkit.Chem.MolStandardize.rdMolStandardize.PipelineOptions(self)

Bases: object

property allowAromaticBondType

(self) -> bool

property allowAtomBondClashExemption

(self) -> bool

property allowDativeBondType

(self) -> bool

property allowEmptyMolecules

(self) -> bool

property allowEnhancedStereo

(self) -> bool

property allowLongBondsInRings

(self) -> bool

property atomClashLimit

(self) -> float

property bondLengthLimit

(self) -> float

property is2DZeroThreshold

(self) -> float

property metalNof

(self) -> str

property metalNon

(self) -> str

property minMedianBondLength

(self) -> float

property normalizerData

(self) -> str

property normalizerMaxRestarts

(self) -> int

property outputV2000

(self) -> bool

property reportAllFailures

(self) -> bool

property scaledMedianBondLength

(self) -> float

property strictParsing

(self) -> bool

class rdkit.Chem.MolStandardize.rdMolStandardize.PipelineResult

Bases: object

property inputMolData

(self) -> str

property log

(self) -> rdkit.Chem.MolStandardize.rdMolStandardize.PipelineLog

property outputMolData

(self) -> str

property parentMolData

(self) -> str

property stage

(self) -> rdkit.Chem.MolStandardize.rdMolStandardize.PipelineStage

property status

(self) -> rdkit.Chem.MolStandardize.rdMolStandardize.PipelineStatus

class rdkit.Chem.MolStandardize.rdMolStandardize.PipelineStage(*values)

Bases: Enum

COMPLETED = 10
PARSING_INPUT = 1
PREPARE_FOR_STANDARDIZATION = 4
PREPARE_FOR_VALIDATION = 2
SERIALIZING_OUTPUT = 9
STANDARDIZATION = 5
VALIDATION = 3
class rdkit.Chem.MolStandardize.rdMolStandardize.PipelineStatus(*values)

Bases: IntFlag

BASIC_VALIDATION_ERROR = 8
CHARGE_STANDARDIZATION_ERROR = 2048
FEATURES_VALIDATION_ERROR = 4
FRAGMENTS_REMOVED = 33554432
FRAGMENT_STANDARDIZATION_ERROR = 1024
INPUT_ERROR = 1
IS2D_VALIDATION_ERROR = 16
LAYOUT2D_VALIDATION_ERROR = 32
METALS_DISCONNECTED = 8388608
METAL_STANDARDIZATION_ERROR = 256
NORMALIZATION_APPLIED = 16777216
NORMALIZER_STANDARDIZATION_ERROR = 512
NO_EVENT = 0
OUTPUT_ERROR = 4096
PIPELINE_ERROR = 8191
PREPARE_FOR_STANDARDIZATION_ERROR = 128
PREPARE_FOR_VALIDATION_ERROR = 2
PROTONATION_CHANGED = 67108864
STANDARDIZATION_ERROR = 3840
STEREO_VALIDATION_ERROR = 64
STRUCTURE_MODIFICATION = 125829120
VALIDATION_ERROR = 124
class rdkit.Chem.MolStandardize.rdMolStandardize.RDKitValidation(self, allowEmptyMolecules: bool = False)

Bases: ValidationMethod

property allowEmptyMolecules

(self) -> bool

class rdkit.Chem.MolStandardize.rdMolStandardize.Reionizer(self)
class rdkit.Chem.MolStandardize.rdMolStandardize.Reionizer(self, acidbaseFile: str)
class rdkit.Chem.MolStandardize.rdMolStandardize.Reionizer(self, acidbaseFile: str, ccs: collections.abc.Sequence[rdkit.Chem.MolStandardize.rdMolStandardize.ChargeCorrection])

Bases: object

reionize(self, mol: rdkit.Chem.rdchem.Mol) rdkit.Chem.rdchem.Mol
reionizeInPlace(self, mol: rdkit.Chem.rdchem.Mol) None

modifies the input molecule

class rdkit.Chem.MolStandardize.rdMolStandardize.SmilesTautomerMap

Bases: object

maps SMILES strings to the respective Tautomer objects

items(self) tuple
keys(self) tuple
values(self) tuple
class rdkit.Chem.MolStandardize.rdMolStandardize.StereoValidation(self)

Bases: ValidationMethod

class rdkit.Chem.MolStandardize.rdMolStandardize.SubstructTerm(self, name: str, smarts: str, score: int)

Bases: object

Sets the score of this particular tautomer substructure, higher scores are more preferable Aromatic rings score 100, all carbon aromatic rings score 250

property name

(self) -> str

property score

(self) -> int

property smarts

(self) -> str

class rdkit.Chem.MolStandardize.rdMolStandardize.SubstructTermVector(self)
class rdkit.Chem.MolStandardize.rdMolStandardize.SubstructTermVector(self, arg: rdkit.Chem.MolStandardize.rdMolStandardize.SubstructTermVector)
class rdkit.Chem.MolStandardize.rdMolStandardize.SubstructTermVector(self, arg: collections.abc.Iterable[rdkit.Chem.MolStandardize.rdMolStandardize.SubstructTerm], /)

Bases: object

Overloaded function.

  1. __init__(self) -> None

Default constructor

  1. __init__(self, arg: rdkit.Chem.MolStandardize.rdMolStandardize.SubstructTermVector) -> None

Copy constructor

  1. __init__(self, arg: collections.abc.Iterable[rdkit.Chem.MolStandardize.rdMolStandardize.SubstructTerm], /) -> None

Construct from an iterable object

append(self, arg: rdkit.Chem.MolStandardize.rdMolStandardize.SubstructTerm, /) None

Append arg to the end of the list.

clear(self) None

Remove all items from list.

count(self, arg: rdkit.Chem.MolStandardize.rdMolStandardize.SubstructTerm, /) int

Return number of occurrences of arg.

extend(self, arg: rdkit.Chem.MolStandardize.rdMolStandardize.SubstructTermVector, /) None

Extend self by appending elements from arg.

insert(self, arg0: int, arg1: rdkit.Chem.MolStandardize.rdMolStandardize.SubstructTerm, /) None

Insert object arg1 before index arg0.

pop(self, index: int = -1) rdkit.Chem.MolStandardize.rdMolStandardize.SubstructTerm

Remove and return item at index (default last).

remove(self, arg: rdkit.Chem.MolStandardize.rdMolStandardize.SubstructTerm, /) None

Remove first occurrence of arg.

class rdkit.Chem.MolStandardize.rdMolStandardize.Tautomer

Bases: object

used to hold the aromatic and kekulized versions of each tautomer

property kekulized

kekulized version of the tautomer

property tautomer

aromatic version of the tautomer

class rdkit.Chem.MolStandardize.rdMolStandardize.TautomerEnumerator(self)
class rdkit.Chem.MolStandardize.rdMolStandardize.TautomerEnumerator(self, params: rdkit.Chem.MolStandardize.rdMolStandardize.CleanupParameters)
class rdkit.Chem.MolStandardize.rdMolStandardize.TautomerEnumerator(self, other: rdkit.Chem.MolStandardize.rdMolStandardize.TautomerEnumerator)

Bases: object

Canonicalize(self, mol: rdkit.Chem.rdchem.Mol) rdkit.Chem.rdchem.Mol
Canonicalize(self, mol: rdkit.Chem.rdchem.Mol, scoreFunc: object) rdkit.Chem.rdchem.Mol

Overloaded function.

  1. Canonicalize(self, mol: rdkit.Chem.rdchem.Mol) -> rdkit.Chem.rdchem.Mol

Returns the canonical tautomer for a molecule.

The default scoring scheme is inspired by the publication: M. Sitzmann et al., “Tautomerism in Large Databases.”, JCAMD 24:521 (2010) https://doi.org/10.1007/s10822-010-9346-4

Note that the canonical tautomer is very likely not the most stable tautomer for any given conditions. The default scoring rules are designed to produce “reasonable” tautomers, but the primary concern is that the results are canonical: you always get the same canonical tautomer for a molecule regardless of what the input tautomer or atom ordering were.

  1. Canonicalize(self, mol: rdkit.Chem.rdchem.Mol, scoreFunc: object) -> rdkit.Chem.rdchem.Mol

picks the canonical tautomer from an iterable of molecules using a custom scoring function

Enumerate(self, mol: rdkit.Chem.rdchem.Mol) rdkit.Chem.MolStandardize.rdMolStandardize.TautomerEnumeratorResult

Generates the tautomers for a molecule.

The enumeration rules are inspired by the publication: M. Sitzmann et al., “Tautomerism in Large Databases.”, JCAMD 24:521 (2010) https://doi.org/10.1007/s10822-010-9346-4

Note: the definitions used here are that the atoms modified during tautomerization are the atoms at the beginning and end of each tautomer transform (the H “donor” and H “acceptor” in the transform) and the bonds modified during transformation are any bonds whose order is changed during the tautomer transform (these are the bonds between the “donor” and the “acceptor”).

GetCallback(self) object

Get the TautomerEnumeratorCallback subclass instance, or None if none was set.

GetMaxTautomers(self) int

returns the maximum number of tautomers to be generated.

GetMaxTransforms(self) int

returns the maximum number of transformations to be applied.

GetReassignStereo(self) bool

returns whether AssignStereochemistry will be called on each tautomer generated by the Enumerate() method.

GetRemoveBondStereo(self) bool

returns whether stereochemistry information will be removed from double bonds involved in tautomerism.

GetRemoveSp3Stereo(self) bool

returns whether stereochemistry information will be removed from sp3 atoms involved in tautomerism.

PickCanonical(self, iterable: object) rdkit.Chem.rdchem.Mol
PickCanonical(self, iterable: object, scoreFunc: object) rdkit.Chem.rdchem.Mol

Overloaded function.

  1. PickCanonical(self, iterable: object) -> rdkit.Chem.rdchem.Mol

picks the canonical tautomer from an iterable of molecules

  1. PickCanonical(self, iterable: object, scoreFunc: object) -> rdkit.Chem.rdchem.Mol

returns the canonical tautomer for a molecule using a custom scoring function

ScoreTautomer = <nanobind.nb_func object>
SetCallback(self, callback: object) None

Pass an instance of a class derived from TautomerEnumeratorCallback, which must implement the __call__() method.

SetMaxTautomers(self, maxTautomers: int) None

set the maximum number of tautomers to be generated.

SetMaxTransforms(self, maxTransforms: int) None

set the maximum number of transformations to be applied. This limit is usually hit earlier than the maxTautomers limit and leads to a more linear scaling of CPU time with increasing number of tautomeric centers (see Sitzmann et al.).

SetReassignStereo(self, reassignStereo: bool) None

set to True if you wish AssignStereochemistry to be called on each tautomer generated by the Enumerate() method. This defaults to True.

SetRemoveBondStereo(self, removeBondStereo: bool) None

set to True if you wish stereochemistry information to be removed from double bonds involved in tautomerism. This means that enols will lose their E/Z stereochemistry after going through tautomer enumeration because of the keto-enolic tautomerism. This defaults to True in the RDKit and also in the workflow described by Sitzmann et al.

SetRemoveSp3Stereo(self, removeSp3Stereo: bool) None

set to True if you wish stereochemistry information to be removed from sp3 atoms involved in tautomerism. This means that S-aminoacids will lose their stereochemistry after going through tautomer enumeration because of the amido-imidol tautomerism. This defaults to True in RDKit, and to False in the workflow described by Sitzmann et al.

tautomerScoreVersion = '1.0.0'
class rdkit.Chem.MolStandardize.rdMolStandardize.TautomerEnumeratorCallback(self)

Bases: object

Create a derived class from this abstract base class and implement the __call__() method. The __call__() method is called in the innermost loop of the algorithm, and provides a mechanism to monitor or stop its progress.

To have your callback called, pass an instance of your derived class to TautomerEnumerator.SetCallback()

class rdkit.Chem.MolStandardize.rdMolStandardize.TautomerEnumeratorResult

Bases: object

used to return tautomer enumeration results

property modifiedAtoms

tuple of atom indices modified by the transforms

property modifiedBonds

tuple of bond indices modified by the transforms

property smiles

SMILES of tautomers generated by the enumerator

property smilesTautomerMap

dictionary mapping SMILES strings to the respective Tautomer objects

property status

whether the enumeration completed or not; see TautomerEnumeratorStatus for possible values

property tautomers

tautomers generated by the enumerator

class rdkit.Chem.MolStandardize.rdMolStandardize.TautomerEnumeratorStatus(*values)

Bases: Enum

Canceled = 3
Completed = 0
MaxTautomersReached = 1
MaxTransformsReached = 2
class rdkit.Chem.MolStandardize.rdMolStandardize.Uncharger(self, canonicalOrder: bool = True, force: bool = False, protonationOnly: bool = False)

Bases: object

uncharge(self, mol: rdkit.Chem.rdchem.Mol) rdkit.Chem.rdchem.Mol
unchargeInPlace(self, mol: rdkit.Chem.rdchem.Mol) None

modifies the input molecule

class rdkit.Chem.MolStandardize.rdMolStandardize.ValidationMethod(self)

Bases: object

validate(self, mol: rdkit.Chem.rdchem.Mol, reportAllFailures: bool = False) list