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

Assigns Cahn-Ingold-Prelog (CIP) configuration labels to stereogenic atoms and bonds of a molecular graph. More...

+ Inheritance diagram for CDPL.Chem.CIPConfigurationLabeler:

Public Member Functions

None __init__ ()
 Constructs the CIPConfigurationLabeler instance without an associated molecular graph.
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
CIPConfigurationLabeler assign (CIPConfigurationLabeler labeler)
 Replaces the state of this labeler by a copy of the state of labeler. More...
 
None setup (MolecularGraph molgraph)
 Prepares the labeler to assign CIP descriptors for the molecular graph molgraph. More...
 
int getLabel (Atom atom)
 Returns the CIP descriptor of the stereogenic atom atom. More...
 
int getLabel (Bond bond)
 Returns the CIP descriptor of the stereogenic bond bond. More...
 

Properties

 objectID = property(getObjectID)
 

Detailed Description

Assigns Cahn-Ingold-Prelog (CIP) configuration labels to stereogenic atoms and bonds of a molecular graph.

After calling setup() for a molecular graph the per-atom or per-bond CIP descriptor can be queried via the getLabel() overloads. The implementation is largely based on John Mayfield's Java implementation of the CIP sequence rules [CIPJM].

See also
Chem.CIPDescriptor
Since
1.1

Member Function Documentation

◆ getObjectID()

int CDPL.Chem.CIPConfigurationLabeler.getObjectID ( )

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

Different Python CIPConfigurationLabeler 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 CIPConfigurationLabeler 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()

CIPConfigurationLabeler CDPL.Chem.CIPConfigurationLabeler.assign ( CIPConfigurationLabeler  labeler)

Replaces the state of this labeler by a copy of the state of labeler.

Parameters
labelerThe source CIPConfigurationLabeler.
Returns
self

◆ setup()

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

Prepares the labeler to assign CIP descriptors for the molecular graph molgraph.

Parameters
molgraphThe molecular graph to label.

◆ getLabel() [1/2]

int CDPL.Chem.CIPConfigurationLabeler.getLabel ( Atom  atom)

Returns the CIP descriptor of the stereogenic atom atom.

Parameters
atomThe atom whose CIP descriptor is queried.
Returns
One of the Chem.CIPDescriptor values.

◆ getLabel() [2/2]

int CDPL.Chem.CIPConfigurationLabeler.getLabel ( Bond  bond)

Returns the CIP descriptor of the stereogenic bond bond.

Parameters
bondThe bond whose CIP descriptor is queried.
Returns
One of the Chem.CIPDescriptor values.