Atom.h
Go to the documentation of this file.
//
// Copyright (C) 2001-2014 Greg Landrum and Rational Discovery LLC
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
/*! \file Atom.h
\brief Defines the Atom class and associated typedefs
*/
#ifndef _RD_ATOM_H
#define _RD_ATOM_H
// Std stuff
#include <iostream>
#include <boost/foreach.hpp>
// ours
#include <Query/QueryObjects.h>
#include <RDGeneral/types.h>
#include <RDGeneral/Dict.h>
#include <GraphMol/details.h>
namespace RDKit{
class ROMol;
class RWMol;
class AtomMonomerInfo;
//! The class for representing atoms
/*!
<b>Notes:</b>
- many of the methods of Atom require that the Atom be associated
with a molecule (an ROMol).
- each Atom maintains a Dict of \c properties:
- Each \c property is keyed by name and can store an
arbitrary type.
- \c Properties can be marked as \c calculated, in which case
they will be cleared when the \c clearComputedProps() method
is called.
- Because they have no impact upon chemistry, all \c property
operations are \c const, this allows extra flexibility for
clients who need to store extra data on Atom objects.
- Atom objects are lazy about computing their explicit and implicit valence
values. These will not be computed until their values are requested.
<b>Chirality:</b>
The chirality of an Atom is determined by two things:
- its \c chiralTag
- the input order of its bonds (see note below for handling of
implicit Hs)
For tetrahedral coordination, the \c chiralTag tells you what
direction you have to rotate to get from bond 2 to bond 3 while looking
down bond 1. This is pretty much identical to the SMILES representation of
chirality.
NOTE: if an atom has an implicit H, the bond to that H is considered to be
at the *end* of the list of other bonds.
*/
class Atom {
friend class MolPickler; //!< the pickler needs access to our privates
friend class ROMol;
friend class RWMol;
public:
typedef boost::shared_ptr<Atom> ATOM_SPTR;
typedef boost::shared_ptr<const Atom> C_ATOM_SPTR;
// FIX: grn...
typedef Queries::Query<int,Atom const *,true> QUERYATOM_QUERY;
//! store hybridization
typedef enum {
UNSPECIFIED=0, //!< hybridization that hasn't been specified
S,
SP,
SP2,
SP3,
SP3D,
SP3D2,
OTHER //!< unrecognized hybridization
} HybridizationType;
//! store type of chirality
typedef enum {
CHI_UNSPECIFIED=0, //!< chirality that hasn't been specified
CHI_TETRAHEDRAL_CW, //!< tetrahedral: clockwise rotation (SMILES \@\@)
CHI_TETRAHEDRAL_CCW,//!< tetrahedral: counter-clockwise rotation (SMILES \@)
CHI_OTHER //!< some unrecognized type of chirality
} ChiralType;
Atom();
//! construct an Atom with a particular atomic number
explicit Atom(unsigned int num);
//! construct an Atom with a particular symbol (looked up in the PeriodicTable)
explicit Atom(std::string what);
Atom(const Atom & other);
virtual ~Atom();
//! makes a copy of this Atom and returns a pointer to it.
/*!
<b>Note:</b> the caller is responsible for <tt>delete</tt>ing the result
*/
virtual Atom *copy() const;
//! returns our atomic number
int getAtomicNum() const { return d_atomicNum; };
//! sets our atomic number
void setAtomicNum(int newNum) { d_atomicNum = newNum; };
//! returns our symbol (determined by our atomic number)
std::string getSymbol() const;
//! returns a reference to the ROMol that owns this Atom
ROMol &getOwningMol() const { return *dp_mol; };
//! returns our index within the ROMol
unsigned int getIdx() const {return d_index;};
//! sets our index within the ROMol
/*!
<b>Notes:</b>
- this makes no sense if we do not have an owning molecule
- the index should be <tt>< this->getOwningMol()->getNumAtoms()</tt>
*/
void setIdx(unsigned int index) {d_index=index;};
//! returns the explicit degree of the Atom (number of bonded
//! neighbors in the graph)
/*!
<b>Notes:</b>
- requires an owning molecule
*/
unsigned int getDegree() const;
//! returns the total degree of the Atom (number of bonded
//! neighbors + number of Hs)
/*!
<b>Notes:</b>
- requires an owning molecule
*/
unsigned int getTotalDegree() const;
//! \brief returns the total number of Hs (implicit and explicit) that
//! this Atom is bound to
/*!
<b>Notes:</b>
- requires an owning molecule
*/
unsigned int getTotalNumHs(bool includeNeighbors=false) const;
//! \brief returns the total valence (implicit and explicit)
//! for an atom
/*!
<b>Notes:</b>
- requires an owning molecule
*/
unsigned int getTotalValence() const;
//! returns the number of implicit Hs this Atom is bound to
/*!
<b>Notes:</b>
- requires an owning molecule
*/
unsigned int getNumImplicitHs() const;
//! returns the explicit valence (including Hs) of this atom
int getExplicitValence() const;
//! returns the implicit valence for this Atom
/*!
<b>Notes:</b>
- requires an owning molecule
*/
int getImplicitValence() const;
//! returns the number of radical electrons for this Atom
/*!
<b>Notes:</b>
- requires an owning molecule
*/
unsigned int getNumRadicalElectrons() const { return d_numRadicalElectrons; };
void setNumRadicalElectrons(unsigned int num) { d_numRadicalElectrons=num; };
//! returns the formal charge of this atom
int getFormalCharge() const { return d_formalCharge; };
//! set's the formal charge of this atom
void setFormalCharge(int what) { d_formalCharge = what;} ;
//! \brief sets our \c noImplicit flag, indicating whether or not
//! we are allowed to have implicit Hs
void setNoImplicit( bool what ) { df_noImplicit = what; };
//! returns the \c noImplicit flag
bool getNoImplicit() const { return df_noImplicit; };
//! sets our number of explict Hs
void setNumExplicitHs(unsigned int what) { d_numExplicitHs = what; };
//! returns our number of explict Hs
unsigned int getNumExplicitHs() const { return d_numExplicitHs; };
//! sets our \c isAromatic flag, indicating whether or not we are aromatic
void setIsAromatic( bool what ) { df_isAromatic = what; };
//! returns our \c isAromatic flag
bool getIsAromatic() const { return df_isAromatic; };
//! returns our mass
double getMass() const;
//! sets our isotope number
void setIsotope(unsigned int what);
//! returns our isotope number
unsigned int getIsotope() const {return d_isotope; };
//! sets our \c chiralTag
void setChiralTag(ChiralType what) { d_chiralTag = what; };
//! inverts our \c chiralTag
void invertChirality();
//! returns our \c chiralTag
ChiralType getChiralTag() const { return static_cast<ChiralType>(d_chiralTag); };
//! sets our hybridization
void setHybridization(HybridizationType what) { d_hybrid = what; };
//! returns our hybridization
HybridizationType getHybridization() const { return static_cast<HybridizationType>(d_hybrid); };
// ------------------------------------
// Some words of explanation before getting down into
// the query stuff.
// These query functions are really only here so that they
// can have real functionality in subclasses (like QueryAtoms).
// Since pretty much it's gonna be a mistake to call any of these
// (ever), we're saddling them all with a precondition which
// is guaranteed to fail. I'd like to have them be pure virtual,
// but that doesn't work since we need to be able to instantiate
// Atoms.
// ------------------------------------
// This method can be used to distinguish query atoms from standard atoms:
virtual bool hasQuery() const { return false; };
//! NOT CALLABLE
virtual void setQuery(QUERYATOM_QUERY *what);
//! NOT CALLABLE
virtual QUERYATOM_QUERY *getQuery() const;
//! NOT CALLABLE
virtual void expandQuery(QUERYATOM_QUERY *what,
Queries::CompositeQueryType how=Queries::COMPOSITE_AND,
bool maintainOrder=true);
//! returns whether or not we match the argument
/*!
<b>Notes:</b>
The general rule is that if a property on this atom has a non-default value,
the property on the other atom must have the same value.
The exception to this is H counts, which are ignored. These turns out to be
impossible to handle generally, so rather than having odd and hard-to-explain
exceptions, we ignore them entirely.
Here are the rules for atom-atom matching:
| This | Other | Match | Reason
| CCO | CCO | Yes |
| CCO | CC[O-] | Yes |
| CC[O-] | CCO | No | Charge
| CC[O-] | CC[O-] | Yes |
| CC[OH] | CC[O-] | Yes |
| CC[OH] | CCOC | Yes |
| CCO | CCOC | Yes |
| CCC | CCC | Yes |
| CCC | CC[14C] | Yes |
| CC[14C] | CCC | No | Isotope
| CC[14C] | CC[14C] | Yes |
| C | OCO | Yes |
| [CH] | OCO | Yes |
| [CH2] | OCO | Yes |
| [CH3] | OCO | No | Radical
| C | O[CH2]O | Yes |
| [CH2] | O[CH2]O | Yes |
*/
virtual bool Match(Atom const *what) const;
//! \overload
virtual inline bool Match(const ATOM_SPTR &what) const {
return Match(what.get());
};
// ------------------------------------
// Local Property Dict functionality
// all setProp functions are const because they
// are not meant to change the atom chemically
// ------------------------------------
//! returns a list with the names of our \c properties
STR_VECT getPropList() const {
return dp_props->keys();
}
//! sets a \c property value
/*!
\param key the name under which the \c property should be stored.
If a \c property is already stored under this name, it will be
replaced.
\param val the value to be stored
\param computed (optional) allows the \c property to be flagged
\c computed.
*/
template <typename T>
void setProp(const char *key, T val, bool computed=false) const{
//if(!dp_props) dp_props = new Dict();
std::string what(key);
setProp(what,val, computed);
}
//! \overload
template <typename T>
void setProp(const std::string &key, T val, bool computed=false) const {
if (computed) {
STR_VECT compLst;
getPropIfPresent(detail::computedPropName, compLst);
if (std::find(compLst.begin(), compLst.end(), key) == compLst.end()) {
compLst.push_back(key);
dp_props->setVal(detail::computedPropName, compLst);
}
}
//setProp(key.c_str(),val);
dp_props->setVal(key, val);
}
//! allows retrieval of a particular property value
/*!
\param key the name under which the \c property should be stored.
If a \c property is already stored under this name, it will be
replaced.
\param res a reference to the storage location for the value.
<b>Notes:</b>
- if no \c property with name \c key exists, a KeyErrorException will be thrown.
- the \c boost::lexical_cast machinery is used to attempt type conversions.
If this fails, a \c boost::bad_lexical_cast exception will be thrown.
*/
template <typename T>
void getProp(const char *key,T &res) const {
dp_props->getVal(key,res);
}
//! \overload
template <typename T>
void getProp(const std::string &key,T &res) const {
dp_props->getVal(key,res);
}
//! \overload
template <typename T>
T getProp(const char *key) const {
return dp_props->getVal<T>(key);
}
//! \overload
template <typename T>
T getProp(const std::string &key) const {
return dp_props->getVal<T>(key);
}
//! returns whether or not we have a \c property with name \c key
//! and assigns the value if we do
template <typename T>
bool getPropIfPresent(const char *key,T &res) const {
return dp_props->getValIfPresent(key,res);
}
//! \overload
template <typename T>
bool getPropIfPresent(const std::string &key,T &res) const {
return dp_props->getValIfPresent(key,res);
}
//! returns whether or not we have a \c property with name \c key
bool hasProp(const char *key) const {
if(!dp_props) return false;
return dp_props->hasVal(key);
};
//! \overload
bool hasProp(const std::string &key) const {
if(!dp_props) return false;
return dp_props->hasVal(key);
};
//! clears the value of a \c property
/*!
<b>Notes:</b>
- if no \c property with name \c key exists, a KeyErrorException
will be thrown.
- if the \c property is marked as \c computed, it will also be removed
from our list of \c computedProperties
*/
void clearProp(const char *key) const {
std::string what(key);
clearProp(what);
};
//! \overload
void clearProp(const std::string &key) const {
STR_VECT compLst;
if(getPropIfPresent(detail::computedPropName, compLst)) {
STR_VECT_I svi = std::find(compLst.begin(), compLst.end(), key);
if (svi != compLst.end()) {
compLst.erase(svi);
dp_props->setVal(detail::computedPropName, compLst);
}
}
dp_props->clearVal(key);
};
//! clears all of our \c computed \c properties
void clearComputedProps() const {
STR_VECT compLst;
if (getPropIfPresent(detail::computedPropName, compLst))
{
BOOST_FOREACH(const std::string &sv,compLst){
dp_props->clearVal(sv);
}
compLst.clear();
dp_props->setVal(detail::computedPropName, compLst);
}
}
//! returns the perturbation order for a list of integers
/*!
This value is associated with chirality.
\param probe a list of bond indices. This must be the same
length as our number of incoming bonds (our degree).
\return the number of swaps required to convert the ordering
of the probe list to match the order of our incoming bonds:
e.g. if our incoming bond order is: <tt>[0,1,2,3]</tt>
\verbatim
getPerturbationOrder([1,0,2,3]) = 1
getPerturbationOrder([1,2,3,0]) = 3
getPerturbationOrder([1,2,0,3]) = 2
\endverbatim
See the class documentation for a more detailed description
of our representation of chirality.
<b>Notes:</b>
- requires an owning molecule
*/
int getPerturbationOrder(INT_LIST probe) const;
//! calculates any of our lazy \c properties
/*!
<b>Notes:</b>
- requires an owning molecule
- the current lazy \c properties are implicit and explicit valence
*/
void updatePropertyCache(bool strict=true);
bool needsUpdatePropertyCache() const;
//! calculates and returns our explicit valence
/*!
<b>Notes:</b>
- requires an owning molecule
*/
int calcExplicitValence(bool strict=true);
//! calculates and returns our implicit valence
/*!
<b>Notes:</b>
- requires an owning molecule
*/
int calcImplicitValence(bool strict=true);
AtomMonomerInfo *getMonomerInfo() { return dp_monomerInfo; };
const AtomMonomerInfo *getMonomerInfo() const { return dp_monomerInfo; };
//! takes ownership of the pointer
void setMonomerInfo(AtomMonomerInfo *info) { dp_monomerInfo=info; };
protected:
//! sets our owning molecule
void setOwningMol(ROMol *other);
//! sets our owning molecule
void setOwningMol(ROMol &other) {setOwningMol(&other);};
bool df_isAromatic;
bool df_noImplicit;
boost::uint8_t d_numExplicitHs;
boost::int8_t d_formalCharge;
boost::uint8_t d_atomicNum;
// NOTE that these cannot be signed, they are calculated using
// a lazy scheme and are initialized to -1 to indicate that the
// calculation has not yet been done.
boost::int8_t d_implicitValence, 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;
Dict *dp_props;
AtomMonomerInfo *dp_monomerInfo;
void initAtom();
};
};
//! allows Atom objects to be dumped to streams
std::ostream & operator<<(std::ostream& target, const RDKit::Atom &at);
#endif
RDKit::Atom::getOwningMol
ROMol & getOwningMol() const
returns a reference to the ROMol that owns this Atom
Definition: Atom.h:121
details.h
RDKit::Atom::OTHER
unrecognized hybridization
Definition: Atom.h:87
RDKit::INT_LIST
std::list< int > INT_LIST
Definition: types.h:152
RDKit::Atom::df_isAromatic
bool df_isAromatic
Definition: Atom.h:491
RDKit::Atom::setNumRadicalElectrons
void setNumRadicalElectrons(unsigned int num)
Definition: Atom.h:188
RDKit::Atom::setChiralTag
void setChiralTag(ChiralType what)
sets our chiralTag
Definition: Atom.h:221
RDKit::Atom::SP3D
Definition: Atom.h:85
RDKit::Atom::copy
virtual Atom * copy() const
makes a copy of this Atom and returns a pointer to it.
types.h
RDKit::Atom::getTotalValence
unsigned int getTotalValence() const
returns the total valence (implicit and explicit) for an atom
RDKit::Atom::getNoImplicit
bool getNoImplicit() const
returns the noImplicit flag
Definition: Atom.h:200
RDKit::Dict::setVal
void setVal(const std::string &what, T &val)
Sets the value associated with a key.
Definition: Dict.h:170
RDKit::Atom::S
Definition: Atom.h:81
RDKit::Atom::getPerturbationOrder
int getPerturbationOrder(INT_LIST probe) const
returns the perturbation order for a list of integers
RDKit::Atom::df_noImplicit
bool df_noImplicit
Definition: Atom.h:494
RDKit::Atom::invertChirality
void invertChirality()
inverts our chiralTag
RDKit::AtomMonomerInfo
The abstract base class for atom-level monomer info.
Definition: MonomerInfo.h:24
RDKit::Atom::SP
Definition: Atom.h:82
RDKit::Dict::keys
STR_VECT keys() const
Returns the set of keys in the dictionary.
Definition: Dict.h:63
Queries::CompositeQueryType
CompositeQueryType
Definition: QueryObjects.h:35
RDKit::RWMol
RWMol is a molecule class that is intended to be edited.
Definition: RWMol.h:30
RDKit::Atom::QUERYATOM_QUERY
Queries::Query< int, Atom const *, true > QUERYATOM_QUERY
Definition: Atom.h:76
RDKit::Atom::d_index
atomindex_t d_index
Definition: Atom.h:506
RDKit::Atom::UNSPECIFIED
hybridization that hasn't been specified
Definition: Atom.h:80
RDKit::Atom::getTotalNumHs
unsigned int getTotalNumHs(bool includeNeighbors=false) const
returns the total number of Hs (implicit and explicit) that this Atom is bound to ...
RDKit::Dict::getValIfPresent
bool getValIfPresent(const std::string &what, T &res) const
Potentially gets the value associated with a particular key returns true on success/false on failure...
Definition: Dict.h:134
RDKit::Atom::setQuery
virtual void setQuery(QUERYATOM_QUERY *what)
NOT CALLABLE.
RDKit::Atom::getNumRadicalElectrons
unsigned int getNumRadicalElectrons() const
returns the number of radical electrons for this Atom
Definition: Atom.h:187
RDKit::Atom::getIsotope
unsigned int getIsotope() const
returns our isotope number
Definition: Atom.h:218
RDKit::Atom::getMass
double getMass() const
returns our mass
RDKit::Atom::clearComputedProps
void clearComputedProps() const
clears all of our computed properties
Definition: Atom.h:420
RDKit::Atom::clearProp
void clearProp(const char *key) const
clears the value of a property
Definition: Atom.h:402
RDKit::Atom::getProp
T getProp(const char *key) const
Definition: Atom.h:361
RDKit::Atom::getIdx
unsigned int getIdx() const
returns our index within the ROMol
Definition: Atom.h:124
RDKit::Atom::d_chiralTag
boost::uint8_t d_chiralTag
Definition: Atom.h:503
RDKit::Atom::setProp
void setProp(const std::string &key, T val, bool computed=false) const
Definition: Atom.h:322
RDKit::Atom::CHI_OTHER
some unrecognized type of chirality
Definition: Atom.h:95
Dict.h
Defines the Dict class.
RDKit::Atom::getPropList
STR_VECT getPropList() const
returns a list with the names of our properties
Definition: Atom.h:299
RDKit::Atom::getProp
void getProp(const char *key, T &res) const
allows retrieval of a particular property value
Definition: Atom.h:350
RDKit::Atom::dp_props
Dict * dp_props
Definition: Atom.h:510
RDKit::Atom::d_explicitValence
boost::int8_t d_explicitValence
Definition: Atom.h:501
RDKit::Atom::Match
virtual bool Match(Atom const *what) const
returns whether or not we match the argument
RDKit::Atom::Match
virtual bool Match(const ATOM_SPTR &what) const
Definition: Atom.h:288
RDKit::ROMol
ROMol is a molecule class that is intended to have a fixed topology.
Definition: ROMol.h:105
RDKit::Atom::getDegree
unsigned int getDegree() const
RDKit::Dict::clearVal
void clearVal(const std::string &what)
Clears the value associated with a particular key, removing the key from the dictionary.
Definition: Dict.h:198
RDKit::Atom::updatePropertyCache
void updatePropertyCache(bool strict=true)
calculates any of our lazy properties
RDKit::Dict::getVal
void getVal(const std::string &what, T &res) const
Gets the value associated with a particular key.
Definition: Dict.h:86
RDKit::Atom::hasQuery
virtual bool hasQuery() const
Definition: Atom.h:245
RDKit::Atom::SP3D2
Definition: Atom.h:86
RDKit::Atom::CHI_TETRAHEDRAL_CW
tetrahedral: clockwise rotation (SMILES @@)
Definition: Atom.h:93
RDKit::Atom::hasProp
bool hasProp(const std::string &key) const
Definition: Atom.h:388
RDKit::Atom::getTotalDegree
unsigned int getTotalDegree() const
RDKit::Atom::setNumExplicitHs
void setNumExplicitHs(unsigned int what)
sets our number of explict Hs
Definition: Atom.h:203
RDKit::Atom::expandQuery
virtual void expandQuery(QUERYATOM_QUERY *what, Queries::CompositeQueryType how=Queries::COMPOSITE_AND, bool maintainOrder=true)
NOT CALLABLE.
RDKit::Atom::getAtomicNum
int getAtomicNum() const
returns our atomic number
Definition: Atom.h:113
RDKit::Atom::getMonomerInfo
AtomMonomerInfo * getMonomerInfo()
Definition: Atom.h:482
RDKit::Atom::getProp
void getProp(const std::string &key, T &res) const
Definition: Atom.h:355
RDKit::Atom::setAtomicNum
void setAtomicNum(int newNum)
sets our atomic number
Definition: Atom.h:115
RDKit::Atom::setIsotope
void setIsotope(unsigned int what)
sets our isotope number
RDKit::Atom::getExplicitValence
int getExplicitValence() const
returns the explicit valence (including Hs) of this atom
RDKit::Atom::setHybridization
void setHybridization(HybridizationType what)
sets our hybridization
Definition: Atom.h:228
RDKit::Atom::ChiralType
ChiralType
store type of chirality
Definition: Atom.h:91
RDKit::Atom::setProp
void setProp(const char *key, T val, bool computed=false) const
sets a property value
Definition: Atom.h:313
RDKit::Atom::setMonomerInfo
void setMonomerInfo(AtomMonomerInfo *info)
takes ownership of the pointer
Definition: Atom.h:485
RDKit::Atom::getNumExplicitHs
unsigned int getNumExplicitHs() const
returns our number of explict Hs
Definition: Atom.h:205
RDKit
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28
RDKit::Atom::initAtom
void initAtom()
RDKit::Atom::HybridizationType
HybridizationType
store hybridization
Definition: Atom.h:79
RDKit::Atom::SP2
Definition: Atom.h:83
detail::computedPropName
const std::string computedPropName
Definition: types.h:25
RDKit::Atom::getChiralTag
ChiralType getChiralTag() const
returns our chiralTag
Definition: Atom.h:225
RDKit::Atom::calcExplicitValence
int calcExplicitValence(bool strict=true)
calculates and returns our explicit valence
RDKit::Atom::getQuery
virtual QUERYATOM_QUERY * getQuery() const
NOT CALLABLE.
RDKit::Atom::getNumImplicitHs
unsigned int getNumImplicitHs() const
returns the number of implicit Hs this Atom is bound to
RDKit::Dict::hasVal
bool hasVal(const char *what) const
Returns whether or not the dictionary contains a particular key.
Definition: Dict.h:50
RDKit::Atom::setOwningMol
void setOwningMol(ROMol *other)
sets our owning molecule
RDKit::Atom::getProp
T getProp(const std::string &key) const
Definition: Atom.h:366
RDKit::Atom::getImplicitValence
int getImplicitValence() const
returns the implicit valence for this Atom
RDKit::Atom::dp_mol
ROMol * dp_mol
Definition: Atom.h:509
RDKit::Atom::d_hybrid
boost::uint8_t d_hybrid
Definition: Atom.h:504
RDKit::Atom::CHI_TETRAHEDRAL_CCW
tetrahedral: counter-clockwise rotation (SMILES @)
Definition: Atom.h:94
RDKit::Atom::SP3
Definition: Atom.h:84
RDKit::MolPickler
handles pickling (serializing) molecules
Definition: MolPickler.h:46
RDKit::Atom::d_isotope
boost::uint16_t d_isotope
Definition: Atom.h:507
RDKit::Atom::needsUpdatePropertyCache
bool needsUpdatePropertyCache() const
RDKit::Atom::calcImplicitValence
int calcImplicitValence(bool strict=true)
calculates and returns our implicit valence
RDKit::Atom::ATOM_SPTR
boost::shared_ptr< Atom > ATOM_SPTR
Definition: Atom.h:73
RDKit::Atom::d_atomicNum
boost::uint8_t d_atomicNum
Definition: Atom.h:497
RDKit::Atom::Atom
Atom()
RDKit::Atom::hasProp
bool hasProp(const char *key) const
returns whether or not we have a property with name key
Definition: Atom.h:383
RDKit::Atom::getMonomerInfo
const AtomMonomerInfo * getMonomerInfo() const
Definition: Atom.h:483
RDKit::Atom::clearProp
void clearProp(const std::string &key) const
Definition: Atom.h:407
operator<<
std::ostream & operator<<(std::ostream &target, const RDKit::Atom &at)
allows Atom objects to be dumped to streams
RDKit::atomindex_t
boost::uint16_t atomindex_t
Definition: details.h:13
RDKit::Atom::setNoImplicit
void setNoImplicit(bool what)
sets our noImplicit flag, indicating whether or not we are allowed to have implicit Hs ...
Definition: Atom.h:198
RDKit::Atom::getPropIfPresent
bool getPropIfPresent(const char *key, T &res) const
Definition: Atom.h:373
RDKit::Atom::getHybridization
HybridizationType getHybridization() const
returns our hybridization
Definition: Atom.h:230
RDKit::Atom::getSymbol
std::string getSymbol() const
returns our symbol (determined by our atomic number)
RDKit::Atom::setIdx
void setIdx(unsigned int index)
sets our index within the ROMol
Definition: Atom.h:131
RDKit::Atom::C_ATOM_SPTR
boost::shared_ptr< const Atom > C_ATOM_SPTR
Definition: Atom.h:74
RDKit::Atom::d_formalCharge
boost::int8_t d_formalCharge
Definition: Atom.h:496
RDKit::Atom::d_implicitValence
boost::int8_t d_implicitValence
Definition: Atom.h:501
RDKit::Atom::dp_monomerInfo
AtomMonomerInfo * dp_monomerInfo
Definition: Atom.h:511
QueryObjects.h
Pulls in all the query types.
RDKit::STR_VECT_I
std::vector< std::string >::iterator STR_VECT_I
Definition: types.h:168
RDKit::Atom::CHI_UNSPECIFIED
chirality that hasn't been specified
Definition: Atom.h:92
RDKit::Atom::getFormalCharge
int getFormalCharge() const
returns the formal charge of this atom
Definition: Atom.h:192
RDKit::Atom::d_numRadicalElectrons
boost::uint8_t d_numRadicalElectrons
Definition: Atom.h:502
RDKit::Atom::getPropIfPresent
bool getPropIfPresent(const std::string &key, T &res) const
Definition: Atom.h:378
Queries::Query
Base class for all queries.
Definition: Query.h:46
RDKit::Atom::setFormalCharge
void setFormalCharge(int what)
set's the formal charge of this atom
Definition: Atom.h:194
Queries::COMPOSITE_AND
Definition: QueryObjects.h:36
RDKit::Dict
The Dict class can be used to store objects of arbitrary type keyed by strings.
Definition: Dict.h:33
RDKit::Atom::d_numExplicitHs
boost::uint8_t d_numExplicitHs
Definition: Atom.h:495
RDKit::Atom::setOwningMol
void setOwningMol(ROMol &other)
sets our owning molecule
Definition: Atom.h:491
RDKit::Atom
The class for representing atoms.
Definition: Atom.h:67
RDKit::Atom::setIsAromatic
void setIsAromatic(bool what)
sets our isAromatic flag, indicating whether or not we are aromatic
Definition: Atom.h:208
RDKit::STR_VECT
std::vector< std::string > STR_VECT
Definition: Dict.h:26
RDKit::Atom::getIsAromatic
bool getIsAromatic() const
returns our isAromatic flag
Definition: Atom.h:210
RDKit::Atom::~Atom
virtual ~Atom()