![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Data structure representing a canonicalized molecular fragment. More...
#include <CanonicalFragment.hpp>
Inheritance diagram for CDPL::ConfGen::CanonicalFragment:Public Types | |
| typedef std::shared_ptr< CanonicalFragment > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated CanonicalFragment instances. More... | |
| typedef Chem::BasicMolecule::AtomIterator | AtomIterator |
| A mutable iterator over the contained atoms. More... | |
| typedef Chem::BasicMolecule::ConstAtomIterator | ConstAtomIterator |
| A constant iterator over the contained atoms. More... | |
| typedef Chem::BasicMolecule::BondIterator | BondIterator |
| A mutable iterator over the contained bonds. More... | |
| typedef Chem::BasicMolecule::ConstBondIterator | ConstBondIterator |
| A constant iterator over the contained bonds. More... | |
| typedef std::vector< const Chem::Atom * > | AtomMapping |
| Maps each atom of the fragment (in canonical order) to the corresponding atom of the parent molecular graph. More... | |
Public Types inherited from CDPL::Chem::MolecularGraph | |
| typedef std::shared_ptr< MolecularGraph > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated MolecularGraph instances. More... | |
Public Types inherited from CDPL::Chem::AtomContainer | |
| typedef Util::IndexedElementIterator< const Atom, ConstAtomAccessor > | ConstAtomIterator |
A constant random access iterator used to iterate over the stored const Chem::Atom objects. More... | |
| typedef Util::IndexedElementIterator< Atom, AtomAccessor > | AtomIterator |
| A mutable random access iterator used to iterate over the stored Chem::Atom objects. More... | |
Public Types inherited from CDPL::Chem::Entity3DContainer | |
| typedef Util::IndexedElementIterator< const Entity3D, ConstEntityAccessor > | ConstEntityIterator |
A constant random access iterator used to iterate over the stored const Chem::Entity3D objects. More... | |
| typedef Util::IndexedElementIterator< Entity3D, EntityAccessor > | EntityIterator |
| A mutable random access iterator used to iterate over the stored Chem::Entity3D objects. More... | |
Public Types inherited from CDPL::Chem::BondContainer | |
| typedef Util::IndexedElementIterator< const Bond, ConstBondAccessor > | ConstBondIterator |
A constant random access iterator used to iterate over the stored const Chem::Bond objects. More... | |
| typedef Util::IndexedElementIterator< Bond, BondAccessor > | BondIterator |
| A mutable random access iterator used to iterate over the stored Chem::Bond objects. More... | |
Public Types inherited from CDPL::Base::PropertyContainer | |
| typedef PropertyMap::value_type | PropertyEntry |
| A Base::LookupKey / Base::Any pair that stores the property value for a given property key. More... | |
| typedef PropertyMap::const_iterator | ConstPropertyIterator |
| A constant iterator used to iterate over the property entries. More... | |
Public Member Functions | |
| CanonicalFragment () | |
Constructs an empty CanonicalFragment instance. More... | |
| CanonicalFragment (const Chem::MolecularGraph &molgraph, const Chem::MolecularGraph &parent) | |
Constructs a CanonicalFragment instance from the fragment molgraph of the parent molecular graph parent. More... | |
| CanonicalFragment (const CanonicalFragment &frag) | |
Constructs a copy of the CanonicalFragment instance frag. More... | |
| void | clear () |
| Removes all atoms and bonds and resets the hash code. More... | |
| std::size_t | getNumAtoms () const |
| Returns the number of atoms in the fragment. More... | |
| const Chem::Atom & | getAtom (std::size_t idx) const |
Returns a const reference to the atom at index idx. More... | |
| Chem::Atom & | getAtom (std::size_t idx) |
| Returns a reference to the atom at index idx. More... | |
| ConstAtomIterator | getAtomsBegin () const |
| Returns a constant iterator pointing to the first atom. More... | |
| ConstAtomIterator | getAtomsEnd () const |
| Returns a constant iterator pointing one past the last atom. More... | |
| AtomIterator | getAtomsBegin () |
| Returns a mutable iterator pointing to the first atom. More... | |
| AtomIterator | getAtomsEnd () |
| Returns a mutable iterator pointing one past the last atom. More... | |
| bool | containsAtom (const Chem::Atom &atom) const |
| Tells whether the fragment contains atom. More... | |
| std::size_t | getAtomIndex (const Chem::Atom &atom) const |
| Returns the index of atom in the fragment. More... | |
| std::size_t | getNumEntities () const |
| Returns the number of 3D entities in the fragment. More... | |
| const Chem::Entity3D & | getEntity (std::size_t idx) const |
Returns a const reference to the 3D entity at index idx. More... | |
| Chem::Entity3D & | getEntity (std::size_t idx) |
| Returns a reference to the 3D entity at index idx. More... | |
| std::size_t | getNumBonds () const |
| Returns the number of bonds in the fragment. More... | |
| const Chem::Bond & | getBond (std::size_t idx) const |
Returns a const reference to the bond at index idx. More... | |
| Chem::Bond & | getBond (std::size_t idx) |
| Returns a reference to the bond at index idx. More... | |
| ConstBondIterator | getBondsBegin () const |
| Returns a constant iterator pointing to the first bond. More... | |
| ConstBondIterator | getBondsEnd () const |
| Returns a constant iterator pointing one past the last bond. More... | |
| BondIterator | getBondsBegin () |
| Returns a mutable iterator pointing to the first bond. More... | |
| BondIterator | getBondsEnd () |
| Returns a mutable iterator pointing one past the last bond. More... | |
| bool | containsBond (const Chem::Bond &bond) const |
| Tells whether the fragment contains bond. More... | |
| std::size_t | getBondIndex (const Chem::Bond &bond) const |
| Returns the index of bond in the fragment. More... | |
| void | orderAtoms (const Chem::AtomCompareFunction &func) |
| Reorders the atoms of the fragment according to func. More... | |
| void | orderBonds (const Chem::BondCompareFunction &func) |
| Reorders the bonds of the fragment according to func. More... | |
| std::uint64_t | getHashCode () const |
| Returns the hash code of the fragment. More... | |
| Chem::MolecularGraph::SharedPointer | clone () const |
| Creates and returns a deep copy of the fragment. More... | |
| CanonicalFragment & | operator= (const CanonicalFragment &frag) |
| Replaces the contents of this fragment with a copy of frag. More... | |
| void | create (const Chem::MolecularGraph &molgraph, const Chem::MolecularGraph &parent, bool modify=true, bool strip_aro_subst=true) |
| Builds the canonical fragment from the fragment molgraph of the parent molecular graph parent. More... | |
| const AtomMapping & | getAtomMapping () const |
| Returns the atom mapping from this fragment to the parent molecular graph. More... | |
| void | perceiveSSSR () |
| Perceives the smallest set of smallest rings of the fragment. More... | |
Public Member Functions inherited from CDPL::Chem::MolecularGraph | |
| virtual | ~MolecularGraph () |
| Virtual destructor. More... | |
Public Member Functions inherited from CDPL::Chem::AtomContainer | |
| ConstAtomIterator | getAtomsBegin () const |
Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects. More... | |
| ConstAtomIterator | getAtomsEnd () const |
Returns a constant iterator pointing to the end of the stored const Chem::Atom objects. More... | |
| AtomIterator | getAtomsBegin () |
| Returns a mutable iterator pointing to the beginning of the stored Chem::Atom objects. More... | |
| AtomIterator | getAtomsEnd () |
| Returns a mutable iterator pointing to the end of the stored Chem::Atom objects. More... | |
| ConstAtomIterator | begin () const |
Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects. More... | |
| ConstAtomIterator | end () const |
Returns a constant iterator pointing to the end of the stored const Chem::Atom objects. More... | |
| AtomIterator | begin () |
| Returns a mutable iterator pointing to the beginning of the stored Chem::Atom objects. More... | |
| AtomIterator | end () |
| Returns a mutable iterator pointing to the end of the stored Chem::Atom objects. More... | |
| const AtomContainer & | getAtoms () const |
Returns a const reference to itself. More... | |
| AtomContainer & | getAtoms () |
| Returns a reference to itself. More... | |
Public Member Functions inherited from CDPL::Chem::Entity3DContainer | |
| ConstEntityIterator | getEntitiesBegin () const |
Returns a constant iterator pointing to the beginning of the stored const Chem::Entity3D objects. More... | |
| ConstEntityIterator | getEntitiesEnd () const |
Returns a constant iterator pointing to the end of the stored const Chem::Entity3D objects. More... | |
| EntityIterator | getEntitiesBegin () |
| Returns a mutable iterator pointing to the beginning of the stored Chem::Entity3D objects. More... | |
| EntityIterator | getEntitiesEnd () |
| Returns a mutable iterator pointing to the end of the stored Chem::Entity3D objects. More... | |
| ConstEntityIterator | begin () const |
Returns a constant iterator pointing to the beginning of the stored const Chem::Entity3D objects. More... | |
| ConstEntityIterator | end () const |
Returns a constant iterator pointing to the end of the stored const Chem::Entity3D objects. More... | |
| EntityIterator | begin () |
| Returns a mutable iterator pointing to the beginning of the stored Chem::Entity3D objects. More... | |
| EntityIterator | end () |
| Returns a mutable iterator pointing to the end of the stored Chem::Entity3D objects. More... | |
| const Entity3DContainer & | getEntities () const |
Returns a const reference to itself. More... | |
| Entity3DContainer & | getEntities () |
| Returns a reference to itself. More... | |
Public Member Functions inherited from CDPL::Chem::BondContainer | |
| ConstBondIterator | getBondsBegin () const |
Returns a constant iterator pointing to the beginning of the stored const Chem::Bond objects. More... | |
| ConstBondIterator | getBondsEnd () const |
Returns a constant iterator pointing to the end of the stored const Chem::Bond objects. More... | |
| BondIterator | getBondsBegin () |
| Returns a mutable iterator pointing to the beginning of the stored Chem::Bond objects. More... | |
| BondIterator | getBondsEnd () |
| Returns a mutable iterator pointing to the end of the stored Chem::Bond objects. More... | |
| ConstBondIterator | begin () const |
Returns a constant iterator pointing to the beginning of the stored const Chem::Bond objects. More... | |
| ConstBondIterator | end () const |
Returns a constant iterator pointing to the end of the stored const Chem::Bond objects. More... | |
| BondIterator | begin () |
| Returns a mutable iterator pointing to the beginning of the stored Chem::Bond objects. More... | |
| BondIterator | end () |
| Returns a mutable iterator pointing to the end of the stored Chem::Bond objects. More... | |
| const BondContainer & | getBonds () const |
Returns a const reference to itself. More... | |
| BondContainer & | getBonds () |
| Returns a reference to itself. More... | |
Public Member Functions inherited from CDPL::Base::PropertyContainer | |
| std::size_t | getNumProperties () const |
| Returns the number of property entries. More... | |
| template<typename T > | |
| void | setProperty (const LookupKey &key, T &&val) |
| Sets the value of the property specified by key to val. More... | |
| template<typename T > | |
| const T & | getProperty (const LookupKey &key) const |
Returns the value of the property specified by key as a const reference to an object of type T. More... | |
| template<typename T > | |
| const T & | getPropertyOrDefault (const LookupKey &key, const T &def_val) const |
Returns the value of the property specified by key as a const reference to an object of type T, or the default value def_val if a stored value does not exist. More... | |
| const Any & | getProperty (const LookupKey &key, bool throw_=false) const |
| Returns the value of the property specified by key. More... | |
| bool | isPropertySet (const LookupKey &key) const |
| Tells whether or not a value has been assigned to the property specified by key. More... | |
| ConstPropertyIterator | getPropertiesBegin () const |
| Returns a constant iterator pointing to the beginning of the property entries. More... | |
| ConstPropertyIterator | getPropertiesEnd () const |
| Returns a constant iterator pointing to the end of the property entries. More... | |
| ConstPropertyIterator | begin () const |
| Returns a constant iterator pointing to the beginning of the property entries. More... | |
| ConstPropertyIterator | end () const |
| Returns a constant iterator pointing to the end of the property entries. More... | |
| bool | removeProperty (const LookupKey &key) |
| Clears the value of the property specified by key. More... | |
| void | clearProperties () |
| Clears all property values. More... | |
| void | addProperties (const PropertyContainer &cntnr) |
Adds the property value entries in the PropertyContainer instance cntnr. More... | |
| void | copyProperties (const PropertyContainer &cntnr) |
| Replaces the current set of properties by a copy of the entries in cntnr. More... | |
| void | swap (PropertyContainer &cntnr) |
| Exchanges the properties of this container with the properties of the container cntnr. More... | |
| const PropertyContainer & | getProperties () const |
Returns a const reference to itself. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CDPL::Chem::MolecularGraph | |
| MolecularGraph & | operator= (const MolecularGraph &molgraph) |
| Assignment operator. More... | |
Protected Member Functions inherited from CDPL::Chem::AtomContainer | |
| virtual | ~AtomContainer () |
| Virtual destructor. More... | |
| AtomContainer & | operator= (const AtomContainer &cntnr) |
| Assignment operator. More... | |
Protected Member Functions inherited from CDPL::Chem::Entity3DContainer | |
| virtual | ~Entity3DContainer () |
| Virtual destructor. More... | |
| Entity3DContainer & | operator= (const Entity3DContainer &cntnr) |
| Assignment operator. More... | |
Protected Member Functions inherited from CDPL::Chem::BondContainer | |
| virtual | ~BondContainer () |
| Virtual destructor. More... | |
| BondContainer & | operator= (const BondContainer &cntnr) |
| Assignment operator. More... | |
Protected Member Functions inherited from CDPL::Base::PropertyContainer | |
| PropertyContainer () | |
Constructs an empty PropertyContainer instance. More... | |
| PropertyContainer (const PropertyContainer &cntnr) | |
Constructs a copy of the PropertyContainer instance cntnr. More... | |
| virtual | ~PropertyContainer () |
| Virtual destructor. More... | |
| PropertyContainer & | operator= (const PropertyContainer &cntnr) |
| Assignment operator. More... | |
Data structure representing a canonicalized molecular fragment.
A CanonicalFragment is constructed from a fragment of a parent molecular graph and stores a canonicalized copy of the fragment's atoms and bonds. Canonicalization yields a stable atom ordering and an associated hash code that uniquely identifies the topology (and, optionally, the stereochemistry) of the fragment.
| typedef std::shared_ptr<CanonicalFragment> CDPL::ConfGen::CanonicalFragment::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated CanonicalFragment instances.
A mutable iterator over the contained atoms.
A constant iterator over the contained atoms.
A mutable iterator over the contained bonds.
A constant iterator over the contained bonds.
| typedef std::vector<const Chem::Atom*> CDPL::ConfGen::CanonicalFragment::AtomMapping |
Maps each atom of the fragment (in canonical order) to the corresponding atom of the parent molecular graph.
| CDPL::ConfGen::CanonicalFragment::CanonicalFragment | ( | ) |
Constructs an empty CanonicalFragment instance.
| CDPL::ConfGen::CanonicalFragment::CanonicalFragment | ( | const Chem::MolecularGraph & | molgraph, |
| const Chem::MolecularGraph & | parent | ||
| ) |
Constructs a CanonicalFragment instance from the fragment molgraph of the parent molecular graph parent.
| molgraph | The molecular graph defining the fragment to canonicalize. |
| parent | The parent molecular graph the fragment was derived from. |
| CDPL::ConfGen::CanonicalFragment::CanonicalFragment | ( | const CanonicalFragment & | frag | ) |
Constructs a copy of the CanonicalFragment instance frag.
| frag | The CanonicalFragment to copy. |
| void CDPL::ConfGen::CanonicalFragment::clear | ( | ) |
Removes all atoms and bonds and resets the hash code.
|
virtual |
Returns the number of atoms in the fragment.
Implements CDPL::Chem::AtomContainer.
|
virtual |
Returns a const reference to the atom at index idx.
| idx | The index of the atom. |
const reference to the atom. Implements CDPL::Chem::AtomContainer.
|
virtual |
Returns a reference to the atom at index idx.
| idx | The index of the atom. |
Implements CDPL::Chem::AtomContainer.
| ConstAtomIterator CDPL::ConfGen::CanonicalFragment::getAtomsBegin | ( | ) | const |
Returns a constant iterator pointing to the first atom.
| ConstAtomIterator CDPL::ConfGen::CanonicalFragment::getAtomsEnd | ( | ) | const |
Returns a constant iterator pointing one past the last atom.
| AtomIterator CDPL::ConfGen::CanonicalFragment::getAtomsBegin | ( | ) |
Returns a mutable iterator pointing to the first atom.
| AtomIterator CDPL::ConfGen::CanonicalFragment::getAtomsEnd | ( | ) |
Returns a mutable iterator pointing one past the last atom.
|
virtual |
Tells whether the fragment contains atom.
| atom | The atom to look up. |
true if the atom is part of the fragment, and false otherwise. Implements CDPL::Chem::AtomContainer.
|
virtual |
Returns the index of atom in the fragment.
| atom | The atom whose index is requested. |
Implements CDPL::Chem::AtomContainer.
|
virtual |
Returns the number of 3D entities in the fragment.
Reimplemented from CDPL::Chem::AtomContainer.
|
virtual |
Returns a const reference to the 3D entity at index idx.
| idx | The index of the entity. |
const reference to the entity. Reimplemented from CDPL::Chem::AtomContainer.
|
virtual |
Returns a reference to the 3D entity at index idx.
| idx | The index of the entity. |
Reimplemented from CDPL::Chem::AtomContainer.
|
virtual |
Returns the number of bonds in the fragment.
Implements CDPL::Chem::BondContainer.
|
virtual |
Returns a const reference to the bond at index idx.
| idx | The index of the bond. |
const reference to the bond. Implements CDPL::Chem::BondContainer.
|
virtual |
Returns a reference to the bond at index idx.
| idx | The index of the bond. |
Implements CDPL::Chem::BondContainer.
| ConstBondIterator CDPL::ConfGen::CanonicalFragment::getBondsBegin | ( | ) | const |
Returns a constant iterator pointing to the first bond.
| ConstBondIterator CDPL::ConfGen::CanonicalFragment::getBondsEnd | ( | ) | const |
Returns a constant iterator pointing one past the last bond.
| BondIterator CDPL::ConfGen::CanonicalFragment::getBondsBegin | ( | ) |
Returns a mutable iterator pointing to the first bond.
| BondIterator CDPL::ConfGen::CanonicalFragment::getBondsEnd | ( | ) |
Returns a mutable iterator pointing one past the last bond.
|
virtual |
Tells whether the fragment contains bond.
| bond | The bond to look up. |
true if the bond is part of the fragment, and false otherwise. Implements CDPL::Chem::BondContainer.
|
virtual |
Returns the index of bond in the fragment.
| bond | The bond whose index is requested. |
Implements CDPL::Chem::BondContainer.
|
virtual |
Reorders the atoms of the fragment according to func.
| func | The comparison function used to define the new atom order. |
Implements CDPL::Chem::AtomContainer.
|
virtual |
Reorders the bonds of the fragment according to func.
| func | The comparison function used to define the new bond order. |
Implements CDPL::Chem::BondContainer.
| std::uint64_t CDPL::ConfGen::CanonicalFragment::getHashCode | ( | ) | const |
Returns the hash code of the fragment.
|
virtual |
Creates and returns a deep copy of the fragment.
Implements CDPL::Chem::MolecularGraph.
| CanonicalFragment& CDPL::ConfGen::CanonicalFragment::operator= | ( | const CanonicalFragment & | frag | ) |
Replaces the contents of this fragment with a copy of frag.
| frag | The source CanonicalFragment. |
| void CDPL::ConfGen::CanonicalFragment::create | ( | const Chem::MolecularGraph & | molgraph, |
| const Chem::MolecularGraph & | parent, | ||
| bool | modify = true, |
||
| bool | strip_aro_subst = true |
||
| ) |
Builds the canonical fragment from the fragment molgraph of the parent molecular graph parent.
| molgraph | The molecular graph defining the fragment to canonicalize. |
| parent | The parent molecular graph the fragment was derived from. |
| modify | If true, the fragment is modified prior to canonicalization (e.g. ring perception, hydrogenization). |
| strip_aro_subst | If true, aromatic-ring substituents are stripped during fragment construction. |
| const AtomMapping& CDPL::ConfGen::CanonicalFragment::getAtomMapping | ( | ) | const |
Returns the atom mapping from this fragment to the parent molecular graph.
const reference to the atom mapping. | void CDPL::ConfGen::CanonicalFragment::perceiveSSSR | ( | ) |
Perceives the smallest set of smallest rings of the fragment.