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 , STEREOCIS , STEREOTRANS , STEREOATROPCW , STEREOATROPCCW } |
the nature of the bond's stereochem (for cis/trans) More... | |
typedef Queries::Query< int, Bond const *, true > | QUERYBOND_QUERY |
Public Member Functions | |
Bond () | |
Bond (BondType bT) | |
construct with a particular BondType | |
Bond (const Bond &other) | |
virtual | ~Bond () |
Bond & | operator= (const Bond &other) |
Bond (Bond &&o) noexcept | |
Bond & | operator= (Bond &&o) noexcept |
virtual Bond * | copy () const |
returns a copy | |
BondType | getBondType () const |
returns our bondType | |
void | setBondType (BondType bT) |
sets our bondType | |
double | getBondTypeAsDouble () const |
returns our bondType as a double (e.g. SINGLE->1.0, AROMATIC->1.5, etc.) | |
virtual double | getValenceContrib (const Atom *at) const |
returns our contribution to the explicit valence of an Atom | |
void | setIsAromatic (bool what) |
sets our isAromatic flag | |
bool | getIsAromatic () const |
returns the status of our isAromatic flag | |
void | setIsConjugated (bool what) |
sets our isConjugated flag | |
bool | getIsConjugated () const |
returns the status of our isConjugated flag | |
bool | hasOwningMol () const |
returns whether or not this instance belongs to a molecule | |
ROMol & | getOwningMol () const |
returns a reference to the ROMol that owns this instance | |
void | setOwningMol (ROMol *other) |
sets our owning molecule | |
void | setOwningMol (ROMol &other) |
sets our owning molecule | |
bool | invertChirality () |
unsigned int | getIdx () const |
returns our index within the ROMol | |
void | setIdx (unsigned int index) |
sets our index within the ROMol | |
unsigned int | getBeginAtomIdx () const |
returns the index of our begin Atom | |
unsigned int | getEndAtomIdx () const |
returns the index of our end Atom | |
unsigned int | getOtherAtomIdx (unsigned int thisIdx) const |
given the index of one Atom, returns the index of the other | |
void | setBeginAtomIdx (unsigned int what) |
sets the index of our begin Atom | |
void | setEndAtomIdx (unsigned int what) |
sets the index of our end Atom | |
void | setBeginAtom (Atom *at) |
sets our begin Atom | |
void | setEndAtom (Atom *at) |
sets our end Atom | |
Atom * | getBeginAtom () const |
returns a pointer to our begin Atom | |
Atom * | getEndAtom () const |
returns a pointer to our end Atom | |
Atom * | getOtherAtom (Atom const *what) const |
returns a pointer to the other Atom | |
virtual bool | hasQuery () const |
virtual void | setQuery (QUERYBOND_QUERY *what) |
NOT CALLABLE. | |
virtual QUERYBOND_QUERY * | getQuery () const |
NOT CALLABLE. | |
virtual void | expandQuery (QUERYBOND_QUERY *what, Queries::CompositeQueryType how=Queries::COMPOSITE_AND, bool maintainOrder=true) |
NOT CALLABLE. | |
virtual bool | Match (Bond const *what) const |
returns whether or not we match the argument | |
void | setBondDir (BondDir what) |
sets our direction | |
BondDir | getBondDir () const |
returns our direction | |
void | setStereo (BondStereo what) |
sets our stereo code | |
BondStereo | getStereo () const |
returns our stereo code | |
void | setStereoAtoms (unsigned int bgnIdx, unsigned int endIdx) |
sets the atoms to be considered as reference points for bond stereo | |
const INT_VECT & | getStereoAtoms () const |
returns the indices of our stereo atoms | |
INT_VECT & | getStereoAtoms () |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | updatePropertyCache (bool strict=true) |
calculates any of our lazy properties | |
Public Member Functions inherited from RDKit::RDProps | |
RDProps () | |
RDProps (const RDProps &rhs) | |
RDProps & | operator= (const RDProps &rhs) |
RDProps (RDProps &&o) noexcept=default | |
RDProps & | operator= (RDProps &&rhs) noexcept=default |
void | clear () |
const Dict & | getDict () const |
gets the underlying Dictionary | |
Dict & | getDict () |
STR_VECT | getPropList (bool includePrivate=true, bool includeComputed=true) const |
returns a list with the names of our properties | |
template<typename T > | |
void | setProp (const std::string &key, T val, bool computed=false) const |
sets a property value | |
template<typename T > | |
void | getProp (const std::string &key, T &res) const |
allows retrieval of a particular property value | |
template<typename T > | |
T | getProp (const std::string &key) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename T > | |
bool | getPropIfPresent (const std::string &key, T &res) const |
bool | hasProp (const std::string &key) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | clearProp (const std::string &key) const |
clears the value of a property | |
void | clearComputedProps () const |
clears all of our computed properties | |
void | updateProps (const RDProps &source, bool preserveExisting=false) |
update the properties from another | |
Protected Member Functions | |
void | initBond () |
Protected Attributes | |
ROMol * | dp_mol |
INT_VECT * | dp_stereoAtoms |
atomindex_t | d_index |
atomindex_t | d_beginAtomIdx |
atomindex_t | d_endAtomIdx |
bool | df_isAromatic |
bool | df_isConjugated |
std::uint8_t | d_bondType |
std::uint8_t | d_dirTag |
std::uint8_t | d_stereo |
Protected Attributes inherited from RDKit::RDProps | |
Dict | d_props |
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. the type of Bond
RDKit::Bond::Bond | ( | ) |
|
explicit |
construct with a particular BondType
|
virtual |
returns a copy
Note: the caller is responsible for delete
ing the returned pointer.
Reimplemented in RDKit::QueryBond.
|
virtual |
NOT CALLABLE.
Reimplemented in RDKit::QueryBond.
Atom * RDKit::Bond::getBeginAtom | ( | ) | const |
|
inline |
|
inline |
returns our bondType
Definition at line 158 of file Bond.h.
Referenced by RDKit::canHaveDirection(), RDKit::canSetDoubleBondStereo(), RDKit::isDative(), RDKit::queryBondIsDoubleOrAromatic(), RDKit::queryBondIsSingleOrAromatic(), RDKit::queryBondIsSingleOrDouble(), RDKit::queryBondIsSingleOrDoubleOrAromatic(), and RDKit::queryBondOrder().
double RDKit::Bond::getBondTypeAsDouble | ( | ) | const |
returns our bondType
as a double (e.g. SINGLE->1.0, AROMATIC->1.5, etc.)
Atom * RDKit::Bond::getEndAtom | ( | ) | const |
returns our index within the ROMol
Notes:
Definition at line 204 of file Bond.h.
Referenced by RDKit::queryBondIsInRingOfSize(), RDKit::queryBondMinRingSize(), RDKit::queryIsBondInNRings(), and RDKit::queryIsBondInRing().
|
inline |
|
inline |
given the index of one Atom, returns the index of the other
Notes:
|
inline |
returns a reference to the ROMol that owns this instance
Definition at line 186 of file Bond.h.
References PRECONDITION.
Referenced by RDKit::queryBondIsInRingOfSize(), RDKit::queryBondMinRingSize(), RDKit::queryIsBondInNRings(), and RDKit::queryIsBondInRing().
|
virtual |
NOT CALLABLE.
Reimplemented in RDKit::QueryBond.
Referenced by RDKit::describeQuery(), RDKit::QueryOps::hasBondTypeQuery(), and RDKit::QueryOps::hasComplexBondTypeQuery().
|
inline |
|
inline |
returns our contribution to the explicit valence of an Atom
Notes:
Reimplemented in RDKit::QueryBond.
|
inline |
Reimplemented in RDKit::QueryBond.
Definition at line 285 of file Bond.h.
Referenced by RDKit::describeQuery(), RDKit::QueryOps::hasBondTypeQuery(), and RDKit::QueryOps::hasComplexBondTypeQuery().
|
protected |
bool RDKit::Bond::invertChirality | ( | ) |
returns whether or not we match the argument
Notes:
bondType
Bond::UNSPECIFIED or both Bonds have the same bondType
. Reimplemented in RDKit::QueryBond.
sets our index within the ROMol
Notes:
< this->getOwningMol()->getNumBonds()
sets our owning molecule
Definition at line 193 of file Bond.h.
References setOwningMol().
Referenced by setOwningMol().
|
virtual |
NOT CALLABLE.
Reimplemented in RDKit::QueryBond.
|
inline |
sets our stereo code
STEREONONE, STEREOANY, STEREOE and STEREOZ can be set without neighboring atoms specified in getStereoAtoms since they are defined by the topology of the molecular graph. In order to set STEREOCIS or STEREOTRANS the neighboring atoms must be set first (using setStereoBonds()) to know what atoms are being considered.
Notes:
Definition at line 325 of file Bond.h.
References PRECONDITION.
sets the atoms to be considered as reference points for bond stereo
These do not necessarily need to be the highest 'ranking' atoms like CIP stereo requires. They can be any arbitrary atoms neighboring the begin and end atoms of this bond respectively. STEREOCIS or STEREOTRANS is then set relative to only these atoms.
If CIP rankings are desired, use MolOps::findPotentialStereoBonds, but this is a more costly function as it takes the whole molecule topology into account.
|
protected |
|
protected |
|
protected |
|
protected |
sets our owning molecule void setOwningMol(ROMol *other); sets our owning molecule void setOwningMol(ROMol &other) { setOwningMol(&other); }