RDKit: Atom.h Source File

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

Atom.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2001-2014 Greg Landrum and Rational Discovery LLC
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 /*! \file Atom.h
11
12 \brief Defines the Atom class and associated typedefs
13
14 */
15 #ifndef _RD_ATOM_H
16 #define _RD_ATOM_H
17
18 // Std stuff
19 #include <iostream>
20 #include <boost/foreach.hpp>
21
22 // ours
23 #include <Query/QueryObjects.h>
24 #include <RDGeneral/types.h>
25 #include <RDGeneral/Dict.h>
26 #include <GraphMol/details.h>
27
28 namespace RDKit {
29 class ROMol;
30 class RWMol;
31 class AtomMonomerInfo;
32
33 //! The class for representing atoms
34 /*!
35
36 <b>Notes:</b>
37 - many of the methods of Atom require that the Atom be associated
38 with a molecule (an ROMol).
39 - each Atom maintains a Dict of \c properties:
40 - Each \c property is keyed by name and can store an
41 arbitrary type.
42 - \c Properties can be marked as \c calculated, in which case
43 they will be cleared when the \c clearComputedProps() method
44 is called.
45 - Because they have no impact upon chemistry, all \c property
46 operations are \c const, this allows extra flexibility for
47 clients who need to store extra data on Atom objects.
48 - Atom objects are lazy about computing their explicit and implicit valence
49 values. These will not be computed until their values are requested.
50
51 <b>Chirality:</b>
52
53 The chirality of an Atom is determined by two things:
54 - its \c chiralTag
55 - the input order of its bonds (see note below for handling of
56 implicit Hs)
57
58 For tetrahedral coordination, the \c chiralTag tells you what
59 direction you have to rotate to get from bond 2 to bond 3 while looking
60 down bond 1. This is pretty much identical to the SMILES representation of
61 chirality.
62
63 NOTE: if an atom has an implicit H, the bond to that H is considered to be
64 at the *end* of the list of other bonds.
65
66 */
67 class Atom {
68 friend class MolPickler; //!< the pickler needs access to our privates
69 friend class ROMol;
70 friend class RWMol;
71
72 public:
73 typedef boost::shared_ptr<Atom> ATOM_SPTR;
74 typedef boost::shared_ptr<const Atom> C_ATOM_SPTR;
75 // FIX: grn...
76 typedef Queries::Query<int, Atom const *, true> QUERYATOM_QUERY;
77
78 //! store hybridization
79 typedef enum {
80 UNSPECIFIED = 0, //!< hybridization that hasn't been specified
81 S,
82 SP,
83 SP2,
84 SP3,
85 SP3D,
86 SP3D2,
87 OTHER //!< unrecognized hybridization
88 } HybridizationType;
89
90 //! store type of chirality
91 typedef enum {
92 CHI_UNSPECIFIED = 0, //!< chirality that hasn't been specified
93 CHI_TETRAHEDRAL_CW, //!< tetrahedral: clockwise rotation (SMILES \@\@)
94 CHI_TETRAHEDRAL_CCW, //!< tetrahedral: counter-clockwise rotation (SMILES
95 //\@)
96 CHI_OTHER //!< some unrecognized type of chirality
97 } ChiralType;
98
99 Atom();
100 //! construct an Atom with a particular atomic number
101 explicit Atom(unsigned int num);
102 //! construct an Atom with a particular symbol (looked up in the
103 // PeriodicTable)
104 explicit Atom(const std::string &what);
105 Atom(const Atom &other);
106 virtual ~Atom();
107
108 //! makes a copy of this Atom and returns a pointer to it.
109 /*!
110 <b>Note:</b> the caller is responsible for <tt>delete</tt>ing the result
111 */
112 virtual Atom *copy() const;
113
114 //! returns our atomic number
115 int getAtomicNum() const { return d_atomicNum; };
116 //! sets our atomic number
117 void setAtomicNum(int newNum) { d_atomicNum = newNum; };
118
119 //! returns our symbol (determined by our atomic number)
120 std::string getSymbol() const;
121
122 //! returns a reference to the ROMol that owns this Atom
123 ROMol &getOwningMol() const { return *dp_mol; };
124
125 //! returns our index within the ROMol
126 unsigned int getIdx() const { return d_index; };
127 //! sets our index within the ROMol
128 /*!
129 <b>Notes:</b>
130 - this makes no sense if we do not have an owning molecule
131 - the index should be <tt>< this->getOwningMol()->getNumAtoms()</tt>
132 */
133 void setIdx(unsigned int index) { d_index = index; };
134 //! overload
135 template <class U>
136 void setIdx(const U index) {
137 setIdx(rdcast<unsigned int>(index));
138 }
139 //! returns the explicit degree of the Atom (number of bonded
140 //! neighbors in the graph)
141 /*!
142 <b>Notes:</b>
143 - requires an owning molecule
144 */
145 unsigned int getDegree() const;
146
147 //! returns the total degree of the Atom (number of bonded
148 //! neighbors + number of Hs)
149 /*!
150 <b>Notes:</b>
151 - requires an owning molecule
152 */
153 unsigned int getTotalDegree() const;
154
155 //! \brief returns the total number of Hs (implicit and explicit) that
156 //! this Atom is bound to
157 /*!
158 <b>Notes:</b>
159 - requires an owning molecule
160 */
161 unsigned int getTotalNumHs(bool includeNeighbors = false) const;
162
163 //! \brief returns the total valence (implicit and explicit)
164 //! for an atom
165 /*!
166 <b>Notes:</b>
167 - requires an owning molecule
168 */
169 unsigned int getTotalValence() const;
170
171 //! returns the number of implicit Hs this Atom is bound to
172 /*!
173 <b>Notes:</b>
174 - requires an owning molecule
175 */
176 unsigned int getNumImplicitHs() const;
177
178 //! returns the explicit valence (including Hs) of this atom
179 int getExplicitValence() const;
180
181 //! returns the implicit valence for this Atom
182 /*!
183 <b>Notes:</b>
184 - requires an owning molecule
185 */
186 int getImplicitValence() const;
187
188 //! returns the number of radical electrons for this Atom
189 /*!
190 <b>Notes:</b>
191 - requires an owning molecule
192 */
193 unsigned int getNumRadicalElectrons() const { return d_numRadicalElectrons; };
194 void setNumRadicalElectrons(unsigned int num) {
195 d_numRadicalElectrons = num;
196 };
197
198 //! returns the formal charge of this atom
199 int getFormalCharge() const { return d_formalCharge; };
200 //! set's the formal charge of this atom
201 void setFormalCharge(int what) { d_formalCharge = what; };
202
203 //! \brief sets our \c noImplicit flag, indicating whether or not
204 //! we are allowed to have implicit Hs
205 void setNoImplicit(bool what) { df_noImplicit = what; };
206 //! returns the \c noImplicit flag
207 bool getNoImplicit() const { return df_noImplicit; };
208
209 //! sets our number of explict Hs
210 void setNumExplicitHs(unsigned int what) { d_numExplicitHs = what; };
211 //! returns our number of explict Hs
212 unsigned int getNumExplicitHs() const { return d_numExplicitHs; };
213
214 //! sets our \c isAromatic flag, indicating whether or not we are aromatic
215 void setIsAromatic(bool what) { df_isAromatic = what; };
216 //! returns our \c isAromatic flag
217 bool getIsAromatic() const { return df_isAromatic; };
218
219 //! returns our mass
220 double getMass() const;
221
222 //! sets our isotope number
223 void setIsotope(unsigned int what);
224 //! returns our isotope number
225 unsigned int getIsotope() const { return d_isotope; };
226
227 //! sets our \c chiralTag
228 void setChiralTag(ChiralType what) { d_chiralTag = what; };
229 //! inverts our \c chiralTag
230 void invertChirality();
231 //! returns our \c chiralTag
232 ChiralType getChiralTag() const {
233 return static_cast<ChiralType>(d_chiralTag);
234 };
235
236 //! sets our hybridization
237 void setHybridization(HybridizationType what) { d_hybrid = what; };
238 //! returns our hybridization
239 HybridizationType getHybridization() const {
240 return static_cast<HybridizationType>(d_hybrid);
241 };
242
243 // ------------------------------------
244 // Some words of explanation before getting down into
245 // the query stuff.
246 // These query functions are really only here so that they
247 // can have real functionality in subclasses (like QueryAtoms).
248 // Since pretty much it's gonna be a mistake to call any of these
249 // (ever), we're saddling them all with a precondition which
250 // is guaranteed to fail. I'd like to have them be pure virtual,
251 // but that doesn't work since we need to be able to instantiate
252 // Atoms.
253 // ------------------------------------
254
255 // This method can be used to distinguish query atoms from standard atoms:
256 virtual bool hasQuery() const { return false; };
257
258 //! NOT CALLABLE
259 virtual void setQuery(QUERYATOM_QUERY *what);
260
261 //! NOT CALLABLE
262 virtual QUERYATOM_QUERY *getQuery() const;
263 //! NOT CALLABLE
264 virtual void expandQuery(
265 QUERYATOM_QUERY *what,
266 Queries::CompositeQueryType how = Queries::COMPOSITE_AND,
267 bool maintainOrder = true);
268
269 //! returns whether or not we match the argument
270 /*!
271 <b>Notes:</b>
272 The general rule is that if a property on this atom has a non-default
273 value,
274 the property on the other atom must have the same value.
275 The exception to this is H counts, which are ignored. These turns out to
276 be
277 impossible to handle generally, so rather than having odd and
278 hard-to-explain
279 exceptions, we ignore them entirely.
280
281 Here are the rules for atom-atom matching:
282 | This | Other | Match | Reason
283 | CCO | CCO | Yes |
284 | CCO | CC[O-] | Yes |
285 | CC[O-] | CCO | No | Charge
286 | CC[O-] | CC[O-] | Yes |
287 | CC[OH] | CC[O-] | Yes |
288 | CC[OH] | CCOC | Yes |
289 | CCO | CCOC | Yes |
290 | CCC | CCC | Yes |
291 | CCC | CC[14C] | Yes |
292 | CC[14C] | CCC | No | Isotope
293 | CC[14C] | CC[14C] | Yes |
294 | C | OCO | Yes |
295 | [CH] | OCO | Yes |
296 | [CH2] | OCO | Yes |
297 | [CH3] | OCO | No | Radical
298 | C | O[CH2]O | Yes |
299 | [CH2] | O[CH2]O | Yes |
300 */
301 virtual bool Match(Atom const *what) const;
302 //! \overload
303 virtual inline bool Match(const ATOM_SPTR &what) const {
304 return Match(what.get());
305 };
306
307 // ------------------------------------
308 // Local Property Dict functionality
309 // all setProp functions are const because they
310 // are not meant to change the atom chemically
311 // ------------------------------------
312 //! returns a list with the names of our \c properties
313 STR_VECT getPropList() const { return dp_props->keys(); }
314
315 //! sets a \c property value
316 /*!
317 \param key the name under which the \c property should be stored.
318 If a \c property is already stored under this name, it will be
319 replaced.
320 \param val the value to be stored
321 \param computed (optional) allows the \c property to be flagged
322 \c computed.
323 */
324 template <typename T>
325 void setProp(const char *key, T val, bool computed = false) const {
326 // if(!dp_props) dp_props = new Dict();
327 std::string what(key);
328 setProp(what, val, computed);
329 }
330
331 //! \overload
332 template <typename T>
333 void setProp(const std::string &key, T val, bool computed = false) const {
334 if (computed) {
335 STR_VECT compLst;
336 getPropIfPresent(detail::computedPropName, compLst);
337 if (std::find(compLst.begin(), compLst.end(), key) == compLst.end()) {
338 compLst.push_back(key);
339 dp_props->setVal(detail::computedPropName, compLst);
340 }
341 }
342 // setProp(key.c_str(),val);
343 dp_props->setVal(key, val);
344 }
345
346 //! allows retrieval of a particular property value
347 /*!
348
349 \param key the name under which the \c property should be stored.
350 If a \c property is already stored under this name, it will be
351 replaced.
352 \param res a reference to the storage location for the value.
353
354 <b>Notes:</b>
355 - if no \c property with name \c key exists, a KeyErrorException will be
356 thrown.
357 - the \c boost::lexical_cast machinery is used to attempt type
358 conversions.
359 If this fails, a \c boost::bad_lexical_cast exception will be thrown.
360
361 */
362 template <typename T>
363 void getProp(const char *key, T &res) const {
364 dp_props->getVal(key, res);
365 }
366 //! \overload
367 template <typename T>
368 void getProp(const std::string &key, T &res) const {
369 dp_props->getVal(key, res);
370 }
371
372 //! \overload
373 template <typename T>
374 T getProp(const char *key) const {
375 return dp_props->getVal<T>(key);
376 }
377 //! \overload
378 template <typename T>
379 T getProp(const std::string &key) const {
380 return dp_props->getVal<T>(key);
381 }
382
383 //! returns whether or not we have a \c property with name \c key
384 //! and assigns the value if we do
385 template <typename T>
386 bool getPropIfPresent(const char *key, T &res) const {
387 return dp_props->getValIfPresent(key, res);
388 }
389 //! \overload
390 template <typename T>
391 bool getPropIfPresent(const std::string &key, T &res) const {
392 return dp_props->getValIfPresent(key, res);
393 }
394
395 //! returns whether or not we have a \c property with name \c key
396 bool hasProp(const char *key) const {
397 if (!dp_props) return false;
398 return dp_props->hasVal(key);
399 };
400 //! \overload
401 bool hasProp(const std::string &key) const {
402 if (!dp_props) return false;
403 return dp_props->hasVal(key);
404 };
405
406 //! clears the value of a \c property
407 /*!
408 <b>Notes:</b>
409 - if no \c property with name \c key exists, a KeyErrorException
410 will be thrown.
411 - if the \c property is marked as \c computed, it will also be removed
412 from our list of \c computedProperties
413 */
414 void clearProp(const char *key) const {
415 std::string what(key);
416 clearProp(what);
417 };
418 //! \overload
419 void clearProp(const std::string &key) const {
420 STR_VECT compLst;
421 if (getPropIfPresent(detail::computedPropName, compLst)) {
422 STR_VECT_I svi = std::find(compLst.begin(), compLst.end(), key);
423 if (svi != compLst.end()) {
424 compLst.erase(svi);
425 dp_props->setVal(detail::computedPropName, compLst);
426 }
427 }
428 dp_props->clearVal(key);
429 };
430
431 //! clears all of our \c computed \c properties
432 void clearComputedProps() const {
433 STR_VECT compLst;
434 if (getPropIfPresent(detail::computedPropName, compLst)) {
435 BOOST_FOREACH (const std::string &sv, compLst) { dp_props->clearVal(sv); }
436 compLst.clear();
437 dp_props->setVal(detail::computedPropName, compLst);
438 }
439 }
440
441 //! returns the perturbation order for a list of integers
442 /*!
443
444 This value is associated with chirality.
445
446 \param probe a list of bond indices. This must be the same
447 length as our number of incoming bonds (our degree).
448
449 \return the number of swaps required to convert the ordering
450 of the probe list to match the order of our incoming bonds:
451 e.g. if our incoming bond order is: <tt>[0,1,2,3]</tt>
452 \verbatim
453 getPerturbationOrder([1,0,2,3]) = 1
454 getPerturbationOrder([1,2,3,0]) = 3
455 getPerturbationOrder([1,2,0,3]) = 2
456 \endverbatim
457
458 See the class documentation for a more detailed description
459 of our representation of chirality.
460
461 <b>Notes:</b>
462 - requires an owning molecule
463
464 */
465 int getPerturbationOrder(INT_LIST probe) const;
466
467 //! calculates any of our lazy \c properties
468 /*!
469 <b>Notes:</b>
470 - requires an owning molecule
471 - the current lazy \c properties are implicit and explicit valence
472 */
473 void updatePropertyCache(bool strict = true);
474
475 bool needsUpdatePropertyCache() const;
476
477 //! calculates and returns our explicit valence
478 /*!
479 <b>Notes:</b>
480 - requires an owning molecule
481 */
482 int calcExplicitValence(bool strict = true);
483
484 //! calculates and returns our implicit valence
485 /*!
486 <b>Notes:</b>
487 - requires an owning molecule
488 */
489 int calcImplicitValence(bool strict = true);
490
491 AtomMonomerInfo *getMonomerInfo() { return dp_monomerInfo; };
492 const AtomMonomerInfo *getMonomerInfo() const { return dp_monomerInfo; };
493 //! takes ownership of the pointer
494 void setMonomerInfo(AtomMonomerInfo *info) { dp_monomerInfo = info; };
495
496 protected:
497 //! sets our owning molecule
498 void setOwningMol(ROMol *other);
499 //! sets our owning molecule
500 void setOwningMol(ROMol &other) { setOwningMol(&other); };
501
502 bool df_isAromatic;
503 bool df_noImplicit;
504 boost::uint8_t d_numExplicitHs;
505 boost::int8_t d_formalCharge;
506 boost::uint8_t d_atomicNum;
507 // NOTE that these cannot be signed, they are calculated using
508 // a lazy scheme and are initialized to -1 to indicate that the
509 // calculation has not yet been done.
510 boost::int8_t d_implicitValence, d_explicitValence;
511 boost::uint8_t d_numRadicalElectrons;
512 boost::uint8_t d_chiralTag;
513 boost::uint8_t d_hybrid;
514
515 atomindex_t d_index;
516 boost::uint16_t d_isotope;
517
518 ROMol *dp_mol;
519 Dict *dp_props;
520 AtomMonomerInfo *dp_monomerInfo;
521 void initAtom();
522 };
523 };
524 //! allows Atom objects to be dumped to streams
525 std::ostream &operator<<(std::ostream &target, const RDKit::Atom &at);
526
527 #endif
RDKit::Atom::getOwningMol
ROMol & getOwningMol() const
returns a reference to the ROMol that owns this Atom
Definition: Atom.h:123
RDKit::Atom::QUERYATOM_QUERY
Queries::Query< int, Atom const *, true > QUERYATOM_QUERY
Definition: Atom.h:76
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:500
RDKit::Atom::setNumRadicalElectrons
void setNumRadicalElectrons(unsigned int num)
Definition: Atom.h:194
RDKit::Atom::setChiralTag
void setChiralTag(ChiralType what)
sets our chiralTag
Definition: Atom.h:228
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:207
RDKit::Dict::setVal
void setVal(const std::string &what, T &val)
Sets the value associated with a key.
Definition: Dict.h:169
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:503
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:61
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::d_index
atomindex_t d_index
Definition: Atom.h:515
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:193
RDKit::Atom::getIsotope
unsigned int getIsotope() const
returns our isotope number
Definition: Atom.h:225
RDKit::Atom::getMass
double getMass() const
returns our mass
RDKit::Atom::clearComputedProps
void clearComputedProps() const
clears all of our computed properties
Definition: Atom.h:432
RDKit::Atom::clearProp
void clearProp(const char *key) const
clears the value of a property
Definition: Atom.h:414
RDKit::Atom::getProp
T getProp(const char *key) const
Definition: Atom.h:374
RDKit::Atom::getIdx
unsigned int getIdx() const
returns our index within the ROMol
Definition: Atom.h:126
RDKit::Atom::d_chiralTag
boost::uint8_t d_chiralTag
Definition: Atom.h:512
RDKit::Atom::setProp
void setProp(const std::string &key, T val, bool computed=false) const
Definition: Atom.h:333
RDKit::Atom::CHI_OTHER
some unrecognized type of chirality
Definition: Atom.h:96
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:313
RDKit::Atom::getProp
void getProp(const char *key, T &res) const
allows retrieval of a particular property value
Definition: Atom.h:363
RDKit::Atom::dp_props
Dict * dp_props
Definition: Atom.h:519
RDKit::Atom::d_explicitValence
boost::int8_t d_explicitValence
Definition: Atom.h:510
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:303
RDKit::ROMol
ROMol is a molecule class that is intended to have a fixed topology.
Definition: ROMol.h:102
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:195
RDKit::Atom::setIdx
void setIdx(const U index)
overload
Definition: Atom.h:136
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:84
RDKit::Atom::hasQuery
virtual bool hasQuery() const
Definition: Atom.h:256
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:401
RDKit::Atom::getTotalDegree
unsigned int getTotalDegree() const
RDKit::Atom::setNumExplicitHs
void setNumExplicitHs(unsigned int what)
sets our number of explict Hs
Definition: Atom.h:210
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:115
RDKit::Atom::getMonomerInfo
AtomMonomerInfo * getMonomerInfo()
Definition: Atom.h:491
RDKit::Atom::getProp
void getProp(const std::string &key, T &res) const
Definition: Atom.h:368
RDKit::Atom::setAtomicNum
void setAtomicNum(int newNum)
sets our atomic number
Definition: Atom.h:117
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:237
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:325
RDKit::Atom::setMonomerInfo
void setMonomerInfo(AtomMonomerInfo *info)
takes ownership of the pointer
Definition: Atom.h:494
RDKit::Atom::getNumExplicitHs
unsigned int getNumExplicitHs() const
returns our number of explict Hs
Definition: Atom.h:212
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:232
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:48
RDKit::Atom::setOwningMol
void setOwningMol(ROMol *other)
sets our owning molecule
RDKit::Atom::getProp
T getProp(const std::string &key) const
Definition: Atom.h:379
RDKit::Atom::getImplicitValence
int getImplicitValence() const
returns the implicit valence for this Atom
RDKit::Atom::dp_mol
ROMol * dp_mol
Definition: Atom.h:518
RDKit::Atom::d_hybrid
boost::uint8_t d_hybrid
Definition: Atom.h:513
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:516
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:506
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:396
RDKit::Atom::getMonomerInfo
const AtomMonomerInfo * getMonomerInfo() const
Definition: Atom.h:492
RDKit::Atom::clearProp
void clearProp(const std::string &key) const
Definition: Atom.h:419
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:205
RDKit::Atom::getPropIfPresent
bool getPropIfPresent(const char *key, T &res) const
Definition: Atom.h:386
RDKit::Atom::getHybridization
HybridizationType getHybridization() const
returns our hybridization
Definition: Atom.h:239
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:133
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:505
RDKit::Atom::d_implicitValence
boost::int8_t d_implicitValence
Definition: Atom.h:510
RDKit::Atom::dp_monomerInfo
AtomMonomerInfo * dp_monomerInfo
Definition: Atom.h:520
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:199
RDKit::Atom::d_numRadicalElectrons
boost::uint8_t d_numRadicalElectrons
Definition: Atom.h:511
RDKit::Atom::getPropIfPresent
bool getPropIfPresent(const std::string &key, T &res) const
Definition: Atom.h:391
Queries::Query
Base class for all queries.
Definition: Query.h:45
RDKit::Atom::setFormalCharge
void setFormalCharge(int what)
set's the formal charge of this atom
Definition: Atom.h:201
Queries::COMPOSITE_AND
Definition: QueryObjects.h:35
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:504
RDKit::Atom::setOwningMol
void setOwningMol(ROMol &other)
sets our owning molecule
Definition: Atom.h:500
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:215
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:217
RDKit::Atom::~Atom
virtual ~Atom()