![]() |
RDKit
Open-source cheminformatics and machine learning.
|
class for representing a bond More...
#include <Bond.h>
Public Types | |
| enum | BondType { UNSPECIFIED = 0, SINGLE, DOUBLE, TRIPLE, QUADRUPLE, QUINTUPLE, HEXTUPLE, ONEANDAHALF, TWOANDAHALF, THREEANDAHALF, FOURANDAHALF, FIVEANDAHALF, AROMATIC, IONIC, HYDROGEN, THREECENTER, DATIVEONE, DATIVE, DATIVEL, DATIVER, OTHER, ZERO } |
| the type of Bond More... | |
| enum | BondDir { NONE = 0, BEGINWEDGE, BEGINDASH, ENDDOWNRIGHT, ENDUPRIGHT, EITHERDOUBLE, UNKNOWN } |
| the bond's direction (for chirality) More... | |
| enum | BondStereo { STEREONONE = 0, STEREOANY, STEREOZ, STEREOE } |
| the nature of the bond's stereochem (for cis/trans) More... | |
| typedef boost::shared_ptr< Bond > | BOND_SPTR |
| typedef Queries::Query< int, Bond const *, true > | QUERYBOND_QUERY |
Public Member Functions | |
| Bond () | |
| Bond (BondType bT) | |
| construct with a particular BondType More... | |
| Bond (const Bond &other) | |
| virtual | ~Bond () |
| Bond & | operator= (const Bond &other) |
| virtual Bond * | copy () const |
| returns a copy More... | |
| BondType | getBondType () const |
returns our bondType More... | |
| void | setBondType (BondType bT) |
sets our bondType More... | |
| double | getBondTypeAsDouble () const |
returns our bondType as a double (e.g. SINGLE->1.0, AROMATIC->1.5, etc.) More... | |
| double | getValenceContrib (const Atom *at) const |
| returns our contribution to the explicit valence of an Atom More... | |
| double | getValenceContrib (ATOM_SPTR at) const |
| void | setIsAromatic (bool what) |
sets our isAromatic flag More... | |
| bool | getIsAromatic () const |
returns the status of our isAromatic flag More... | |
| void | setIsConjugated (bool what) |
sets our isConjugated flag More... | |
| bool | getIsConjugated () const |
returns the status of our isConjugated flag More... | |
| ROMol & | getOwningMol () const |
| returns a reference to the ROMol that owns this Bond More... | |
| void | setOwningMol (ROMol *other) |
| sets our owning molecule More... | |
| void | setOwningMol (ROMol &other) |
| sets our owning molecule More... | |
| unsigned int | getIdx () const |
| returns our index within the ROMol More... | |
| void | setIdx (unsigned int index) |
| sets our index within the ROMol More... | |
| unsigned int | getBeginAtomIdx () const |
| returns the index of our begin Atom More... | |
| unsigned int | getEndAtomIdx () const |
| returns the index of our end Atom More... | |
| unsigned int | getOtherAtomIdx (unsigned int thisIdx) const |
| given the index of one Atom, returns the index of the other More... | |
| void | setBeginAtomIdx (unsigned int what) |
| sets the index of our begin Atom More... | |
| void | setEndAtomIdx (unsigned int what) |
| sets the index of our end Atom More... | |
| void | setBeginAtom (Atom *at) |
| sets our begin Atom More... | |
| void | setBeginAtom (ATOM_SPTR at) |
| void | setEndAtom (Atom *at) |
| sets our end Atom More... | |
| void | setEndAtom (ATOM_SPTR at) |
| Atom * | getBeginAtom () const |
| returns a pointer to our begin Atom More... | |
| Atom * | getEndAtom () const |
| returns a pointer to our end Atom More... | |
| Atom * | getOtherAtom (Atom const *what) const |
| returns a pointer to the other Atom More... | |
| virtual bool | hasQuery () const |
| virtual void | setQuery (QUERYBOND_QUERY *what) |
| NOT CALLABLE. More... | |
| virtual QUERYBOND_QUERY * | getQuery () const |
| NOT CALLABLE. More... | |
| virtual void | expandQuery (QUERYBOND_QUERY *what, Queries::CompositeQueryType how=Queries::COMPOSITE_AND, bool maintainOrder=true) |
| NOT CALLABLE. More... | |
| virtual bool | Match (Bond const *what) const |
| returns whether or not we match the argument More... | |
| virtual bool | Match (const Bond::BOND_SPTR what) const |
| void | setBondDir (BondDir what) |
| sets our direction More... | |
| BondDir | getBondDir () const |
| returns our direction More... | |
| void | setStereo (BondStereo what) |
| sets our stereo code More... | |
| BondStereo | getStereo () const |
| returns our stereo code More... | |
| const INT_VECT & | getStereoAtoms () const |
| returns the indices of our stereo atoms More... | |
| INT_VECT & | getStereoAtoms () |
| STR_VECT | getPropList () const |
returns a list with the names of our properties More... | |
| template<typename T > | |
| void | setProp (const char *key, T val, bool computed=false) const |
sets a property value More... | |
| template<typename T > | |
| void | setProp (const std::string &key, T val, bool computed=false) const |
| template<typename T > | |
| void | getProp (const char *key, T &res) const |
| allows retrieval of a particular property value More... | |
| template<typename T > | |
| void | getProp (const std::string &key, T &res) const |
| template<typename T > | |
| T | getProp (const char *key) const |
| template<typename T > | |
| T | getProp (const std::string &key) const |
| template<typename T > | |
| bool | getPropIfPresent (const char *key, T &res) const |
| template<typename T > | |
| bool | getPropIfPresent (const std::string &key, T &res) const |
| bool | hasProp (const char *key) const |
returns whether or not we have a property with name key More... | |
| bool | hasProp (const std::string &key) const |
| void | clearProp (const char *key) const |
clears the value of a property More... | |
| void | clearProp (const std::string &key) const |
| void | clearComputedProps () const |
clears all of our computed properties More... | |
| void | updatePropertyCache (bool strict=true) |
calculates any of our lazy properties More... | |
Protected Member Functions | |
| void | initBond () |
Protected Attributes | |
| bool | df_isAromatic |
| sets our owning molecule More... | |
| bool | df_isConjugated |
| boost::uint8_t | d_bondType |
| boost::uint8_t | d_dirTag |
| boost::uint8_t | d_stereo |
| atomindex_t | d_index |
| atomindex_t | d_beginAtomIdx |
| atomindex_t | d_endAtomIdx |
| ROMol * | dp_mol |
| Dict * | dp_props |
| INT_VECT * | dp_stereoAtoms |
Friends | |
| class | RWMol |
| class | ROMol |
class for representing a bond
Notes:
properties: property is keyed by name and can store an arbitrary type.Properties can be marked as calculated, in which case they will be cleared when the clearComputedProps() method is called.property operations are const, this allows extra flexibility for clients who need to store extra data on Bond objects. | typedef boost::shared_ptr<Bond> RDKit::Bond::BOND_SPTR |
| typedef Queries::Query<int, Bond const *, true> RDKit::Bond::QUERYBOND_QUERY |
| enum RDKit::Bond::BondDir |
the type of Bond
| RDKit::Bond::Bond | ( | ) |
|
explicit |
construct with a particular BondType
| RDKit::Bond::Bond | ( | const Bond & | other | ) |
|
virtual |
|
inline |
clears all of our computed properties
Definition at line 417 of file Bond.h.
References RDKit::Dict::clearVal(), detail::computedPropName, dp_props, getPropIfPresent(), and RDKit::Dict::setVal().
|
inline |
clears the value of a property
Notes:
property with name key exists, a KeyErrorException will be thrown.property is marked as computed, it will also be removed from our list of computedProperties
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 404 of file Bond.h.
References RDKit::Dict::clearVal(), detail::computedPropName, dp_props, getPropIfPresent(), and RDKit::Dict::setVal().
|
virtual |
returns a copy
Note: the caller is responsible for deleteing the returned pointer.
Reimplemented in RDKit::QueryBond.
|
virtual |
| Atom* RDKit::Bond::getBeginAtom | ( | ) | const |
returns a pointer to our begin Atom
Notes:
Referenced by RDKit::FMCS::RingMatchTableSet::computeRingMatchTable(), and getEndAtomIdx().
|
inline |
returns the index of our begin Atom
Notes:
Definition at line 172 of file Bond.h.
References d_beginAtomIdx.
Referenced by RDKit::FMCS::SubstructureCache::HashKey::computeKey().
|
inline |
returns our direction
Definition at line 271 of file Bond.h.
References d_dirTag.
Referenced by RDKit::queryBondDir().
|
inline |
returns our bondType
Definition at line 119 of file Bond.h.
References d_bondType.
Referenced by RDKit::queryBondOrder().
| double RDKit::Bond::getBondTypeAsDouble | ( | ) | const |
returns our bondType as a double (e.g. SINGLE->1.0, AROMATIC->1.5, etc.)
Referenced by setBondType().
| Atom* RDKit::Bond::getEndAtom | ( | ) | const |
returns a pointer to our end Atom
Notes:
Referenced by RDKit::FMCS::RingMatchTableSet::computeRingMatchTable(), and getEndAtomIdx().
|
inline |
returns the index of our end Atom
Notes:
Definition at line 179 of file Bond.h.
References d_endAtomIdx, getBeginAtom(), getEndAtom(), getOtherAtom(), getOtherAtomIdx(), setBeginAtom(), setBeginAtomIdx(), setEndAtom(), and setEndAtomIdx().
Referenced by RDKit::SLNParse::addBranchToMol(), and RDKit::FMCS::SubstructureCache::HashKey::computeKey().
|
inline |
returns our index within the ROMol
Notes:
Definition at line 158 of file Bond.h.
References d_index.
Referenced by RDKit::FMCS::TargetMatch::init(), RDKit::queryBondIsInRingOfSize(), RDKit::queryBondMinRingSize(), RDKit::queryIsBondInNRings(), and RDKit::queryIsBondInRing().
|
inline |
returns the status of our isAromatic flag
Definition at line 138 of file Bond.h.
References df_isAromatic.
|
inline |
returns the status of our isConjugated flag
Definition at line 143 of file Bond.h.
References df_isConjugated.
returns a pointer to the other Atom
Notes:
Referenced by getEndAtomIdx().
| unsigned int RDKit::Bond::getOtherAtomIdx | ( | unsigned int | thisIdx | ) | const |
given the index of one Atom, returns the index of the other
Notes:
Referenced by getEndAtomIdx().
|
inline |
returns a reference to the ROMol that owns this Bond
Definition at line 146 of file Bond.h.
References dp_mol, and setOwningMol().
Referenced by RDKit::queryBondIsInRingOfSize(), RDKit::queryBondMinRingSize(), RDKit::queryIsBondInNRings(), and RDKit::queryIsBondInRing().
|
inline |
allows retrieval of a particular property value
| key | the name under which the property should be stored. If a property is already stored under this name, it will be replaced. |
| res | a reference to the storage location for the value. |
Notes:
property with name key exists, a KeyErrorException will be thrown.boost::lexical_cast machinery is used to attempt type conversions. If this fails, a boost::bad_lexical_cast exception will be thrown. Definition at line 345 of file Bond.h.
References dp_props, RDKit::Dict::getVal(), and PRECONDITION.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 351 of file Bond.h.
References dp_props, RDKit::Dict::getVal(), and PRECONDITION.
|
inline |
Definition at line 358 of file Bond.h.
References dp_props, and RDKit::Dict::getVal().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 363 of file Bond.h.
References dp_props, and RDKit::Dict::getVal().
|
inline |
returns whether or not we have a property with name key and assigns the value if we do
Definition at line 371 of file Bond.h.
References dp_props, and RDKit::Dict::getValIfPresent().
Referenced by clearComputedProps(), clearProp(), and setProp().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 376 of file Bond.h.
References dp_props, and RDKit::Dict::getValIfPresent().
|
inline |
returns a list with the names of our properties
Definition at line 296 of file Bond.h.
References dp_props, and RDKit::Dict::keys().
|
virtual |
|
inline |
|
inline |
returns the indices of our stereo atoms
Definition at line 279 of file Bond.h.
References dp_stereoAtoms.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 286 of file Bond.h.
References dp_stereoAtoms.
| double RDKit::Bond::getValenceContrib | ( | const Atom * | at | ) | const |
returns our contribution to the explicit valence of an Atom
Notes:
Referenced by setBondType().
| double RDKit::Bond::getValenceContrib | ( | ATOM_SPTR | at | ) | const |
|
inline |
returns whether or not we have a property with name key
Definition at line 381 of file Bond.h.
References dp_props, and RDKit::Dict::hasVal().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 386 of file Bond.h.
References dp_props, and RDKit::Dict::hasVal().
|
inlinevirtual |
Reimplemented in RDKit::QueryBond.
Definition at line 243 of file Bond.h.
References Queries::COMPOSITE_AND, expandQuery(), getQuery(), Match(), and setQuery().
|
protected |
|
virtual |
returns whether or not we match the argument
Notes:
bondType Bond::UNSPECIFIED or both Bonds have the same bondType. Reimplemented in RDKit::QueryBond.
Referenced by hasQuery().
|
virtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Reimplemented in RDKit::QueryBond.
| void RDKit::Bond::setBeginAtom | ( | Atom * | at | ) |
| void RDKit::Bond::setBeginAtom | ( | ATOM_SPTR | at | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| void RDKit::Bond::setBeginAtomIdx | ( | unsigned int | what | ) |
|
inline |
|
inline |
sets our bondType
Definition at line 121 of file Bond.h.
References d_bondType, getBondTypeAsDouble(), and getValenceContrib().
| void RDKit::Bond::setEndAtom | ( | Atom * | at | ) |
| void RDKit::Bond::setEndAtom | ( | ATOM_SPTR | at | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| void RDKit::Bond::setEndAtomIdx | ( | unsigned int | what | ) |
sets the index of our end Atom
Notes:
Referenced by RDKit::SLNParse::addBranchToMol(), and getEndAtomIdx().
|
inline |
sets our index within the ROMol
Notes:
< this->getOwningMol()->getNumBonds() Definition at line 165 of file Bond.h.
References d_index.
|
inline |
|
inline |
| void RDKit::Bond::setOwningMol | ( | ROMol * | other | ) |
sets our owning molecule
Referenced by RDKit::SLNParse::addBranchToMol(), and getOwningMol().
|
inline |
sets our owning molecule
Definition at line 150 of file Bond.h.
References setOwningMol().
Referenced by setOwningMol().
|
inline |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 315 of file Bond.h.
References detail::computedPropName, dp_props, getPropIfPresent(), and RDKit::Dict::setVal().
|
virtual |
|
inline |
|
inline |
|
protected |
Definition at line 444 of file Bond.h.
Referenced by getBeginAtomIdx().
|
protected |
Definition at line 440 of file Bond.h.
Referenced by getBondType(), and setBondType().
|
protected |
Definition at line 441 of file Bond.h.
Referenced by getBondDir(), and setBondDir().
|
protected |
Definition at line 444 of file Bond.h.
Referenced by getEndAtomIdx().
|
protected |
|
protected |
Definition at line 442 of file Bond.h.
Referenced by getStereo(), and setStereo().
|
protected |
sets our owning molecule
sets our owning molecule
Definition at line 438 of file Bond.h.
Referenced by getIsAromatic(), and setIsAromatic().
|
protected |
Definition at line 439 of file Bond.h.
Referenced by getIsConjugated(), and setIsConjugated().
|
protected |
Definition at line 445 of file Bond.h.
Referenced by getOwningMol().
|
protected |
Definition at line 446 of file Bond.h.
Referenced by clearComputedProps(), clearProp(), getProp(), getPropIfPresent(), getPropList(), hasProp(), and setProp().
|
protected |
Definition at line 447 of file Bond.h.
Referenced by getStereoAtoms().