RDKit: RDKit::QueryAtom Class Reference

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | List of all members
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 boost::shared_ptr< Atom > | ATOM_SPTR
typedef boost::shared_ptr< const Atom > | C_ATOM_SPTR
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 ()
Atom * | copy () const
| returns a copy of this query, owned by the caller More...
bool | hasQuery () const
void | setQuery (QUERYATOM_QUERY *what)
| replaces our current query with the value passed in More...
QUERYATOM_QUERY * | getQuery () const
| returns our current query More...
void | expandQuery (QUERYATOM_QUERY *what, Queries::CompositeQueryType how=Queries::COMPOSITE_AND, bool maintainOrder=true)
| expands our current query More...
bool | Match (const Atom::ATOM_SPTR &what) const
| returns true if we match Atom `what` More...
bool | Match (Atom const *what) const
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)
| construct an Atom with a particular symbol (looked up in the More...
| Atom (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...
ROMol & | getOwningMol () const
| returns a reference to the ROMol that owns this Atom 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 explict Hs More...
unsigned int | getNumExplicitHs () const
| returns our number of explict 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 (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
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...
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 ()
Protected Attributes inherited from RDKit::Atom
bool | df_isAromatic
bool | df_noImplicit
boost::uint8_t | d_numExplicitHs
boost::int8_t | d_formalCharge
boost::uint8_t | d_atomicNum
boost::int8_t | d_implicitValence
boost::int8_t | d_explicitValence
boost::uint8_t | d_numRadicalElectrons
boost::uint8_t | d_chiralTag
boost::uint8_t | d_hybrid
atomindex_t | d_index
boost::uint16_t | d_isotope
ROMol * | dp_mol
AtomMonomerInfo * | dp_monomerInfo
Protected Attributes inherited from RDKit::RDProps
Dict | dp_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 26 of file QueryAtom.h.

## Member Typedef Documentation

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

Definition at line 28 of file QueryAtom.h.

## Constructor & Destructor Documentation

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

Definition at line 30 of file QueryAtom.h.

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

Definition at line 31 of file QueryAtom.h.

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

Definition at line 32 of file QueryAtom.h.

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

Definition at line 34 of file QueryAtom.h.

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

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

Referenced by QueryAtom().

## Member Function Documentation

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

returns a copy of this query, owned by the caller

Reimplemented from RDKit::Atom.

Referenced by QueryAtom().

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

expands our current query

Parameters

  what | the Queries::Query to be added
  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.

Referenced by getQuery().

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

returns our current query

Reimplemented from RDKit::Atom.

Definition at line 51 of file QueryAtom.h.

References Queries::COMPOSITE_AND, expandQuery(), Match(), and QueryMatch().

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

Reimplemented from RDKit::Atom.

Definition at line 43 of file QueryAtom.h.

bool RDKit::QueryAtom::Match | ( | const Atom::ATOM_SPTR & | what | ) | const
| virtual

returns true if we match Atom `what`

Reimplemented from RDKit::Atom.

Referenced by getQuery().

bool RDKit::QueryAtom::Match | ( | Atom const * | 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 from RDKit::Atom.

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

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

Referenced by getQuery().

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

replaces our current query with the value passed in

Reimplemented from RDKit::Atom.

Definition at line 46 of file QueryAtom.h.

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

- QueryAtom.h