Chemical Data Processing Library Python API - Version 1.4.0
Classes | Public Member Functions | Properties | List of all members
CDPL.Chem.StereoisomerGenerator Class Reference

Enumerates the stereoisomers of a molecular graph by flipping the configurations of selected atom and bond stereocenters. More...

+ Inheritance diagram for CDPL.Chem.StereoisomerGenerator:

Classes

class  StereoDescriptorArray
 Array of StereoDescriptor values (one per atom or one per bond of the input molecular graph). More...
 

Public Member Functions

None __init__ ()
 Initializes the StereoisomerGenerator instance.
 
None __init__ (StereoisomerGenerator gen)
 Initializes a copy of the StereoisomerGenerator instance gen. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
StereoisomerGenerator assign (StereoisomerGenerator gen)
 Replaces the current state of self with a copy of the state of the StereoisomerGenerator instance gen. More...
 
None setAtomPredicate (AtomPredicate pred)
 Sets the predicate used to filter atom stereocenters considered during enumeration. More...
 
AtomPredicate getAtomPredicate ()
 Returns the currently configured atom predicate. More...
 
None setBondPredicate (BondPredicate pred)
 Sets the predicate used to filter bond stereocenters considered during enumeration. More...
 
BondPredicate getBondPredicate ()
 Returns the currently configured bond predicate. More...
 
None enumerateAtomConfig (bool enumerate)
 Specifies whether atom-stereocenter configurations shall be enumerated. More...
 
bool atomConfigEnumerated ()
 Tells whether atom-stereocenter configurations are enumerated. More...
 
None enumerateBondConfig (bool enumerate)
 Specifies whether bond-stereocenter configurations shall be enumerated. More...
 
bool bondConfigEnumerated ()
 Tells whether bond-stereocenter configurations are enumerated. More...
 
None includeSpecifiedCenters (bool include)
 Specifies whether stereocenters with explicitly specified configurations shall be enumerated. More...
 
bool specifiedCentersIncluded ()
 Tells whether specified stereocenters are enumerated. More...
 
None includeSymmetricCenters (bool include)
 Specifies whether topologically-symmetric stereocenters shall be enumerated. More...
 
bool symmetricCentersIncluded ()
 Tells whether topologically-symmetric stereocenters are enumerated. More...
 
None includeBridgeheadAtoms (bool include)
 Specifies whether bridgehead atoms in fused ring systems shall be enumerated as stereocenters. More...
 
bool bridgeheadAtomsIncluded ()
 Tells whether bridgehead atoms are enumerated. More...
 
None includeInvertibleNitrogens (bool include)
 Specifies whether invertible (pyramidal) nitrogen stereocenters shall be enumerated. More...
 
bool invertibleNitrogensIncluded ()
 Tells whether invertible nitrogen stereocenters are enumerated. More...
 
None includeRingBonds (bool include)
 Specifies whether ring bonds (large enough to allow cis/trans isomerism) shall be enumerated. More...
 
bool ringBondsIncluded ()
 Tells whether ring bonds are enumerated. More...
 
None setMinRingSize (int min_size)
 Sets the minimum ring size for a ring bond to be eligible as a stereocenter. More...
 
int getMinRingSize ()
 Returns the minimum ring size for a ring bond to be eligible as a stereocenter. More...
 
None setup (MolecularGraph molgraph)
 Prepares the generator for enumerating the stereoisomers of molgraph. More...
 
bool generate ()
 Advances the enumeration by one step and updates the per-atom/per-bond stereo-descriptor arrays. More...
 
StereoDescriptorArray getAtomDescriptors ()
 Returns the per-atom stereo descriptors for the current stereoisomer. More...
 
StereoDescriptorArray getBondDescriptors ()
 Returns the per-bond stereo descriptors for the current stereoisomer. More...
 

