Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | 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...

#include <StereoisomerGenerator.hpp>

Public Types

typedef std::shared_ptr< StereoisomerGeneratorSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated StereoisomerGenerator instances. More...
 
typedef Util::Array< StereoDescriptorStereoDescriptorArray
 Array of StereoDescriptor values (one per atom or one per bond of the input molecular graph). More...
 

Public Member Functions

void setAtomPredicate (const AtomPredicate &pred)
 Sets the predicate used to filter atom stereocenters considered during enumeration. More...
 
const AtomPredicategetAtomPredicate () const
 Returns the currently configured atom predicate. More...
 
void setBondPredicate (const BondPredicate &pred)
 Sets the predicate used to filter bond stereocenters considered during enumeration. More...
 
const BondPredicategetBondPredicate () const
 Returns the currently configured bond predicate. More...
 
void enumerateAtomConfig (bool enumerate)
 Specifies whether atom-stereocenter configurations shall be enumerated. More...
 
bool atomConfigEnumerated () const
 Tells whether atom-stereocenter configurations are enumerated. More...
 
void enumerateBondConfig (bool enumerate)
 Specifies whether bond-stereocenter configurations shall be enumerated. More...
 
bool bondConfigEnumerated () const
 Tells whether bond-stereocenter configurations are enumerated. More...
 
void includeSpecifiedCenters (bool include)
 Specifies whether stereocenters with explicitly specified configurations shall be enumerated. More...
 
bool specifiedCentersIncluded () const
 Tells whether specified stereocenters are enumerated. More...
 
void includeSymmetricCenters (bool include)
 Specifies whether topologically-symmetric stereocenters shall be enumerated. More...
 
bool symmetricCentersIncluded () const
 Tells whether topologically-symmetric stereocenters are enumerated. More...
 
void includeBridgeheadAtoms (bool include)
 Specifies whether bridgehead atoms in fused ring systems shall be enumerated as stereocenters. More...
 
bool bridgeheadAtomsIncluded () const
 Tells whether bridgehead atoms are enumerated. More...
 
void includeInvertibleNitrogens (bool include)
 Specifies whether invertible (pyramidal) nitrogen stereocenters shall be enumerated. More...
 
bool invertibleNitrogensIncluded () const
 Tells whether invertible nitrogen stereocenters are enumerated. More...
 
void includeRingBonds (bool include)
 Specifies whether ring bonds (large enough to allow cis/trans isomerism) shall be enumerated. More...
 
bool ringBondsIncluded () const
 Tells whether ring bonds are enumerated. More...
 
void setMinRingSize (std::size_t min_size)
 Sets the minimum ring size for a ring bond to be eligible as a stereocenter. More...
 
std::size_t getMinRingSize () const
 Returns the minimum ring size for a ring bond to be eligible as a stereocenter. More...
 
void setup (const 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...
 
const StereoDescriptorArraygetAtomDescriptors ()
 Returns the per-atom stereo descriptors for the current stereoisomer. More...
 
const StereoDescriptorArraygetBondDescriptors ()
 Returns the per-bond stereo descriptors for the current stereoisomer. More...
 

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

Member Typedef Documentation

◆ SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated StereoisomerGenerator instances.

◆ StereoDescriptorArray

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

Member Function Documentation

◆ setAtomPredicate()

void CDPL::Chem::StereoisomerGenerator::setAtomPredicate ( const AtomPredicate pred)

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

Parameters
predThe new atom predicate.

◆ getAtomPredicate()

const AtomPredicate& CDPL::Chem::StereoisomerGenerator::getAtomPredicate ( ) const

Returns the currently configured atom predicate.

Returns
A const reference to the atom predicate.

◆ setBondPredicate()

void CDPL::Chem::StereoisomerGenerator::setBondPredicate ( const BondPredicate pred)

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

Parameters
predThe new bond predicate.

◆ getBondPredicate()

const BondPredicate& CDPL::Chem::StereoisomerGenerator::getBondPredicate ( ) const

Returns the currently configured bond predicate.

Returns
A const reference to the bond predicate.

◆ enumerateAtomConfig()

void 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 ( ) const

Tells whether atom-stereocenter configurations are enumerated.

Returns
true if atom configurations are enumerated, and false otherwise.

◆ enumerateBondConfig()

void 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 ( ) const

Tells whether bond-stereocenter configurations are enumerated.

Returns
true if bond configurations are enumerated, and false otherwise.

◆ includeSpecifiedCenters()

void 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 ( ) const

Tells whether specified stereocenters are enumerated.

Returns
true if specified stereocenters are included, and false otherwise.

◆ includeSymmetricCenters()

void 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 ( ) const

Tells whether topologically-symmetric stereocenters are enumerated.

Returns
true if symmetric stereocenters are included, and false otherwise.

◆ includeBridgeheadAtoms()

void 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 ( ) const

Tells whether bridgehead atoms are enumerated.

Returns
true if bridgehead atoms are included, and false otherwise.

◆ includeInvertibleNitrogens()

void 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 ( ) const

Tells whether invertible nitrogen stereocenters are enumerated.

Returns
true if invertible nitrogens are included, and false otherwise.

◆ includeRingBonds()

void 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 ( ) const

Tells whether ring bonds are enumerated.

Returns
true if ring bonds are included, and false otherwise.

◆ setMinRingSize()

void CDPL::Chem::StereoisomerGenerator::setMinRingSize ( std::size_t  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()

std::size_t CDPL::Chem::StereoisomerGenerator::getMinRingSize ( ) const

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

Returns
The minimum ring size.

◆ setup()

void CDPL::Chem::StereoisomerGenerator::setup ( const 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()

const StereoDescriptorArray& CDPL::Chem::StereoisomerGenerator::getAtomDescriptors ( )

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

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

◆ getBondDescriptors()

const StereoDescriptorArray& CDPL::Chem::StereoisomerGenerator::getBondDescriptors ( )

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

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

The documentation for this class was generated from the following file: