RDKit::QueryAtom Class Reference

Class for storing atomic queries. More...

`#include <QueryAtom.h>`

Inheritance diagram for RDKit::QueryAtom:

## Public Types

typedef Queries::Query< int, Atom const *, true > | QUERYATOM_QUERY
Public Types inherited from RDKit::Atom
enum | HybridizationType { UNSPECIFIED = 0 , S , SP , SP2 , SP3 , SP3D , SP3D2 , OTHER }
| store hybridization More...
enum | ChiralType { CHI_UNSPECIFIED = 0 , CHI_TETRAHEDRAL_CW , CHI_TETRAHEDRAL_CCW , CHI_OTHER }
| store type of chirality More...
typedef Queries::Query< int, Atom const *, true > | QUERYATOM_QUERY

## Public Member Functions

| QueryAtom ()
| QueryAtom (int num)
| QueryAtom (const Atom &other)
| QueryAtom (const QueryAtom &other)
QueryAtom & | operator= (const QueryAtom &other)
| ~QueryAtom () override
Atom * | copy () const override
| returns a copy of this query, owned by the caller More...
bool | hasQuery () const override
void | setQuery (QUERYATOM_QUERY *what) override
| replaces our current query with the value passed in More...
QUERYATOM_QUERY * | getQuery () const override
| returns our current query More...
void | expandQuery (QUERYATOM_QUERY *what, Queries::CompositeQueryType how=Queries::COMPOSITE_AND, bool maintainOrder=true) override
| expands our current query More...
bool | Match (Atom const *what) const override
| returns true if we match Atom `what` More...
bool | QueryMatch (QueryAtom const *what) const
| returns true if our query details match those of QueryAtom `what` More...
Public Member Functions inherited from RDKit::Atom
| Atom ()
| Atom (unsigned int num)
| construct an Atom with a particular atomic number More...
| Atom (const std::string &what)
| Atom (const Atom &other)
Atom & | operator= (const Atom &other)
virtual | ~Atom ()
int | getAtomicNum () const
| returns our atomic number More...
void | setAtomicNum (int newNum)
| sets our atomic number More...
std::string | getSymbol () const
| returns our symbol (determined by our atomic number) More...
bool | hasOwningMol () const
| returns whether or not this instance belongs to a molecule More...
ROMol & | getOwningMol () const
| returns a reference to the ROMol that owns this instance More...
unsigned int | getIdx () const
| returns our index within the ROMol More...
void | setIdx (unsigned int index)
| sets our index within the ROMol More...
template<class U >
void | setIdx (const U index)
| overload More...
unsigned int | getDegree () const
unsigned int | getTotalDegree () const
unsigned int | getTotalNumHs (bool includeNeighbors=false) const
| returns the total number of Hs (implicit and explicit) that this Atom is bound to More...
unsigned int | getTotalValence () const
| returns the total valence (implicit and explicit) for an atom More...
unsigned int | getNumImplicitHs () const
| returns the number of implicit Hs this Atom is bound to More...
int | getExplicitValence () const
| returns the explicit valence (including Hs) of this atom More...
int | getImplicitValence () const
| returns the implicit valence for this Atom More...
unsigned int | getNumRadicalElectrons () const
| returns the number of radical electrons for this Atom More...
void | setNumRadicalElectrons (unsigned int num)
int | getFormalCharge () const
| returns the formal charge of this atom More...
void | setFormalCharge (int what)
| set's the formal charge of this atom More...
void | setNoImplicit (bool what)
| sets our `noImplicit` flag, indicating whether or not we are allowed to have implicit Hs More...
bool | getNoImplicit () const
| returns the `noImplicit` flag More...
void | setNumExplicitHs (unsigned int what)
| sets our number of explicit Hs More...
unsigned int | getNumExplicitHs () const
| returns our number of explicit Hs More...
void | setIsAromatic (bool what)
| sets our `isAromatic` flag, indicating whether or not we are aromatic More...
bool | getIsAromatic () const
| returns our `isAromatic` flag More...
double | getMass () const
| returns our mass More...
void | setIsotope (unsigned int what)
| sets our isotope number More...
unsigned int | getIsotope () const
| returns our isotope number More...
void | setChiralTag (ChiralType what)
| sets our `chiralTag` More...
void | invertChirality ()
| inverts our `chiralTag` More...
ChiralType | getChiralTag () const
| returns our `chiralTag` More...
void | setHybridization (HybridizationType what)
| sets our hybridization More...
HybridizationType | getHybridization () const
| returns our hybridization More...
int | getPerturbationOrder (const INT_LIST &probe) const
| returns the perturbation order for a list of integers More...
void | updatePropertyCache (bool strict=true)
| calculates any of our lazy `properties` More...
bool | needsUpdatePropertyCache () const
int | calcExplicitValence (bool strict=true)
| calculates and returns our explicit valence More...
int | calcImplicitValence (bool strict=true)
| calculates and returns our implicit valence More...
AtomMonomerInfo * | getMonomerInfo ()
const AtomMonomerInfo * | getMonomerInfo () const
void | setMonomerInfo (AtomMonomerInfo *info)
| takes ownership of the pointer More...
void | setAtomMapNum (int mapno, bool strict=true)
| Set the atom map Number of the atom. More...
int | getAtomMapNum () const
Public Member Functions inherited from RDKit::RDProps
| RDProps ()
| RDProps (const RDProps &rhs)
RDProps & | operator= (const RDProps &rhs)
void | clear ()
const Dict & | getDict () const
| gets the underlying Dictionary More...
Dict & | getDict ()
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 >
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. More...
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. More...
void | clearProp (const std::string &key) const
| clears the value of a `property` More...
void | clearComputedProps () const
| clears all of our `computed` `properties` More...
void | updateProps (const RDProps &source, bool preserveExisting=false)
| update the properties from another More...