Properties

 objectID = property(getObjectID)
 
 atomPredicate = property(getAtomPredicate, setAtomPredicate)
 
 bondPredicate = property(getBondPredicate, setBondPredicate)
 
 enumAtomConfig = property(atomConfigEnumerated, enumerateAtomConfig)
 
 enumBondConfig = property(enumerateBondConfig, bondConfigEnumerated)
 
 incSpecifiedCenters = property(specifiedCentersIncluded, includeSpecifiedCenters)
 
 incSymmetricCenters = property(symmetricCentersIncluded, includeSymmetricCenters)
 
 incBridgeheadAtoms = property(bridgeheadAtomsIncluded, includeBridgeheadAtoms)
 
 incInvNitrogens = property(invertibleNitrogensIncluded, includeInvertibleNitrogens)
 
 incRingBonds = property(ringBondsIncluded, includeRingBonds)
 
 minRingSize = property(getMinRingSize, setMinRingSize)
 
 atomDescriptors = property(getAtomDescriptors)
 
 bondDescriptors = property(getBondDescriptors)
 

Detailed Description

Enumerates the stereoisomers of a molecular graph by flipping the configurations of selected atom and bond stereocenters.

After calling setup() for an input molecular graph, each call to generate() yields the next stereoisomer (encoded as per-atom and per-bond StereoDescriptor arrays accessible via getAtomDescriptors() / getBondDescriptors()); generate() returns False when the enumeration is exhausted. Atom and bond predicates plus a number of inclusion flags control which stereocenters are enumerated.

Since
1.1

Constructor & Destructor Documentation

◆ __init__()

None CDPL.Chem.StereoisomerGenerator.__init__ ( StereoisomerGenerator  gen)

Initializes a copy of the StereoisomerGenerator instance gen.

Parameters
genThe StereoisomerGenerator instance to copy.

Member Function Documentation

◆ getObjectID()

int CDPL.Chem.StereoisomerGenerator.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python StereoisomerGenerator instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two StereoisomerGenerator instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ assign()

StereoisomerGenerator CDPL.Chem.StereoisomerGenerator.assign ( StereoisomerGenerator  gen)

Replaces the current state of self with a copy of the state of the StereoisomerGenerator instance gen.

Parameters
genThe StereoisomerGenerator instance to copy.
Returns
self

◆ setAtomPredicate()

None CDPL.Chem.StereoisomerGenerator.setAtomPredicate ( AtomPredicate  pred)

Sets the predicate used to filter atom stereocenters considered during enumeration.

Parameters
predThe new atom predicate.

◆ getAtomPredicate()

AtomPredicate CDPL.Chem.StereoisomerGenerator.getAtomPredicate ( )

Returns the currently configured atom predicate.

Returns
A reference to the atom predicate.

◆ setBondPredicate()

None CDPL.Chem.StereoisomerGenerator.setBondPredicate ( BondPredicate  pred)

Sets the predicate used to filter bond stereocenters considered during enumeration.

Parameters
predThe new bond predicate.

◆ getBondPredicate()

BondPredicate CDPL.Chem.StereoisomerGenerator.getBondPredicate ( )

Returns the currently configured bond predicate.

Returns
A reference to the bond predicate.

◆ enumerateAtomConfig()

None CDPL.Chem.StereoisomerGenerator.enumerateAtomConfig ( bool  enumerate)

Specifies whether atom-stereocenter configurations shall be enumerated.

Parameters
enumerateIf True, atom configurations are flipped during enumeration.

◆ atomConfigEnumerated()

bool CDPL.Chem.StereoisomerGenerator.atomConfigEnumerated ( )

Tells whether atom-stereocenter configurations are enumerated.

Returns
True if atom configurations are enumerated, and False otherwise.

◆ enumerateBondConfig()

None CDPL.Chem.StereoisomerGenerator.enumerateBondConfig ( bool  enumerate)

Specifies whether bond-stereocenter configurations shall be enumerated.

Parameters
enumerateIf True, bond configurations are flipped during enumeration.

◆ bondConfigEnumerated()

bool CDPL.Chem.StereoisomerGenerator.bondConfigEnumerated ( )

Tells whether bond-stereocenter configurations are enumerated.

Returns
True if bond configurations are enumerated, and False otherwise.

◆ includeSpecifiedCenters()

None CDPL.Chem.StereoisomerGenerator.includeSpecifiedCenters ( bool  include)

