rdkit.Chem.rdmolops module

Module containing RDKit functionality for manipulating molecules.

class rdkit.Chem.rdmolops.AddHsParameters(self)

Bases: object

Parameters controlling H addition.

property addCoords

add coordinates for the Hs

property addResidueInfo

add residue info to the Hs

property explicitOnly

only add explict Hs

property skipQueries

do not add Hs to query atoms or atoms with query bonds

class rdkit.Chem.rdmolops.AdjustQueryParameters(self)

Bases: object

Parameters controlling which components of the query atoms/bonds are adjusted.

Note that some of the options here are either directly contradictory or make

no sense when combined with each other. We generally assume that client code is doing something sensible and don’t attempt to detect possible conflicts or problems.

A note on the flags controlling which atoms/bonds are modified:

These generally limit the set of atoms/bonds to be modified. For example:

  • ADJUST_IGNORERINGS atoms/bonds in rings will not be modified.

  • ADJUST_IGNORENONE causes all atoms/bonds to be modified

  • ADJUST_IGNOREALL no atoms/bonds will be modified

Some of the options obviously make no sense for bonds

NoAdjustments = <nanobind.nb_func object>
property adjustConjugatedFiveRings

set bond queries in conjugated five-rings to SINGLE|DOUBLE|AROMATIC

property adjustDegree

add degree queries

property adjustDegreeFlags

controls which atoms have their degree queries changed

property adjustHeavyDegree

adjust the heavy-atom degree

property adjustHeavyDegreeFlags

controls which atoms have their heavy-atom degree queries changed

property adjustRingChain

add ring-chain queries to atoms

property adjustRingChainFlags

controls which atoms have ring-chain queries added

property adjustRingCount

add ring-count queries

property adjustRingCountFlags

controls which atoms have ring-count queries added

property adjustSingleBondsBetweenAromaticAtoms

sets non-ring single bonds between two aromatic or conjugated atoms to SINGLE|AROMATIC

property adjustSingleBondsToDegreeOneNeighbors

set single bonds bewteen aromatic or conjugated atoms and degree-one neighbors to SINGLE|AROMATIC

property aromatizeIfPossible

perceive and set aromaticity

property makeAtomsGeneric

convert atoms to generic queries (any atoms)

property makeAtomsGenericFlags

controls which atoms are converted to generic queries

property makeBondsGeneric

converts bonds to generic queries (any bonds)

property makeBondsGenericFlags

controls which bonds are converted to generic queries

property makeDummiesQueries

convert dummy atoms without isotope labels to any-atom queries

property setMDLFiveRingAromaticity

uses the 5-ring aromaticity behavior of the (former) MDL software as documented in the Chemical Representation Guide

property useStereoCareForBonds

if this is set sterochemistry information will be removed from double bonds that do not have the stereoCare property set

class rdkit.Chem.rdmolops.AdjustQueryWhichFlags(*values)

Bases: IntEnum

ADJUST_IGNOREALL = 268435455
ADJUST_IGNORECHAINS = 1
ADJUST_IGNOREDUMMIES = 2
ADJUST_IGNOREMAPPED = 16
ADJUST_IGNORENONDUMMIES = 8
ADJUST_IGNORENONE = 0
ADJUST_IGNORERINGS = 4
class rdkit.Chem.rdmolops.AromaticityModel(*values)

Bases: Enum

AROMATICITY_CUSTOM = 268435455
AROMATICITY_DEFAULT = 0
AROMATICITY_MDL = 4
AROMATICITY_MMFF94 = 8
AROMATICITY_RDKIT = 1
AROMATICITY_SIMPLE = 2
class rdkit.Chem.rdmolops.BondWedgingParameters

Bases: object

Parameters controlling how bond wedging is done.

property wedgeTwoBondsIfPossible

If this is enabled then two bonds will be wedged at chiral centers subject to the following constraints:

  1. ring bonds will not be wedged

  2. bonds to chiral centers will not be wedged

  3. bonds separated by more than 120 degrees will not be

    wedged

class rdkit.Chem.rdmolops.BoolVector(self)
class rdkit.Chem.rdmolops.BoolVector(self, arg: rdkit.Chem.rdmolops.BoolVector)
class rdkit.Chem.rdmolops.BoolVector(self, arg: collections.abc.Iterable[bool], /)

Bases: object

Overloaded function.

  1. __init__(self) -> None

Default constructor

  1. __init__(self, arg: rdkit.Chem.rdmolops.BoolVector) -> None

Copy constructor

  1. __init__(self, arg: collections.abc.Iterable[bool], /) -> None

Construct from an iterable object

append(self, arg: bool, /) None

Append arg to the end of the list.

clear(self) None

Remove all items from list.

count(self, arg: bool, /) int

Return number of occurrences of arg.

extend(self, arg: rdkit.Chem.rdmolops.BoolVector, /) None

Extend self by appending elements from arg.

insert(self, arg0: int, arg1: bool, /) None

Insert object arg1 before index arg0.

pop(self, index: int = -1) bool

Remove and return item at index (default last).

remove(self, arg: bool, /) None

Remove first occurrence of arg.

class rdkit.Chem.rdmolops.MolzipLabel(*values)

Bases: Enum

AtomMapNumber = 0
AtomType = 3
FragmentOnBonds = 2
Isotope = 1
class rdkit.Chem.rdmolops.MolzipParams(self)

Bases: object

Parameters controlling how to zip molecules together

OPTIONS:

label : set the MolzipLabel option [default MolzipLabel.AtomMapNumber]

MolzipLabel.AtomMapNumber: atom maps are on dummy atoms, zip together the corresponding

attached atoms, i.e. zip ‘C[:1]’ ‘N[:1]’ results in ‘CN’

