polymerist.rdutils.rdprops.bijection

For mapping 1-to-1 between pairs of identical molecules

Exceptions

SubstructMatchFailedError

Raised when molecule graph isomorphism match does not form a cover

MolSizeMismatchError

Raised when an operation is attempted on two molecules which were expected to have the same size but don't

Functions

bijective_atom_id_iter(→ Generator[tuple[int, int], ...)

Takes two chemically identical molecules, matches corresponding atoms between them 1:1, and generates matching atom id pairs

difference_rdmol(→ rdkit.Chem.rdchem.Mol)

Takes two RDKit Mols (presumed to have the same structure and atom map numbers) and the name of a property

Module Contents

exception polymerist.rdutils.rdprops.bijection.SubstructMatchFailedError[source]

Bases: Exception

Raised when molecule graph isomorphism match does not form a cover

exception polymerist.rdutils.rdprops.bijection.MolSizeMismatchError[source]

Bases: Exception

Raised when an operation is attempted on two molecules which were expected to have the same size but don’t

polymerist.rdutils.rdprops.bijection.bijective_atom_id_iter(rdmol_1: rdkit.Chem.rdchem.Mol, rdmol_2: rdkit.Chem.rdchem.Mol) Generator[tuple[int, int], None, None][source]

Takes two chemically identical molecules, matches corresponding atoms between them 1:1, and generates matching atom id pairs Yields atoms in pairs in the same order as the molecules being matched were provided

polymerist.rdutils.rdprops.bijection.difference_rdmol(rdmol_1: rdkit.Chem.rdchem.Mol, rdmol_2: rdkit.Chem.rdchem.Mol, prop: str = 'PartialCharge', remove_map_nums: bool = True) rdkit.Chem.rdchem.Mol[source]

Takes two RDKit Mols (presumed to have the same structure and atom map numbers) and the name of a property whose partial charges are the differences betwwen the two Mols’ charges (atomwise)

Assumes that the property in question is numeric (i.e. can be interpreted as a float)