Chemical Data Processing Library Python API - Version 1.2.0
|
A writer for molecular graph data in the IUPAC International Chemical Identifier (InChI) [INCHI] format. More...
Public Member Functions | |
None | __init__ (Base.OStream os) |
Constructs a INCHIMolecularGraphWriter instance that will write data of molecular graphs to the output stream os. More... | |
int | getReturnCode () |
Returns the error code of the last write operation. More... | |
str | getMessage () |
Returns the error message associated with the last write operation. More... | |
str | getLogOutput () |
Returns the log output that was generated for the last write operation. More... | |
Public Member Functions inherited from CDPL.Chem.MolecularGraphWriterBase | |
None | __init__ () |
Initializes the MolecularGraphWriterBase instance. | |
MolecularGraphWriterBase | write (MolecularGraph molgraph) |
Writes the MolecularGraph object molgraph. More... | |
None | close () |
Writes format dependent data (if required) to mark the end of output. More... | |
bool | __bool__ () |
bool | __nonzero__ () |
Public Member Functions inherited from CDPL.Base.DataIOBase | |
int | registerIOCallback (VoidDataIOBaseFunctor func) |
Registers an I/O callback target function. More... | |
None | unregisterIOCallback (int id) |
Unregisters the I/O callback function specified by id. More... | |
None | invokeIOCallbacks (float progress) |
Invokes all registered I/O callback functions with the argument self . More... | |
None | clearIOCallbacks () |
Clears all registered I/O callback functions. | |
Public Member Functions inherited from CDPL.Base.ControlParameterContainer | |
None | setParameter (LookupKey key, Any value) |
bool | removeParameter (LookupKey key) |
Removes the entry for the control-parameter specified by key. More... | |
Any | getParameter (LookupKey key, bool throw_=False, bool local=False) |
Returns the value of the control-parameter specified by key. More... | |
Any | getParameterOrDefault (LookupKey key, Any def_value, bool local=False) |
bool | isParameterSet (LookupKey key, bool local=False) |
Tells whether or not a value has been assigned to the control-parameter specified by key. More... | |
None | clearParameters () |
Erases all container entries. More... | |
None | addParameters (ControlParameterContainer cntnr) |
Adds the control-parameter value entries in the ControlParameterContainer instance cntnr. More... | |
None | copyParameters (ControlParameterContainer cntnr) |
Replaces the current set of properties by a copy of the entries in cntnr. More... | |
int | getNumParameters () |
Returns the number of container entries. More... | |
int | registerParameterChangedCallback (VoidLookupKeyAnyFunctor func) |
Registers a callback target function that gets invoked when the value of a control-parameter has changed. More... | |
None | unregisterParameterChangedCallback (int id) |
Unregisters the callback specified by id. More... | |
int | registerParameterRemovedCallback (VoidLookupKeyFunctor func) |
Registers a callback target function that gets invoked when a control-parameter entry has been removed. More... | |
None | unregisterParameterRemovedCallback (int id) |
Unregisters the callback specified by id. More... | |
int | registerParentChangedCallback (VoidFunctor func) |
Registers a callback target function that gets invoked when the parent container has been changed or was detached. More... | |
None | unregisterParentChangedCallback (int id) |
Unregisters the callback specified by id. More... | |
ControlParameterContainer | getParent () |
Returns a reference to the parent control-parameter container. More... | |
None | setParent (ControlParameterContainer cntnr) |
Sets or removes the parent control-parameter container used to resolve requests for missing entries. More... | |
list | getParameterKeys () |
list | getParameterValues () |
list | getParameters () |
Returns a reference to itself. More... | |
int | getObjectID () |
Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
Any | __getitem__ (LookupKey key) |
None | __setitem__ (LookupKey key, Any value) |
bool | __delitem__ (LookupKey self) |
bool | __contains__ (LookupKey self, bool key) |
Returns the result of the membership test operation self in arg1 . More... | |
int | __len__ () |
Properties | |
returnCode = property(getReturnCode) | |
message = property(getMessage) | |
logOutput = property(getLogOutput) | |
Properties inherited from CDPL.Base.ControlParameterContainer | |
objectID = property(getObjectID) | |
parent = property(getParent, setParent) | |
parameterKeys = property(getParameterKeys) | |
parameterValues = property(getParameterValues) | |
parameters = property(getParameters) | |
numParameters = property(getNumParameters) | |
A writer for molecular graph data in the IUPAC International Chemical Identifier (InChI) [INCHI] format.
INCHIMolecularGraphWriter
implements the generation of InChI strings from Chem.MolecularGraph objects. The output data are written by means of a std::ostream
object that was provided to the INCHIMolecularGraphWriter
constructor.
For the generation of the InChI output, INCHIMolecularGraphWriter
uses the function GetINCHI()
of the InChI C-API. The return value of the function provides information about the status of the performed operation (see Chem.INCHIReturnCode) and can be accessed by the method getReturnCode(). Produced error and log messages are accessible via the methods getMessage() and getLogOutput(), respectively.
The generation of InChI strings requires values of the following Chem.Atom and Chem.Bond properties:
Chem.Atom Property | Description | Notes |
---|---|---|
Chem.AtomProperty.COORDINATES_2D | Specifies the 2D position of the atom | Only required if 2D atom coordinates are written |
Chem.AtomProperty.COORDINATES_3D | Specifies the 3D-coordinates of the atom | Only required if 3D atom coordinates are written |
Chem.AtomProperty.SYMBOL | Specifies the symbol of the atom's element | - |
Chem.AtomProperty.ISOTOPE | Specifies the isotopic mass of the atom | - |
Chem.AtomProperty.FORMAL_CHARGE | Specifies the formal charge of the atom | - |
Chem.AtomProperty.RADICAL_TYPE | Specifies the radical type (see Chem.RadicalType) | - |
Chem.AtomProperty.STEREO_DESCRIPTOR | Specifies the atom stereo descriptor (see Chem.AtomConfiguration, Chem.StereoDescriptor) | Only required if no atom coordinates are written |
Chem.Bond Property | Description | Notes |
---|---|---|
Chem.BondProperty.ORDER | Specifies the order of the bond | - |
Chem.BondProperty.STEREO_2D_FLAG | Specifies the 2D stereo bond type (see Chem.BondStereoFlag) | Only required if 2D or 3D atom coordinates are written |
Chem.BondProperty.STEREO_DESCRIPTOR | Specifies the stereo descriptor of the bond (see Chem.BondConfiguration, Chem.StereoDescriptor) | Only required if no atom coordinates are written |
INCHIMolecularGraphWriter
can be configured with the following control-parameters:
Control-Parameter | Default Value (see Chem.ControlParameterDefault) | Description |
---|---|---|
Chem.ControlParameter.COORDINATES_DIMENSION | 1 | Specifies the dimension of the atom coordinates (a value of 2 specifies 2D, a value of 3 specifies 3D, a value of zero specifies that no atom coordinates shall be written; any other value specifies that 3D-coordinates shall be written if they are available, and no coordinates otherwise) |
Chem.ControlParameter.STRICT_ERROR_CHECKING | False | Specifies whether non-fatal recoverable errors should be ignored or cause a write operation to fail |
Chem.ControlParameter.RECORD_SEPARATOR | "\n" | Specifies the data record separator |
Chem.ControlParameter.INCHI_OUTPUT_OPTIONS | "/WarnOnEmptyStructure /AuxNone /NEWPSOFF" | Specifies options for InChI generation |
None CDPL.Chem.INCHIMolecularGraphWriter.__init__ | ( | Base.OStream | os | ) |
Constructs a INCHIMolecularGraphWriter
instance that will write data of molecular graphs to the output stream os.
os | The output stream to write to. |
int CDPL.Chem.INCHIMolecularGraphWriter.getReturnCode | ( | ) |
Returns the error code of the last write operation.
Possible return values are defined in namespace Chem.INCHIReturnCode.
str CDPL.Chem.INCHIMolecularGraphWriter.getMessage | ( | ) |
Returns the error message associated with the last write operation.
str CDPL.Chem.INCHIMolecularGraphWriter.getLogOutput | ( | ) |
Returns the log output that was generated for the last write operation.