MolzipLabel.Isotope: isotope labels are on dummy atoms, zip together the corresponding

attached atoms, i.e. zip ‘C[1*]’ ‘N[1*]’ results in ‘CN’

MolzipLabel.FragmentOnBonds: zip together molecules generated by fragment on bonds.

Note the atom indices cannot change or be reordered from the output of fragmentOnBonds

MolzipLabel.AtomTypes: choose the atom types to act as matching dummy atoms.

i.e. ‘C[V]’ and ‘N[Xe]’ with atoms pairs [(‘V’, ‘Xe’)] results in ‘CN’

property alignCoordinates

if true and the input fragments have coordinates, the fragments will be aligned along connection vectors in the output molecule

property enforceValenceRules

If true (default) enforce valences after zipping Setting this to false allows assembling chemically incorrect fragments.

property generateCoordinates

If true will add depiction coordinates to input molecules and zipped molecule (for molzipFragments only)

property label

Set the atom labeling system to zip together

setAtomSymbols(self, symbols: object) None

Set the atom symbols used to zip mols together when using AtomType labeling

class rdkit.Chem.rdmolops.RemoveHsParameters(self)

Bases: object

Parameters controlling which Hs are removed.

property removeAndTrackIsotopes

hydrogens with non-default isotopes and store them in the _isotopicHs atom property such that AddHs() can add the same isotope at a later stage

property removeDefiningBondStereo

hydrogens defining bond stereochemistry

property removeDegreeZero

hydrogens that have no bonds

property removeDummyNeighbors

hydrogens with at least one dummy-atom neighbor

property removeHigherDegrees

hydrogens with two (or more) bonds

property removeHydrides

hydrogens with formal charge -1

property removeInSGroups

hydrogens involved in SubstanceGroups

property removeIsotopes

hydrogens with non-default isotopes

property removeMapped

mapped hydrogens

property removeNonimplicit

DEPRECATED

property removeNontetrahedralNeighbors

hydrogens with neighbors that have non-tetrahedral stereochemistry

property removeOnlyHNeighbors

hydrogens with bonds only to other hydrogens

property removeWithQuery

hydrogens with queries defined

property removeWithWedgedBond

hydrogens with wedged bonds to them

property showWarnings

display warning messages for some classes of removed Hs

property updateExplicitCount

DEPRECATED

class rdkit.Chem.rdmolops.SanitizeFlags(*values)

Bases: IntEnum

SANITIZE_ADJUSTHS = 512
SANITIZE_ALL = 268435455
SANITIZE_CLEANUP = 1
SANITIZE_CLEANUPATROPISOMERS = 2048
SANITIZE_CLEANUPCHIRALITY = 256
SANITIZE_CLEANUP_ORGANOMETALLICS = 1024
SANITIZE_FINDRADICALS = 16
SANITIZE_KEKULIZE = 8
SANITIZE_NONE = 0
SANITIZE_PROPERTIES = 2
SANITIZE_SETAROMATICITY = 32
SANITIZE_SETCONJUGATION = 64
SANITIZE_SETHYBRIDIZATION = 128
SANITIZE_SYMMRINGS = 4
class rdkit.Chem.rdmolops.StereoBondThresholds

Bases: object

Constants used to set the thresholds for which single bonds can be made wavy.

CHIRAL_ATOM = 100000
DBL_BOND_NO_STEREO = 1000
DBL_BOND_SPECIFIED_STEREO = 10000
DIRECTION_SET = 1000000
class rdkit.Chem.rdmolops.StereoGroupAbsOptions(*values)

Bases: Enum

AlwaysInclude = 2
NeverInclude = 1
OnlyIncludeWhenOtherGroupsExist = 0
class rdkit.Chem.rdmolops.SubsetInfo(self)

Bases: object

property atomMapping

mapping from the original atom index to the subset atom index

property bondMapping

mapping from the original bond index to the subset bond index

class rdkit.Chem.rdmolops.SubsetMethod(*values)

Bases: Enum

BONDS = 1
BONDS_BETWEEN_ATOMS = 0
class rdkit.Chem.rdmolops.SubsetOptions(self)

Bases: object

property clearComputedProps

clear all computed props on the subsetted molecule

property conformerIdx

What conformer idx to use for the coordinates default is -1

property copyAsQuery

Return the subset as a query

property copyCoordinates

Copy the active coordinates from the molecule

property method

Subsetting method to use

property sanitize

Sanitize the resulting subset

class rdkit.Chem.rdmolops.SymmetrizeSSSRAlgorithm(*values)

Bases: Enum

DEFAULT = 0
LEGACY = 1
RDL = 2
class rdkit.Chem.rdmolops.UIntUIntMap(self)
class rdkit.Chem.rdmolops.UIntUIntMap(self, arg: rdkit.Chem.rdmolops.UIntUIntMap)
class rdkit.Chem.rdmolops.UIntUIntMap(self, arg: dict[int, int], /)

Bases: object

Overloaded function.

  1. __init__(self) -> None

Default constructor

  1. __init__(self, arg: rdkit.Chem.rdmolops.UIntUIntMap) -> None

Copy constructor

  1. __init__(self, arg: dict[int, int], /) -> None

Construct from a dictionary

class ItemView

Bases: object

class KeyView

Bases: object

class ValueView

Bases: object

clear(self) None

Remove all items

items(self) rdkit.Chem.rdmolops.UIntUIntMap.ItemView

Returns an iterable view of the map’s items.

keys(self) rdkit.Chem.rdmolops.UIntUIntMap.KeyView

Returns an iterable view of the map’s keys.

update(self, arg: rdkit.Chem.rdmolops.UIntUIntMap, /) None

Update the map with element from arg

values(self) rdkit.Chem.rdmolops.UIntUIntMap.ValueView

Returns an iterable view of the map’s values.