RDKit
Open-source cheminformatics and machine learning.
RDKit::Bond Class Reference

class for representing a bond More...

#include <Bond.h>

Inheritance diagram for RDKit::Bond:
RDKit::RDProps RDKit::QueryBond

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< BondBOND_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 ()
 
Bondoperator= (const Bond &other)
 
virtual Bondcopy () 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...
 
ROMolgetOwningMol () 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)
 
AtomgetBeginAtom () const
 returns a pointer to our begin Atom More...
 
AtomgetEndAtom () const
 returns a pointer to our end Atom More...
 
AtomgetOtherAtom (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_QUERYgetQuery () 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_VECTgetStereoAtoms () const
 returns the indices of our stereo atoms More...
 
INT_VECTgetStereoAtoms ()
 
void updatePropertyCache (bool strict=true)
 calculates any of our lazy properties More...
 
- Public Member Functions inherited from RDKit::RDProps
 RDProps ()
 
 RDProps (const RDProps &rhs)
 
RDPropsoperator= (const RDProps &rhs)
 
void clear ()
 
STR_VECT getPropList (bool includePrivate=true, bool includeComputed=true) const
 returns a list with the names of our properties More...
 
template<typename T >
void setProp (const std::string &key, T val, bool computed=false) const
 sets a property value More...
 
template<typename T >
void getProp (const std::string &key, T &res) const
 allows retrieval of a particular property value More...
 
template<typename T >
getProp (const std::string &key) const
 
template<typename T >
bool getPropIfPresent (const std::string &key, T &res) const
 
bool hasProp (const std::string &key) const
 
void clearProp (const std::string &key) const
 clears the value of a property More...
 
void clearComputedProps () const
 clears all of our computed 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
 
ROMoldp_mol
 
INT_VECTdp_stereoAtoms
 
- Protected Attributes inherited from RDKit::RDProps
Dict dp_props
 

Friends

class RWMol
 
class ROMol
 

Detailed Description

class for representing a bond

Notes:

  • many of the methods of Atom require that the Atom be associated with a molecule (an ROMol).
  • each Bond maintains a Dict of properties:
    • Each 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.
    • Because they have no impact upon chemistry, all property operations are const, this allows extra flexibility for clients who need to store extra data on Bond objects.

Definition at line 47 of file Bond.h.

Member Typedef Documentation

typedef boost::shared_ptr<Bond> RDKit::Bond::BOND_SPTR

Definition at line 52 of file Bond.h.

typedef Queries::Query<int, Bond const *, true> RDKit::Bond::QUERYBOND_QUERY

Definition at line 54 of file Bond.h.

Member Enumeration Documentation

the bond's direction (for chirality)

Enumerator
NONE 

no special style

BEGINWEDGE 

wedged: narrow at begin

BEGINDASH 

dashed: narrow at begin

ENDDOWNRIGHT 

for cis/trans

ENDUPRIGHT 

ditto

EITHERDOUBLE 

a "crossed" double bond

UNKNOWN 

intentionally unspecified stereochemistry

Definition at line 84 of file Bond.h.

the nature of the bond's stereochem (for cis/trans)

Enumerator
STEREONONE 
STEREOANY 
STEREOZ 
STEREOE 

Definition at line 96 of file Bond.h.

the type of Bond

Enumerator
UNSPECIFIED 
SINGLE 
DOUBLE 
TRIPLE 
QUADRUPLE 
QUINTUPLE 
HEXTUPLE 
ONEANDAHALF 
TWOANDAHALF 
THREEANDAHALF 
FOURANDAHALF 
FIVEANDAHALF 
AROMATIC 
IONIC 
HYDROGEN 
THREECENTER 
DATIVEONE 

one-electron dative (e.g. from a C in a Cp ring to a metal)

DATIVE 

standard two-electron dative

DATIVEL 

standard two-electron dative

DATIVER 

standard two-electron dative

OTHER 
ZERO 

Zero-order bond (from.

Definition at line 57 of file Bond.h.

Constructor & Destructor Documentation

RDKit::Bond::Bond ( )
RDKit::Bond::Bond ( BondType  bT)
explicit

construct with a particular BondType

RDKit::Bond::Bond ( const Bond other)
virtual RDKit::Bond::~Bond ( )
virtual

Member Function Documentation

virtual Bond* RDKit::Bond::copy ( ) const
virtual

returns a copy

Note: the caller is responsible for deleteing the returned pointer.

Reimplemented in RDKit::QueryBond.

virtual void RDKit::Bond::expandQuery ( QUERYBOND_QUERY what,
Queries::CompositeQueryType  how = Queries::COMPOSITE_AND,
bool  maintainOrder = true 
)
virtual

NOT CALLABLE.

Reimplemented in RDKit::QueryBond.

Referenced by hasQuery().

Atom* RDKit::Bond::getBeginAtom ( ) const

returns a pointer to our begin Atom

Notes:

  • requires an owning molecule

Referenced by RDKit::FMCS::RingMatchTableSet::computeRingMatchTable(), and getEndAtomIdx().

unsigned int RDKit::Bond::getBeginAtomIdx ( ) const
inline

returns the index of our begin Atom

Notes:

  • this makes no sense if we do not have an owning molecule

Definition at line 176 of file Bond.h.

References d_beginAtomIdx.

Referenced by RDKit::FMCS::SubstructureCache::HashKey::computeKey().

BondDir RDKit::Bond::getBondDir ( ) const
inline

returns our direction

Definition at line 275 of file Bond.h.

References d_dirTag.

Referenced by RDKit::queryBondDir().

BondType RDKit::Bond::getBondType ( ) const
inline

returns our bondType

Definition at line 120 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:

  • requires an owning molecule

Referenced by RDKit::FMCS::RingMatchTableSet::computeRingMatchTable(), and getEndAtomIdx().

unsigned int RDKit::Bond::getEndAtomIdx ( ) const
inline

returns the index of our end Atom

Notes:

  • this makes no sense if we do not have an owning molecule

Definition at line 183 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().

unsigned int RDKit::Bond::getIdx ( ) const
inline

returns our index within the ROMol

Notes:

  • this makes no sense if we do not have an owning molecule

Definition at line 162 of file Bond.h.

References d_index.

Referenced by RDKit::FMCS::TargetMatch::init(), RDKit::queryBondIsInRingOfSize(), RDKit::queryBondMinRingSize(), RDKit::queryIsBondInNRings(), and RDKit::queryIsBondInRing().

bool RDKit::Bond::getIsAromatic ( ) const
inline

returns the status of our isAromatic flag

Definition at line 139 of file Bond.h.

References df_isAromatic.

bool RDKit::Bond::getIsConjugated ( ) const
inline

returns the status of our isConjugated flag

Definition at line 144 of file Bond.h.

References df_isConjugated.

Atom* RDKit::Bond::getOtherAtom ( Atom const *  what) const

returns a pointer to the other Atom

Notes:

  • requires an owning molecule

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:

  • this makes no sense if we do not have an owning molecule

Referenced by getEndAtomIdx().

ROMol& RDKit::Bond::getOwningMol ( ) const
inline

returns a reference to the ROMol that owns this Bond

Definition at line 147 of file Bond.h.

References dp_mol, PRECONDITION, and setOwningMol().

Referenced by RDKit::queryBondIsInRingOfSize(), RDKit::queryBondMinRingSize(), RDKit::queryIsBondInNRings(), and RDKit::queryIsBondInRing().

virtual QUERYBOND_QUERY* RDKit::Bond::getQuery ( ) const
virtual

NOT CALLABLE.

Reimplemented in RDKit::QueryBond.

Referenced by hasQuery().

BondStereo RDKit::Bond::getStereo ( ) const
inline

returns our stereo code

Definition at line 280 of file Bond.h.

References d_stereo.

Referenced by RDKit::queryBondHasStereo().

const INT_VECT& RDKit::Bond::getStereoAtoms ( ) const
inline

returns the indices of our stereo atoms

Definition at line 283 of file Bond.h.

References dp_stereoAtoms.

INT_VECT& RDKit::Bond::getStereoAtoms ( )
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 290 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:

  • requires an owning molecule

Referenced by setBondType().

double RDKit::Bond::getValenceContrib ( ATOM_SPTR  at) const
virtual bool RDKit::Bond::hasQuery ( ) const
inlinevirtual

Reimplemented in RDKit::QueryBond.

Definition at line 247 of file Bond.h.

References Queries::COMPOSITE_AND, expandQuery(), getQuery(), Match(), and setQuery().

void RDKit::Bond::initBond ( )
protected
virtual bool RDKit::Bond::Match ( Bond const *  what) const
virtual

returns whether or not we match the argument

Notes:

  • for Bond objects, "match" means that either one of the Bonds has bondType Bond::UNSPECIFIED or both Bonds have the same bondType.

Reimplemented in RDKit::QueryBond.

Referenced by hasQuery().

virtual bool RDKit::Bond::Match ( const Bond::BOND_SPTR  what) const
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.

Bond& RDKit::Bond::operator= ( const Bond other)
void RDKit::Bond::setBeginAtom ( Atom at)

sets our begin Atom

Notes:

  • requires an owning molecule

Referenced by getEndAtomIdx().

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)

sets the index of our begin Atom

Notes:

  • requires an owning molecule

Referenced by getEndAtomIdx().

void RDKit::Bond::setBondDir ( BondDir  what)
inline

sets our direction

Definition at line 273 of file Bond.h.

References d_dirTag.

void RDKit::Bond::setBondType ( BondType  bT)
inline

sets our bondType

Definition at line 122 of file Bond.h.

References d_bondType, getBondTypeAsDouble(), and getValenceContrib().

void RDKit::Bond::setEndAtom ( Atom at)

sets our end Atom

Notes:

  • requires an owning molecule

Referenced by getEndAtomIdx().

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:

  • requires an owning molecule

Referenced by RDKit::SLNParse::addBranchToMol(), and getEndAtomIdx().

void RDKit::Bond::setIdx ( unsigned int  index)
inline

sets our index within the ROMol

Notes:

  • this makes no sense if we do not have an owning molecule
  • the index should be < this->getOwningMol()->getNumBonds()

Definition at line 169 of file Bond.h.

References d_index.

void RDKit::Bond::setIsAromatic ( bool  what)
inline

sets our isAromatic flag

Definition at line 137 of file Bond.h.

References df_isAromatic.

void RDKit::Bond::setIsConjugated ( bool  what)
inline

sets our isConjugated flag

Definition at line 142 of file Bond.h.

References df_isConjugated.

void RDKit::Bond::setOwningMol ( ROMol other)

sets our owning molecule

Referenced by RDKit::SLNParse::addBranchToMol(), and getOwningMol().

void RDKit::Bond::setOwningMol ( ROMol other)
inline

sets our owning molecule

Definition at line 154 of file Bond.h.

References setOwningMol().

Referenced by setOwningMol().

virtual void RDKit::Bond::setQuery ( QUERYBOND_QUERY what)
virtual

NOT CALLABLE.

Reimplemented in RDKit::QueryBond.

Referenced by hasQuery().

void RDKit::Bond::setStereo ( BondStereo  what)
inline

sets our stereo code

Definition at line 278 of file Bond.h.

References d_stereo.

void RDKit::Bond::updatePropertyCache ( bool  strict = true)
inline

calculates any of our lazy properties

Notes:

  • requires an owning molecule

Definition at line 300 of file Bond.h.

Friends And Related Function Documentation

friend class ROMol
friend

Definition at line 49 of file Bond.h.

friend class RWMol
friend

Definition at line 48 of file Bond.h.

Member Data Documentation

atomindex_t RDKit::Bond::d_beginAtomIdx
protected

Definition at line 313 of file Bond.h.

Referenced by getBeginAtomIdx().

boost::uint8_t RDKit::Bond::d_bondType
protected

Definition at line 309 of file Bond.h.

Referenced by getBondType(), and setBondType().

boost::uint8_t RDKit::Bond::d_dirTag
protected

Definition at line 310 of file Bond.h.

Referenced by getBondDir(), and setBondDir().

atomindex_t RDKit::Bond::d_endAtomIdx
protected

Definition at line 313 of file Bond.h.

Referenced by getEndAtomIdx().

atomindex_t RDKit::Bond::d_index
protected

Definition at line 312 of file Bond.h.

Referenced by getIdx(), and setIdx().

boost::uint8_t RDKit::Bond::d_stereo
protected

Definition at line 311 of file Bond.h.

Referenced by getStereo(), and setStereo().

bool RDKit::Bond::df_isAromatic
protected

sets our owning molecule

sets our owning molecule

Definition at line 307 of file Bond.h.

Referenced by getIsAromatic(), and setIsAromatic().

bool RDKit::Bond::df_isConjugated
protected

Definition at line 308 of file Bond.h.

Referenced by getIsConjugated(), and setIsConjugated().

ROMol* RDKit::Bond::dp_mol
protected

Definition at line 314 of file Bond.h.

Referenced by getOwningMol().

INT_VECT* RDKit::Bond::dp_stereoAtoms
protected

Definition at line 315 of file Bond.h.

Referenced by getStereoAtoms().


The documentation for this class was generated from the following file: