![]() |
Chemical Data Processing Library Python API - Version 1.4.0
|
Abstract base class for data structures that represent chemical structures as molecular graphs. More...
Inheritance diagram for CDPL.Chem.MolecularGraph:Classes | |
| class | AtomSequence |
| class | BondSequence |
Public Member Functions | |
| None | __init__ () |
Contructs the MolecularGraph instance. | |
| AtomSequence | getAtoms () |
| BondSequence | getBonds () |
| MolecularGraph | clone () |
| Creates a deep copy of the molecular graph. More... | |
| Atom | getAtom (int idx) |
| Returns the atom at index idx. More... | |
| bool | containsAtom (Atom atom) |
| Tells whether the specified atom is part of the atom sequence. More... | |
| int | getAtomIndex (Atom atom) |
| Returns the index of the specified atom. More... | |
| int | getNumAtoms () |
| Returns the number of atoms. More... | |
| None | orderAtoms (BoolAtom2Functor func) |
| Orders the atoms according to criteria implemented by the provided atom comparison function. More... | |
| Entity3D | getEntity (int idx) |
| Returns the entity at index idx. More... | |
| int | getNumEntities () |
| Returns the number of stored Chem.Entity3D instances. More... | |
| Bond | getBond (int idx) |
| Returns the bond at index idx. More... | |
| bool | containsBond (Bond bond) |
| Tells whether the specified bond is part of the bond sequence. More... | |
| None | orderBonds (BoolBond2Functor func) |
| Orders the bonds according to criteria implemented by the provided bond comparison function. More... | |
| int | getBondIndex (Bond bond) |
| Returns the index of the specified bond. More... | |
| int | getNumBonds () |
| Returns the number of bonds. More... | |
| Base.Any | __getitem__ (Base.LookupKey key) |
| bool | __contains__ (Base.LookupKey key) |
Returns the result of the membership test operation key in self. More... | |
| bool | __contains__ (Bond bond) |
Returns the result of the membership test operation bond in self. More... | |
| bool | __contains__ (Atom atom) |
Returns the result of the membership test operation atom in self. More... | |
| None | __setitem__ (Base.LookupKey key, Base.Any val) |
| bool | __delitem__ (Base.LookupKey key) |
| int | __len__ () |
| Returns the number of property entries. More... | |
Public Member Functions inherited from CDPL.Chem.AtomContainer | |
| Atom | __getitem__ (int idx) |
Public Member Functions inherited from CDPL.Chem.Entity3DContainer | |
| int | getObjectID () |
| Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
Public Member Functions inherited from CDPL.Chem.BondContainer | |
| int | getObjectID () |
| Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
| Bond | __getitem__ (int idx) |
Public Member Functions inherited from CDPL.Base.PropertyContainer | |
| int | getObjectID () |
| Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
| int | getNumProperties () |
| Returns the number of property entries. More... | |
| Any | getPropertyOrDefault (LookupKey key, Any def_val) |
| Returns the value of the property specified by key , or the default value def_val if an entry does not exist. More... | |
| list | getPropertyKeys () |
| Returns a list containing the keys of the current property entries. More... | |
| list | getPropertyValues () |
| Returns a list containing the values of the current property entries. More... | |
| list | getProperties () |
| Returns a reference to itself. More... | |
| None | setProperty (LookupKey key, Any val) |
| Sets the value of the property specified by key to val. More... | |
| bool | removeProperty (LookupKey key) |
| Removes the entry for the property specified by key. More... | |
| Any | getProperty (LookupKey key, bool throw_=False) |
| Returns the value of the property specified by key. More... | |
| bool | isPropertySet (LookupKey key) |
| Tells whether or not a value has been assigned to the property specified by key. More... | |
| None | clearProperties () |
| Erases all container entries. | |
| None | addProperties (PropertyContainer cntnr) |
Adds the property entries of the PropertyContainer instance cntnr. More... | |
| None | copyProperties (PropertyContainer cntnr) |
| Replaces the current property entries by a copy of the entries in cntnr. More... | |
| None | swap (PropertyContainer cntnr) |
| Exchanges the property entries of this container with the ones of cntnr. More... | |
| Any | __getitem__ (LookupKey key) |
| Returns the value of the property specified by key. More... | |
| bool | __contains__ (LookupKey key) |
| Tells whether or not a value has been assigned to the property specified by key. More... | |
| None | __setitem__ (LookupKey key, Any val) |
| Sets the value of the property specified by key to val. More... | |
| bool | __delitem__ (LookupKey key) |
| Removes the entry for the property specified by key. More... | |
Properties | |
| atoms = property(getAtoms) | |
| bonds = property(getBonds) | |
Properties inherited from CDPL.Chem.AtomContainer | |
| numAtoms = property(getNumAtoms) | |
Properties inherited from CDPL.Chem.Entity3DContainer | |
| objectID = property(getObjectID) | |
| numEntities = property(getNumEntities) | |
Properties inherited from CDPL.Chem.BondContainer | |
| objectID = property(getObjectID) | |
| numBonds = property(getNumBonds) | |
Properties inherited from CDPL.Base.PropertyContainer | |
| objectID = property(getObjectID) | |
| propertyKeys = property(getPropertyKeys) | |
| propertyValues = property(getPropertyValues) | |
| properties = property(getProperties) | |
| numProperties = property(getNumProperties) | |
Abstract base class for data structures that represent chemical structures as molecular graphs.
Vertices (= atoms) of the molecular graph are represented by Chem.Atom instances and edges (= bonds) by Chem.Bond instances. Read-only access to the Chem.Atom and Chem.Bond instances is enabled by corresponding methods inherited from Chem.AtomContainer and Chem.BondContainer, respectively. Molecular graph properties can be stored/retrieved via methods provided by the Base.PropertyContainer base class. Deep copies of the molecular graph are created by the pure virtual clone() method which needs to be implemented by concrete subclasses (e.g. Chem.BasicMolecule, Chem.Fragment) of MolecularGraph.
| MolecularGraph CDPL.Chem.MolecularGraph.clone | ( | ) |
Creates a deep copy of the molecular graph.
| Atom CDPL.Chem.MolecularGraph.getAtom | ( | int | idx | ) |
Returns the atom at index idx.
| idx | The zero-based index of the atom to return. |
| Base.IndexError | if idx is not in the range [0, getNumAtoms()). |
Reimplemented from CDPL.Chem.AtomContainer.
Reimplemented in CDPL.Chem.Molecule.
| bool CDPL.Chem.MolecularGraph.containsAtom | ( | Atom | atom | ) |
Tells whether the specified atom is part of the atom sequence.
| atom | The atom to look for. |
True if atom is part of the sequence, and False otherwise. Reimplemented from CDPL.Chem.AtomContainer.
Reimplemented in CDPL.Chem.Molecule.
| int CDPL.Chem.MolecularGraph.getAtomIndex | ( | Atom | atom | ) |
Returns the index of the specified atom.
| atom | The atom for which to return the index. |
| Base.ItemNotFound | if the specified atom could not be found. |
Reimplemented from CDPL.Chem.AtomContainer.
Reimplemented in CDPL.Chem.Molecule.
| int CDPL.Chem.MolecularGraph.getNumAtoms | ( | ) |
Returns the number of atoms.
Reimplemented from CDPL.Chem.AtomContainer.
Reimplemented in CDPL.Chem.Molecule.
| None CDPL.Chem.MolecularGraph.orderAtoms | ( | BoolAtom2Functor | func | ) |
Orders the atoms according to criteria implemented by the provided atom comparison function.
| func | The atom comparison function implementing the applied ordering criteria. |
Reimplemented from CDPL.Chem.AtomContainer.
Reimplemented in CDPL.Chem.Molecule.
| Entity3D CDPL.Chem.MolecularGraph.getEntity | ( | int | idx | ) |
Returns the entity at index idx.
Forwards to getAtom() and exists to satisfy the Chem.Entity3DContainer interface.
| idx | The zero-based entity index. |
| Base.IndexError | if idx is not in the range [0, getNumAtoms()). |
Reimplemented from CDPL.Chem.AtomContainer.
Reimplemented in CDPL.Chem.Molecule.
| int CDPL.Chem.MolecularGraph.getNumEntities | ( | ) |
Returns the number of stored Chem.Entity3D instances.
Forwards to getNumAtoms() and exists to satisfy the Chem.Entity3DContainer interface.
Reimplemented from CDPL.Chem.AtomContainer.
Reimplemented in CDPL.Chem.Molecule.
| Bond CDPL.Chem.MolecularGraph.getBond | ( | int | idx | ) |
Returns the bond at index idx.
| idx | The zero-based index of the bond to return. |
| Base.IndexError | if idx is not in the range [0, getNumBonds()). |
Reimplemented from CDPL.Chem.BondContainer.
Reimplemented in CDPL.Chem.Molecule.
| bool CDPL.Chem.MolecularGraph.containsBond | ( | Bond | bond | ) |
Tells whether the specified bond is part of the bond sequence.
| bond | The bond to look for. |
True if bond is part of the sequence, and False otherwise. Reimplemented from CDPL.Chem.BondContainer.
Reimplemented in CDPL.Chem.Molecule.
| None CDPL.Chem.MolecularGraph.orderBonds | ( | BoolBond2Functor | func | ) |
Orders the bonds according to criteria implemented by the provided bond comparison function.
| func | The bond comparison function implementing the applied ordering criteria. |
Reimplemented from CDPL.Chem.BondContainer.
Reimplemented in CDPL.Chem.Molecule.
| int CDPL.Chem.MolecularGraph.getBondIndex | ( | Bond | bond | ) |
Returns the index of the specified bond.
| bond | The bond for which to return the index. |
| Base.ItemNotFound | if the specified bond could not be found. |
Reimplemented from CDPL.Chem.BondContainer.
Reimplemented in CDPL.Chem.Molecule.
| int CDPL.Chem.MolecularGraph.getNumBonds | ( | ) |
Returns the number of bonds.
Reimplemented from CDPL.Chem.BondContainer.
Reimplemented in CDPL.Chem.Molecule.
| bool CDPL.Chem.MolecularGraph.__contains__ | ( | Base.LookupKey | key | ) |
Returns the result of the membership test operation key in self.
| key | The value to test for membership. |
Reimplemented in CDPL.Chem.Molecule, and CDPL.Chem.Fragment.
| bool CDPL.Chem.MolecularGraph.__contains__ | ( | Bond | bond | ) |
Returns the result of the membership test operation bond in self.
| bond | The value to test for membership. |
Reimplemented from CDPL.Chem.BondContainer.
Reimplemented in CDPL.Chem.Molecule, and CDPL.Chem.Fragment.
| bool CDPL.Chem.MolecularGraph.__contains__ | ( | Atom | atom | ) |
Returns the result of the membership test operation atom in self.
| atom | The value to test for membership. |
Reimplemented from CDPL.Chem.AtomContainer.
Reimplemented in CDPL.Chem.Molecule, and CDPL.Chem.Fragment.
| int CDPL.Chem.MolecularGraph.__len__ | ( | ) |
Returns the number of property entries.
Reimplemented from CDPL.Base.PropertyContainer.
Reimplemented in CDPL.Chem.Molecule, CDPL.Chem.Fragment, CDPL.Biomol.HierarchyViewModel, and CDPL.Biomol.HierarchyViewChain.