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

A data structure for the storage and retrieval of stereochemical information about atoms and bonds. More...

+ Inheritance diagram for CDPL.Chem.StereoDescriptor:

Classes

class  ReferenceAtomArray
 

Public Member Functions

None __init__ (int config)
 Constructs a StereoDescriptor instance that specifies the configuration config but stores no reference atoms. More...
 
None __init__ (StereoDescriptor descr)
 Constructs a copy of the StereoDescriptor instance descr. More...
 
None __init__ (int config, Atom atom1, Atom atom2, Atom atom3)
 Constructs a StereoDescriptor instance that specifies a configuration of config for three reference atoms. More...
 
None __init__ (int config, Atom atom1, Atom atom2, Atom atom3, Atom atom4)
 Constructs a StereoDescriptor instance that specifies a configuration of config for four reference atoms. More...
 
int getConfiguration ()
 Returns the configuration of the reference atoms. More...
 
None setConfiguration (int config)
 Sets the configuration of the reference atoms to config. More...
 
int getNumReferenceAtoms ()
 Returns the number of specified reference atoms. More...
 
ReferenceAtomArray getReferenceAtoms ()
 Returns an array of references to the stored reference atoms. More...
 
StereoDescriptor assign (StereoDescriptor descr)
 Assignment operator. More...
 
int getPermutationParity (Atom atom1, Atom atom2, Atom atom3, Atom atom4)
 Tells if an odd or even number of atom transpositions is required to achieve the same ordering of reference and argument atoms. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
bool isValid (Atom atom)
 Tells wheter this StereoDescriptor instance is valid for the specified center atom. More...
 
str __str__ ()
 Returns a string representation of the StereoDescriptor instance. More...
 

Properties

 objectID = property(getObjectID)
 
 configuration = property(getConfiguration, setConfiguration)
 
 numReferenceAtoms = property(getNumReferenceAtoms)
 
 referenceAtoms = property(getReferenceAtoms)
 

Detailed Description

A data structure for the storage and retrieval of stereochemical information about atoms and bonds.

The stereochemistry of atoms and bonds is definded by an ordered list of reference atoms and an integer constant that describes the spatial configuration of the reference atoms. Requirements on the specification of the reference atom list and the way the associated steric configuration has to be interpreted both depend on the primary type of the stereocenter (if atom or bond) and, for atom centers, also on the number and geometric arrangement of the reference atoms. The following basic types of atom and bond stereocenters are currently supported:

Fig. 1a: R-Configuration
Fig. 1b: S-Configuration
Fig. 2a: R-Configuration
Fig. 2b: S-Configuration
Fig. 3a: Cis-Configuration
Fig. 3b: Trans-Configuration

Constructor & Destructor Documentation

◆ __init__() [1/4]

None CDPL.Chem.StereoDescriptor.__init__ ( int  config)

Constructs a StereoDescriptor instance that specifies the configuration config but stores no reference atoms.

Parameters
configA constant specifying the configuration of the central atoms.

◆ __init__() [2/4]

None CDPL.Chem.StereoDescriptor.__init__ ( StereoDescriptor  descr)

Constructs a copy of the StereoDescriptor instance descr.

Parameters
descrThe StereoDescriptor instance to copy.

◆ __init__() [3/4]

None CDPL.Chem.StereoDescriptor.__init__ ( int  config,
Atom  atom1,
Atom  atom2,
Atom  atom3 
)

Constructs a StereoDescriptor instance that specifies a configuration of config for three reference atoms.

Parameters
configA constant specifying the configuration of the reference atoms.
atom1The first reference atom.
atom2The second reference atom.
atom3The third reference atom.

◆ __init__() [4/4]

None CDPL.Chem.StereoDescriptor.__init__ ( int  config,
Atom  atom1,
Atom  atom2,
Atom  atom3,
Atom  atom4 
)

Constructs a StereoDescriptor instance that specifies a configuration of config for four reference atoms.

Parameters
configA flag specifying the configuration of the reference atoms.
atom1The first reference atom.
atom2The second reference atom.
atom3The third reference atom.
atom4The fourth reference atom.

Member Function Documentation

◆ getConfiguration()

int CDPL.Chem.StereoDescriptor.getConfiguration ( )

Returns the configuration of the reference atoms.

Returns
A constant specifying the configuration of the reference atoms.

◆ setConfiguration()

None CDPL.Chem.StereoDescriptor.setConfiguration ( int  config)

Sets the configuration of the reference atoms to config.

Parameters
configA constant specifying the configuration of the reference atoms.

◆ getNumReferenceAtoms()

int CDPL.Chem.StereoDescriptor.getNumReferenceAtoms ( )

Returns the number of specified reference atoms.

Returns
The number of specified reference atoms.

◆ getReferenceAtoms()

ReferenceAtomArray CDPL.Chem.StereoDescriptor.getReferenceAtoms ( )

Returns an array of references to the stored reference atoms.

Returns
An array of references to the stored reference atoms.

◆ assign()

StereoDescriptor CDPL.Chem.StereoDescriptor.assign ( StereoDescriptor  descr)

Assignment operator.

Parameters
descrThe StereoDescriptor instance to copy.
Returns
self

◆ getPermutationParity()

int CDPL.Chem.StereoDescriptor.getPermutationParity ( Atom  atom1,
Atom  atom2,
Atom  atom3,
Atom  atom4 
)

Tells if an odd or even number of atom transpositions is required to achieve the same ordering of reference and argument atoms.

Parameters
atom1The first atom.
atom2The second atom.
atom3The third atom.
atom4The fourth atom.
Returns
1 if an odd number of transpositions is required, 2 if an even number of transpositions is required and 0 if the argument atoms do not match the stored reference atoms.

◆ getObjectID()

int CDPL.Chem.StereoDescriptor.getObjectID ( )

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

Different Python StereoDescriptor 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 StereoDescriptor 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.

◆ isValid()

bool CDPL.Chem.StereoDescriptor.isValid ( Atom  atom)

Tells wheter this StereoDescriptor instance is valid for the specified center atom.

The method checks if the number of reference atoms is at least 3, the reference atoms are distinct and if every reference atom is connected to the argument atom.

Parameters
atomThe stereogenic center atom.
Returns
True if valid, False otherwise.

◆ __str__()

str CDPL.Chem.StereoDescriptor.__str__ ( )

Returns a string representation of the StereoDescriptor instance.

Returns
The generated string representation.