Chemical Data Processing Library Python API - Version 1.2.0
|
A reader for molecule data in the native I/O format of the JME Molecular Editor [JME] java applet. More...
Public Member Functions | |
None | __init__ (Base.IStream is) |
Constructs a JMEMoleculeReader instance that will read the molecule data from the input stream is. More... | |
Public Member Functions inherited from CDPL.Chem.MoleculeReaderBase | |
None | __init__ () |
Initializes the MoleculeReaderBase instance. | |
MoleculeReaderBase | read (Molecule mol, bool overwrite=True) |
Reads the data record at the current record index and stores the read data in mol. More... | |
MoleculeReaderBase | read (int idx, Molecule mol, bool overwrite=True) |
Reads the data record at index idx and stores the read data in mol. More... | |
MoleculeReaderBase | skip () |
Skips the data record at the current record index. More... | |
bool | hasMoreData () |
Tells if there are any data records left to read. More... | |
int | getRecordIndex () |
Returns the index of the current data record. More... | |
None | setRecordIndex (int idx) |
Sets the index of the current data record to idx. More... | |
int | getNumRecords () |
Returns the total number of available data records. More... | |
None | close () |
Performs a reader specific shutdown operation (if required). More... | |
bool | __nonzero__ () |
bool | __bool__ () |
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__ () |
Additional Inherited Members | |
Properties inherited from CDPL.Chem.MoleculeReaderBase | |
numRecords = property(getNumRecords) | |
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 reader for molecule data in the native I/O format of the JME Molecular Editor [JME] java applet.
JMEMoleculeReader
implements the reading of Chem.Molecule objects from a std::istream
instance that provides the molecule data in the native I/O format of the JME Molecular Editor applet.
Attributes of the atoms and bonds of a read input molecule are stored as properties of allocated Chem.Atom and Chem.Bond objects. The affected properties are summarized in the tables below:
Chem.Atom Property | Description | Notes |
---|---|---|
Chem.AtomProperty.MATCH_CONSTRAINTS | Specifies atom matching constraints | Only set if constraints have been specified |
Chem.AtomProperty.COORDINATES_2D | Specifies the 2D position of the atom | - |
Chem.AtomProperty.TYPE | Specifies the type of the atom (see Chem.AtomType) | Only set if the atom is a query atom and the specified type is not a member of an atom list |
Chem.AtomProperty.SYMBOL | Specifies the atom symbol (e.g. element symbol) | Only set if the atom is not a query atom, or the symbol cannot be mapped to a valid atom type and is not a member of an atom list |
Chem.AtomProperty.FORMAL_CHARGE | Specifies the formal charge of the atom | Only set if the charge has been specified outside of an atom list |
Chem.AtomProperty.REACTION_ATOM_MAPPING_ID | Specifies the reactant to product atom mapping class | Only set if a mapping number has been specified that is greater than zero |
Chem.Bond Property | Description |
---|---|
Chem.BondProperty.ORDER | Specifies the order of the bond |
Chem.BondProperty.STEREO_2D_FLAG | Specifies the 2D stereo bond type (see Chem.BondStereoFlag) |
Beside the editing of conventional chemical structures, the JME applet allows to some extent the specification of atom matching constraints for the definition of substructure search queries. If such constraints are encountered during the processing of an atom specification, the constraint primitives are converted to corresponding Chem.MatchConstraint objects and stored as the value of the Chem.Atom property Chem.AtomProperty.MATCH_CONSTRAINTS in a Chem.MatchConstraintList data structure.
The following table lists all of the supported JME atom matching constraints and specifies how they are represented by Chem.MatchConstraint instances (in the table <n> denotes a positive integer value and the symbol of a chemical element):
Expression Primitive | Description | Mapped Chem.MatchConstraint object | ||
---|---|---|---|---|
Constraint ID | Operator | Value | ||
c | Aromatic carbon | Chem.AtomMatchConstraint.CONSTRAINT_LIST | Chem.MatchConstraint.EQUAL | A reference to a Chem.MatchConstraintList object |
The sub-constraint list has the logical type Chem.MatchConstraintList.AND_LIST and contains the elements: | ||||
Chem.AtomMatchConstraint.TYPE | Chem.MatchConstraint.EQUAL | Chem.AtomType.C | ||
Chem.AtomMatchConstraint.AROMATICITY | Chem.MatchConstraint.EQUAL | True | ||
n | Aromatic nitrogen | Chem.AtomMatchConstraint.CONSTRAINT_LIST | Chem.MatchConstraint.EQUAL | A reference to a Chem.MatchConstraintList object |
The sub-constraint list has the logical type Chem.MatchConstraintList.AND_LIST and contains the elements: | ||||
Chem.AtomMatchConstraint.TYPE | Chem.MatchConstraint.EQUAL | Chem.AtomType.N | ||
Chem.AtomMatchConstraint.AROMATICITY | Chem.MatchConstraint.EQUAL | True | ||
o | Aromatic oxygen | Chem.AtomMatchConstraint.CONSTRAINT_LIST | Chem.MatchConstraint.EQUAL | A reference to a Chem.MatchConstraintList object |
The sub-constraint list has the logical type Chem.MatchConstraintList.AND_LIST and contains the elements: | ||||
Chem.AtomMatchConstraint.TYPE | Chem.MatchConstraint.EQUAL | Chem.AtomType.O | ||
Chem.AtomMatchConstraint.AROMATICITY | Chem.MatchConstraint.EQUAL | True | ||
s | Aromatic sulfur | Chem.AtomMatchConstraint.CONSTRAINT_LIST | Chem.MatchConstraint.EQUAL | A reference to a Chem.MatchConstraintList object |
The sub-constraint list has the logical type Chem.MatchConstraintList.AND_LIST and contains the elements: | ||||
Chem.AtomMatchConstraint.TYPE | Chem.MatchConstraint.EQUAL | Chem.AtomType.S | ||
Chem.AtomMatchConstraint.AROMATICITY | Chem.MatchConstraint.EQUAL | True | ||
p | Aromatic phosphorus | Chem.AtomMatchConstraint.CONSTRAINT_LIST | Chem.MatchConstraint.EQUAL | A reference to a Chem.MatchConstraintList object |
The sub-constraint list has the logical type Chem.MatchConstraintList.AND_LIST and contains the elements: | ||||
Chem.AtomMatchConstraint.TYPE | Chem.MatchConstraint.EQUAL | Chem.AtomType.P | ||
Chem.AtomMatchConstraint.AROMATICITY | Chem.MatchConstraint.EQUAL | True | ||
a | Any aromatic atom | Chem.AtomMatchConstraint.CONSTRAINT_LIST | Chem.MatchConstraint.EQUAL | A reference to a Chem.MatchConstraintList object |
The sub-constraint list has the logical type Chem.MatchConstraintList.AND_LIST and contains the elements: | ||||
Chem.AtomMatchConstraint.TYPE | Chem.MatchConstraint.EQUAL | Chem.AtomType.ANY | ||
Chem.AtomMatchConstraint.AROMATICITY | Chem.MatchConstraint.EQUAL | True | ||
A | Any non-aromatic atom | Chem.AtomMatchConstraint.CONSTRAINT_LIST | Chem.MatchConstraint.EQUAL | A reference to a Chem.MatchConstraintList object |
The sub-constraint list has the logical type Chem.MatchConstraintList.AND_LIST and contains the elements: | ||||
Chem.AtomMatchConstraint.TYPE | Chem.MatchConstraint.EQUAL | Chem.AtomType.ANY | ||
Chem.AtomMatchConstraint.AROMATICITY | Chem.MatchConstraint.EQUAL | False | ||
False | ||||
True | ||||
False | ||||
The error handling behaviour of a JMEMoleculeReader
instance can be configured with the following control-parameter:
Control-Parameter | Default Value (see Chem.ControlParameterDefault) | Description |
---|---|---|
Chem.ControlParameter.STRICT_ERROR_CHECKING | False | Specifies whether non-fatal recoverable errors should be ignored or cause a read operation to fail |
Chem.ControlParameter.COORDINATES_DIMENSION | 2 | Specifies the dimension of atom coordinates |
None CDPL.Chem.JMEMoleculeReader.__init__ | ( | Base.IStream | is | ) |
Constructs a JMEMoleculeReader
instance that will read the molecule data from the input stream is.
is | The input stream to read from. |