## Additional Inherited Members

Protected Member Functions inherited from RDKit::Atom
void | setOwningMol (ROMol *other)
| sets our owning molecule More...
void | setOwningMol (ROMol &other)
| sets our owning molecule More...
void | initAtom ()
void | initFromOther (const Atom &other)
Protected Attributes inherited from RDKit::Atom
bool | df_isAromatic
bool | df_noImplicit
std::uint8_t | d_numExplicitHs
std::int8_t | d_formalCharge
std::uint8_t | d_atomicNum
std::int8_t | d_implicitValence
std::int8_t | d_explicitValence
std::uint8_t | d_numRadicalElectrons
std::uint8_t | d_chiralTag
std::uint8_t | d_hybrid
std::uint16_t | d_isotope
atomindex_t | d_index
ROMol * | dp_mol
AtomMonomerInfo * | dp_monomerInfo
Protected Attributes inherited from RDKit::RDProps
Dict | d_props

## Detailed Description

Class for storing atomic queries.

QueryAtom objects are derived from Atom objects, so they can be added to molecules and the like, but they have much fancier querying capabilities.

Definition at line 27 of file QueryAtom.h.

## Member Typedef Documentation

## QUERYATOM_QUERY

typedef Queries::Query<int, Atom const *, true> RDKit::QueryAtom::QUERYATOM_QUERY

Definition at line 29 of file QueryAtom.h.

## Constructor & Destructor Documentation

## QueryAtom() [1/4]

RDKit::QueryAtom::QueryAtom | ( |  | ) |

inline

Definition at line 31 of file QueryAtom.h.

## QueryAtom() [2/4]

RDKit::QueryAtom::QueryAtom | ( | int | num | ) |

inline explicit

Definition at line 32 of file QueryAtom.h.

## QueryAtom() [3/4]

RDKit::QueryAtom::QueryAtom | ( | const Atom & | other | ) |

inline explicit

Definition at line 33 of file QueryAtom.h.

References Queries::COMPOSITE_AND, RDKit::Atom::getFormalCharge(), RDKit::Atom::getIsotope(), RDKit::Atom::getNumRadicalElectrons(), RDKit::makeAtomFormalChargeQuery(), RDKit::makeAtomIsotopeQuery(), and RDKit::makeAtomNumRadicalElectronsQuery().

## QueryAtom() [4/4]

RDKit::QueryAtom::QueryAtom | ( | const QueryAtom & | other | ) |

inline

Definition at line 49 of file QueryAtom.h.

References Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().

## ~QueryAtom()

RDKit::QueryAtom::~QueryAtom | ( |  | ) |

override

## Member Function Documentation

## copy()

Atom* RDKit::QueryAtom::copy | ( |  | ) | const

override virtual

returns a copy of this query, owned by the caller

Reimplemented from RDKit::Atom.

## expandQuery()

void RDKit::QueryAtom::expandQuery | ( | QUERYATOM_QUERY * | what,
|  | Queries::CompositeQueryType | how = `Queries::COMPOSITE_AND`,
|  | bool | maintainOrder = `true`
| ) |  |

override virtual

expands our current query

Parameters

  what | the Queries::Query to be added. The ownership of the query is passed to the current object, where it might be deleted, so that the pointer should not be used again in the calling code.
  how | the operator to be used in the expansion

  maintainOrder

  (optional) flags whether the relative order of the queries needs to be maintained, if this is false, the order is reversed Notes:
  - `what` should probably be constructed using one of the functions defined in QueryOps.h
  - the `maintainOrder` option can be useful because the combination operators short circuit when possible.

Reimplemented from RDKit::Atom.

## getQuery()

QUERYATOM_QUERY* RDKit::QueryAtom::getQuery | ( |  | ) | const

inline override virtual

returns our current query

Reimplemented from RDKit::Atom.

Definition at line 81 of file QueryAtom.h.

## hasQuery()

bool RDKit::QueryAtom::hasQuery | ( |  | ) | const

inline override virtual

Reimplemented from RDKit::Atom.

Definition at line 73 of file QueryAtom.h.

## Match()

bool RDKit::QueryAtom::Match | ( | Atom const * | what | ) | const

override virtual

returns true if we match Atom `what`

Reimplemented from RDKit::Atom.

## operator=()

QueryAtom& RDKit::QueryAtom::operator= | ( | const QueryAtom & | other | ) |

inline

Definition at line 56 of file QueryAtom.h.

References Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), and RDKit::Atom::operator=().

## QueryMatch()

bool RDKit::QueryAtom::QueryMatch | ( | QueryAtom const * | what | ) | const

returns true if our query details match those of QueryAtom `what`

## setQuery()

void RDKit::QueryAtom::setQuery | ( | QUERYATOM_QUERY * | what | ) |

inline override virtual

replaces our current query with the value passed in

Reimplemented from RDKit::Atom.

Definition at line 76 of file QueryAtom.h.

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

- QueryAtom.h