Specifies whether stereocenters with explicitly specified configurations shall be enumerated.

Parameters
includeIf True, specified stereocenters are also flipped.

◆ specifiedCentersIncluded()

bool CDPL.Chem.StereoisomerGenerator.specifiedCentersIncluded ( )

Tells whether specified stereocenters are enumerated.

Returns
True if specified stereocenters are included, and False otherwise.

◆ includeSymmetricCenters()

None CDPL.Chem.StereoisomerGenerator.includeSymmetricCenters ( bool  include)

Specifies whether topologically-symmetric stereocenters shall be enumerated.

Parameters
includeIf True, symmetric stereocenters are also flipped.

◆ symmetricCentersIncluded()

bool CDPL.Chem.StereoisomerGenerator.symmetricCentersIncluded ( )

Tells whether topologically-symmetric stereocenters are enumerated.

Returns
True if symmetric stereocenters are included, and False otherwise.

◆ includeBridgeheadAtoms()

None CDPL.Chem.StereoisomerGenerator.includeBridgeheadAtoms ( bool  include)

Specifies whether bridgehead atoms in fused ring systems shall be enumerated as stereocenters.

Parameters
includeIf True, bridgehead atoms are included.

◆ bridgeheadAtomsIncluded()

bool CDPL.Chem.StereoisomerGenerator.bridgeheadAtomsIncluded ( )

Tells whether bridgehead atoms are enumerated.

Returns
True if bridgehead atoms are included, and False otherwise.

◆ includeInvertibleNitrogens()

None CDPL.Chem.StereoisomerGenerator.includeInvertibleNitrogens ( bool  include)

Specifies whether invertible (pyramidal) nitrogen stereocenters shall be enumerated.

Parameters
includeIf True, invertible nitrogens are included.

◆ invertibleNitrogensIncluded()

bool CDPL.Chem.StereoisomerGenerator.invertibleNitrogensIncluded ( )

Tells whether invertible nitrogen stereocenters are enumerated.

Returns
True if invertible nitrogens are included, and False otherwise.

◆ includeRingBonds()

None CDPL.Chem.StereoisomerGenerator.includeRingBonds ( bool  include)

Specifies whether ring bonds (large enough to allow cis/trans isomerism) shall be enumerated.

Parameters
includeIf True, ring bonds whose ring is at least getMinRingSize() atoms in size are included.

◆ ringBondsIncluded()

bool CDPL.Chem.StereoisomerGenerator.ringBondsIncluded ( )

Tells whether ring bonds are enumerated.

Returns
True if ring bonds are included, and False otherwise.

◆ setMinRingSize()

None CDPL.Chem.StereoisomerGenerator.setMinRingSize ( int  min_size)

Sets the minimum ring size for a ring bond to be eligible as a stereocenter.

Parameters
min_sizeThe new minimum ring size (in atoms).

◆ getMinRingSize()

int CDPL.Chem.StereoisomerGenerator.getMinRingSize ( )

Returns the minimum ring size for a ring bond to be eligible as a stereocenter.

Returns
The minimum ring size.

◆ setup()

None CDPL.Chem.StereoisomerGenerator.setup ( MolecularGraph  molgraph)

Prepares the generator for enumerating the stereoisomers of molgraph.

Parameters
molgraphThe input molecular graph.

◆ generate()

bool CDPL.Chem.StereoisomerGenerator.generate ( )

Advances the enumeration by one step and updates the per-atom/per-bond stereo-descriptor arrays.

Returns
True if a new stereoisomer was generated, and False if the enumeration is exhausted.

◆ getAtomDescriptors()

StereoDescriptorArray CDPL.Chem.StereoisomerGenerator.getAtomDescriptors ( )

Returns the per-atom stereo descriptors for the current stereoisomer.

Returns
A reference to the atom-stereo-descriptor array.

◆ getBondDescriptors()

StereoDescriptorArray CDPL.Chem.StereoisomerGenerator.getBondDescriptors ( )

Returns the per-bond stereo descriptors for the current stereoisomer.

Returns
A reference to the bond-stereo-descriptor array.