Chemical Data Processing Library C++ API - Version 1.4.0
Chem/AtomFunctions.hpp
Go to the documentation of this file.
1 /*
2  * AtomFunctions.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_CHEM_ATOMFUNCTIONS_HPP
30 #define CDPL_CHEM_ATOMFUNCTIONS_HPP
31 
32 #include <cstddef>
33 #include <string>
34 #include <type_traits>
35 
36 #include "CDPL/Chem/APIPrefix.hpp"
42 #include "CDPL/Math/Vector.hpp"
44 #include "CDPL/Util/BitSet.hpp"
45 
46 
47 namespace CDPL
48 {
49 
50  namespace Chem
51  {
52 
53  class StereoDescriptor;
54 
55 
59  CDPL_CHEM_API const std::string& getName(const Atom& atom);
60 
64  CDPL_CHEM_API void setName(Atom& atom, const std::string& name);
65 
69 
73  CDPL_CHEM_API bool hasName(const Atom& atom);
74 
75 
79  CDPL_CHEM_API const std::string& getSymbol(const Atom& atom);
80 
84  CDPL_CHEM_API void setSymbol(Atom& atom, const std::string& symbol);
85 
89 
93  CDPL_CHEM_API bool hasSymbol(const Atom& atom);
94 
98  CDPL_CHEM_API const std::string& getSymbolForType(const Atom& atom);
99 
100 
104  CDPL_CHEM_API unsigned int getType(const Atom& atom);
105 
109  CDPL_CHEM_API void setType(Atom& atom, unsigned int type);
110 
114 
118  CDPL_CHEM_API bool hasType(const Atom& atom);
119 
123  CDPL_CHEM_API unsigned int getTypeForSymbol(const Atom& atom);
124 
128  CDPL_CHEM_API unsigned int getGenericType(const Atom& atom); //move
129 
130 
134  CDPL_CHEM_API long getFormalCharge(const Atom& atom);
135 
139  CDPL_CHEM_API void setFormalCharge(Atom& atom, long charge);
140 
144 
148  CDPL_CHEM_API bool hasFormalCharge(const Atom& atom);
149 
154  CDPL_CHEM_API long calcFormalCharge(const Atom& atom, const MolecularGraph& molgraph);
155 
156 
160  CDPL_CHEM_API std::size_t getIsotope(const Atom& atom);
161 
165  CDPL_CHEM_API void setIsotope(Atom& atom, std::size_t isotope);
166 
170 
174  CDPL_CHEM_API bool hasIsotope(const Atom& atom);
175 
176 
180  CDPL_CHEM_API unsigned int getRadicalType(const Atom& atom);
181 
185  CDPL_CHEM_API void setRadicalType(Atom& atom, unsigned int type);
186 
190 
194  CDPL_CHEM_API bool hasRadicalType(const Atom& atom);
195 
196 
200  CDPL_CHEM_API unsigned int getHybridizationState(const Atom& atom);
201 
205  CDPL_CHEM_API void setHybridizationState(Atom& atom, unsigned int state);
206 
210 
215 
220  CDPL_CHEM_API unsigned int perceiveHybridizationState(const Atom& atom, const MolecularGraph& molgraph);
221 
222 
226  CDPL_CHEM_API bool getRingFlag(const Atom& atom);
227 
231  CDPL_CHEM_API void setRingFlag(Atom& atom, bool in_ring);
232 
236 
240  CDPL_CHEM_API bool hasRingFlag(const Atom& atom);
241 
242 
248  CDPL_CHEM_API bool isInFragmentOfSize(const Atom& atom, const FragmentList& frag_list, std::size_t size);
249 
254  CDPL_CHEM_API std::size_t getSizeOfSmallestContainingFragment(const Atom& atom, const FragmentList& frag_list);
255 
260  CDPL_CHEM_API std::size_t getSizeOfLargestContainingFragment(const Atom& atom, const FragmentList& frag_list);
261 
266  CDPL_CHEM_API std::size_t getNumContainingFragments(const Atom& atom, const FragmentList& frag_list);
267 
273  CDPL_CHEM_API void getContainingFragments(const Atom& atom, const FragmentList& frag_list, FragmentList& cont_frag_list, bool append = false);
274 
275 
280 
284  CDPL_CHEM_API void setAromaticityFlag(Atom& atom, bool aromatic);
285 
289 
294 
295 
299  CDPL_CHEM_API std::size_t getUnpairedElectronCount(const Atom& atom);
300 
304  CDPL_CHEM_API void setUnpairedElectronCount(Atom& atom, std::size_t count);
305 
309 
314 
315 
319  CDPL_CHEM_API std::size_t getImplicitHydrogenCount(const Atom& atom);
320 
324  CDPL_CHEM_API void setImplicitHydrogenCount(Atom& atom, std::size_t count);
325 
329 
334 
339  CDPL_CHEM_API std::size_t calcImplicitHydrogenCount(const Atom& atom, const MolecularGraph& molgraph);
340 
341 
346 
350  CDPL_CHEM_API void set2DCoordinates(Atom& atom, const Math::Vector2D& coords);
351 
355 
360 
361 
366  CDPL_CHEM_API const Math::Vector3D& getConformer3DCoordinates(const Atom& atom, std::size_t conf_idx);
367 
368 
372  CDPL_CHEM_API const Math::Vector3DArray::SharedPointer& get3DCoordinatesArray(const Atom& atom);
373 
377  CDPL_CHEM_API void set3DCoordinatesArray(Atom& atom, const Math::Vector3DArray::SharedPointer& coords_array);
378 
382 
387 
388 
392  CDPL_CHEM_API std::size_t getMorganNumber(const Atom& atom);
393 
397  CDPL_CHEM_API void setMorganNumber(Atom& atom, std::size_t num);
398 
402 
406  CDPL_CHEM_API bool hasMorganNumber(const Atom& atom);
407 
408 
412  CDPL_CHEM_API std::size_t getCanonicalNumber(const Atom& atom);
413 
417  CDPL_CHEM_API void setCanonicalNumber(Atom& atom, std::size_t num);
418 
422 
427 
428 
432  CDPL_CHEM_API std::size_t getCIPPriority(const Atom& atom);
433 
437  CDPL_CHEM_API void setCIPPriority(Atom& atom, std::size_t priority);
438 
442 
446  CDPL_CHEM_API bool hasCIPPriority(const Atom& atom);
447 
448 
452  CDPL_CHEM_API std::size_t getSymmetryClass(const Atom& atom);
453 
457  CDPL_CHEM_API void setSymmetryClass(Atom& atom, std::size_t class_id);
458 
462 
467 
468 
472  CDPL_CHEM_API unsigned int getCIPConfiguration(const Atom& atom);
473 
477  CDPL_CHEM_API void setCIPConfiguration(Atom& atom, unsigned int config);
478 
482 
487 
488 
493 
498 
502 
507 
513  CDPL_CHEM_API StereoDescriptor calcStereoDescriptor(const Atom& atom, const MolecularGraph& molgraph, std::size_t dim = 1);
514 
520 
527  CDPL_CHEM_API unsigned int calcConfiguration(const Atom& atom, const MolecularGraph& molgraph, const StereoDescriptor& descr,
528  const Math::Vector3DArray& coords);
529 
530 
535 
539  CDPL_CHEM_API void setStereoCenterFlag(Atom& atom, bool is_center);
540 
544 
549 
560  CDPL_CHEM_API bool isStereoCenter(const Atom& atom, const MolecularGraph& molgraph, bool check_asym = true,
561  bool check_inv_n = true, bool check_quart_n = true, bool check_plan_n = true,
562  bool check_amide_n = true, bool check_res_ctrs = true);
563 
564 
568  CDPL_CHEM_API unsigned int getSybylType(const Atom& atom);
569 
573  CDPL_CHEM_API void setSybylType(Atom& atom, unsigned int type);
574 
578 
582  CDPL_CHEM_API bool hasSybylType(const Atom& atom);
583 
588  CDPL_CHEM_API unsigned int perceiveSybylType(const Atom& atom, const MolecularGraph& molgraph);
589 
590 
594  CDPL_CHEM_API const std::string& getMOL2Name(const Atom& atom);
595 
599  CDPL_CHEM_API void setMOL2Name(Atom& atom, const std::string& name);
600 
604 
608  CDPL_CHEM_API bool hasMOL2Name(const Atom& atom);
609 
610 
614  CDPL_CHEM_API double getMOL2Charge(const Atom& atom);
615 
619  CDPL_CHEM_API void setMOL2Charge(Atom& atom, double charge);
620 
624 
628  CDPL_CHEM_API bool hasMOL2Charge(const Atom& atom);
629 
630 
634  CDPL_CHEM_API std::size_t getMOL2SubstructureID(const Atom& atom);
635 
639  CDPL_CHEM_API void setMOL2SubstructureID(Atom& atom, std::size_t id);
640 
644 
649 
650 
654  CDPL_CHEM_API const std::string& getMOL2SubstructureName(const Atom& atom);
655 
659  CDPL_CHEM_API void setMOL2SubstructureName(Atom& atom, const std::string& id);
660 
664 
669 
670 
674  CDPL_CHEM_API const std::string& getMOL2SubstructureSubtype(const Atom& atom);
675 
679  CDPL_CHEM_API void setMOL2SubstructureSubtype(Atom& atom, const std::string& subtype);
680 
684 
689 
690 
694  CDPL_CHEM_API const std::string& getMOL2SubstructureChain(const Atom& atom);
695 
699  CDPL_CHEM_API void setMOL2SubstructureChain(Atom& atom, const std::string& chain);
700 
704 
709 
710 
714  CDPL_CHEM_API unsigned int getMDLParity(const Atom& atom);
715 
719  CDPL_CHEM_API void setMDLParity(Atom& atom, unsigned int parity);
720 
724 
728  CDPL_CHEM_API bool hasMDLParity(const Atom& atom);
729 
734  CDPL_CHEM_API unsigned int calcMDLParity(const Atom& atom, const MolecularGraph& molgraph);
735 
736 
741 
745  CDPL_CHEM_API void setMDLStereoCareFlag(Atom& atom, bool flag);
746 
750 
755 
756 
760  CDPL_CHEM_API unsigned int getReactionCenterStatus(const Atom& atom);
761 
765  CDPL_CHEM_API void setReactionCenterStatus(Atom& atom, unsigned int status);
766 
770 
775 
776 
780  CDPL_CHEM_API std::size_t getAtomMappingID(const Atom& atom);
781 
785  CDPL_CHEM_API void setAtomMappingID(Atom& atom, std::size_t id);
786 
790 
795 
796 
800  CDPL_CHEM_API std::size_t getComponentGroupID(const Atom& atom);
801 
805  CDPL_CHEM_API void setComponentGroupID(Atom& atom, std::size_t id);
806 
810 
815 
816 
821 
826 
830 
835 
836 
841 
846 
850 
855 
861 
862 
866  CDPL_CHEM_API const std::string& getMatchExpressionString(const Atom& atom);
867 
871  CDPL_CHEM_API void setMatchExpressionString(Atom& atom, const std::string& expr_str);
872 
876 
881 
886  CDPL_CHEM_API void generateMatchExpressionString(const Atom& atom, const MolecularGraph& molgraph, std::string& expr_str);
887 
888 
894  CDPL_CHEM_API void markReachableAtoms(const Atom& atom, const MolecularGraph& molgraph,
895  Util::BitSet& atom_mask, bool reset = true);
896 
902  CDPL_CHEM_API std::size_t getTopologicalDistance(const Atom& atom1, const Atom& atom2, const MolecularGraph& molgraph);
903 
911  CDPL_CHEM_API std::size_t getEnvironment(const Atom& atom, const MolecularGraph& molgraph, std::size_t max_dist, Fragment& env, bool append = false);
912 
913 
924  template <typename AtomType, typename OutputIterator>
925  std::size_t getConnectedAtoms(AtomType& atom, const MolecularGraph& molgraph, OutputIterator it, AtomType* excl_atom = 0)
926  {
927  typedef typename std::conditional<std::is_const<AtomType>::value, typename AtomType::ConstAtomIterator, typename AtomType::AtomIterator>::type AtomIterator;
928 
929  AtomIterator atoms_end = atom.getAtomsEnd();
930  typename AtomType::ConstBondIterator b_it = atom.getBondsBegin();
931  std::size_t count = 0;
932 
933  for (AtomIterator a_it = atom.getAtomsBegin(); a_it != atoms_end; ++a_it, ++b_it) {
934  if (&(*a_it) == excl_atom)
935  continue;
936 
937  if (molgraph.containsAtom(*a_it) && molgraph.containsBond(*b_it)) {
938  *it = &(*a_it);
939  ++it;
940  count++;
941  }
942  }
943 
944  return count;
945  }
946 
957  template <typename AtomType, typename OutputIterator>
958  std::size_t getIncidentBonds(AtomType& atom, const MolecularGraph& molgraph, OutputIterator it, AtomType* excl_atom = 0)
959  {
960  typedef typename std::conditional<std::is_const<AtomType>::value, typename AtomType::ConstBondIterator, typename AtomType::BondIterator>::type BondIterator;
961 
962  BondIterator bonds_end = atom.getBondsEnd();
963  typename AtomType::ConstAtomIterator a_it = atom.getAtomsBegin();
964  std::size_t count = 0;
965 
966  for (BondIterator b_it = atom.getBondsBegin(); b_it != bonds_end; ++a_it, ++b_it) {
967  if (&(*a_it) == excl_atom)
968  continue;
969 
970  if (molgraph.containsAtom(*a_it) && molgraph.containsBond(*b_it)) {
971  *it = &(*b_it);
972  ++it;
973  count++;
974  }
975  }
976 
977  return count;
978  }
979 
992  template <typename AtomType, typename AtomOutputIterator, typename BondOutputIterator>
993  std::size_t getConnectedAtomsAndBonds(AtomType& atom, const MolecularGraph& molgraph, AtomOutputIterator ao_it, BondOutputIterator bo_it, AtomType* excl_atom = 0)
994  {
995  typedef typename std::conditional<std::is_const<AtomType>::value, typename AtomType::ConstAtomIterator, typename AtomType::AtomIterator>::type AtomIterator;
996  typedef typename std::conditional<std::is_const<AtomType>::value, typename AtomType::ConstBondIterator, typename AtomType::BondIterator>::type BondIterator;
997 
998  BondIterator bonds_end = atom.getBondsEnd();
999  AtomIterator a_it = atom.getAtomsBegin();
1000  std::size_t count = 0;
1001 
1002  for (BondIterator b_it = atom.getBondsBegin(); b_it != bonds_end; ++a_it, ++b_it) {
1003  if (&(*a_it) == excl_atom)
1004  continue;
1005 
1006  if (molgraph.containsAtom(*a_it) && molgraph.containsBond(*b_it)) {
1007  *ao_it = &(*a_it);
1008  *bo_it = &(*b_it);
1009  ++ao_it;
1010  ++bo_it;
1011  count++;
1012  }
1013  }
1014 
1015  return count;
1016  }
1017  } // namespace Chem
1018 } // namespace CDPL
1019 
1020 #endif // CDPL_CHEM_ATOMFUNCTIONS_HPP
Type definition of a generic wrapper class for storing user-defined Chem::Atom priority functions.
Declaration of type CDPL::Util::BitSet.
Definition of the preprocessor macro CDPL_CHEM_API.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of constants in namespace CDPL::Chem::AtomPropertyFlag.
Definition of class CDPL::Chem::FragmentList.
Definition of class CDPL::Chem::MatchConstraintList.
Definition of class CDPL::Chem::MatchExpression.
Definition of class CDPL::Math::VectorArray.
Definition of vector data types.
virtual bool containsAtom(const Atom &atom) const =0
Tells whether the specified Chem::Atom instance is stored in this container.
Abstract base class representing a chemical atom and its bonded neighborhood.
Definition: Atom.hpp:57
virtual bool containsBond(const Bond &bond) const =0
Tells whether the specified Chem::Bond instance is stored in this container.
Data type for the storage of Chem::Fragment objects.
Definition: FragmentList.hpp:49
Concrete Chem::MolecularGraph implementation that stores references to a selectable subset of atoms a...
Definition: Fragment.hpp:57
std::shared_ptr< MatchConstraintList > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MatchConstraintList instances.
Definition: MatchConstraintList.hpp:211
Generic boolean expression interface for the implementation of query/target object equivalence tests ...
Definition: MatchExpression.hpp:75
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
Data structure for the storage and retrieval of stereochemical information about atoms and bonds.
Definition: StereoDescriptor.hpp:102
CDPL_CHEM_API bool hasFormalCharge(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::FORMAL_CHARGE property.
CDPL_CHEM_API bool hasMDLParity(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::MDL_PARITY property.
CDPL_CHEM_API std::size_t getEnvironment(const Atom &atom, const MolecularGraph &molgraph, std::size_t max_dist, Fragment &env, bool append=false)
Collects every atom of molgraph that is within max_dist bonds of atom into the fragment env.
CDPL_CHEM_API std::size_t getSizeOfSmallestContainingFragment(const Atom &atom, const FragmentList &frag_list)
Returns the size (in atoms) of the smallest fragment in frag_list that contains atom.
CDPL_CHEM_API void setRingFlag(Atom &atom, bool in_ring)
Sets the Chem::AtomProperty::RING_FLAG property of atom to in_ring.
std::size_t getConnectedAtomsAndBonds(AtomType &atom, const MolecularGraph &molgraph, AtomOutputIterator ao_it, BondOutputIterator bo_it, AtomType *excl_atom=0)
Writes every neighbor of atom and the corresponding incident bond (both filtered by molgraph) into th...
Definition: Chem/AtomFunctions.hpp:993
CDPL_CHEM_API std::size_t getSymmetryClass(const Atom &atom)
Returns the Chem::AtomProperty::SYMMETRY_CLASS property of atom.
CDPL_CHEM_API bool hasSymmetryClass(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::SYMMETRY_CLASS property.
CDPL_CHEM_API void setCanonicalNumber(Atom &atom, std::size_t num)
Sets the Chem::AtomProperty::CANONICAL_NUMBER property of atom to num.
CDPL_CHEM_API bool hasIsotope(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::ISOTOPE property.
CDPL_CHEM_API long getFormalCharge(const Atom &atom)
Returns the Chem::AtomProperty::FORMAL_CHARGE property of atom.
CDPL_CHEM_API unsigned int getTypeForSymbol(const Atom &atom)
Returns the atom type that corresponds to the Chem::AtomProperty::SYMBOL of atom.
CDPL_CHEM_API bool hasMOL2SubstructureChain(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::MOL2_SUBSTRUCTURE_CHAIN property.
CDPL_CHEM_API void clear2DCoordinates(Atom &atom)
Removes the Chem::AtomProperty::COORDINATES_2D property from atom.
CDPL_CHEM_API bool hasCIPPriority(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::CIP_PRIORITY property.
CDPL_CHEM_API void clearFormalCharge(Atom &atom)
Removes the Chem::AtomProperty::FORMAL_CHARGE property from atom.
CDPL_CHEM_API bool getAromaticityFlag(const Atom &atom)
Returns the Chem::AtomProperty::AROMATICITY_FLAG property of atom.
CDPL_CHEM_API void clearRingFlag(Atom &atom)
Removes the Chem::AtomProperty::RING_FLAG property from atom.
CDPL_CHEM_API void clearSymmetryClass(Atom &atom)
Removes the Chem::AtomProperty::SYMMETRY_CLASS property from atom.
CDPL_CHEM_API void clearMatchExpression(Atom &atom)
Removes the Chem::AtomProperty::MATCH_EXPRESSION property from atom.
CDPL_CHEM_API bool hasSymbol(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::SYMBOL property.
CDPL_CHEM_API void getContainingFragments(const Atom &atom, const FragmentList &frag_list, FragmentList &cont_frag_list, bool append=false)
Collects the fragments in frag_list that contain atom into cont_frag_list.
CDPL_CHEM_API bool hasMOL2Charge(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::MOL2_CHARGE property.
CDPL_CHEM_API void setSymbol(Atom &atom, const std::string &symbol)
Sets the Chem::AtomProperty::SYMBOL property of atom to symbol.
CDPL_CHEM_API const std::string & getMOL2SubstructureChain(const Atom &atom)
Returns the Chem::AtomProperty::MOL2_SUBSTRUCTURE_CHAIN property of atom.
std::size_t getIncidentBonds(AtomType &atom, const MolecularGraph &molgraph, OutputIterator it, AtomType *excl_atom=0)
Writes every bond incident to atom (with both endpoints belonging to molgraph) into it,...
Definition: Chem/AtomFunctions.hpp:958
CDPL_CHEM_API bool hasHybridizationState(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::HYBRIDIZATION property.
CDPL_CHEM_API const MatchConstraintList::SharedPointer & getMatchConstraints(const Atom &atom)
Returns the Chem::AtomProperty::MATCH_CONSTRAINTS property of atom.
CDPL_CHEM_API void setRadicalType(Atom &atom, unsigned int type)
Sets the Chem::AtomProperty::RADICAL_TYPE property of atom to type (see namespace Chem::RadicalType).
CDPL_CHEM_API bool hasMOL2SubstructureName(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::MOL2_SUBSTRUCTURE_NAME property.
CDPL_CHEM_API bool getRingFlag(const Atom &atom)
Returns the Chem::AtomProperty::RING_FLAG property of atom.
CDPL_CHEM_API const Math::Vector3DArray::SharedPointer & get3DCoordinatesArray(const Atom &atom)
Returns the Chem::AtomProperty::COORDINATES_3D_ARRAY property of atom.
CDPL_CHEM_API unsigned int calcConfiguration(const Atom &atom, const MolecularGraph &molgraph, const StereoDescriptor &descr, const Math::Vector3DArray &coords)
Derives the atom configuration label from the supplied descriptor and 3D coordinates.
CDPL_CHEM_API void clearMOL2SubstructureChain(Atom &atom)
Removes the Chem::AtomProperty::MOL2_SUBSTRUCTURE_CHAIN property from atom.
CDPL_CHEM_API bool hasReactionCenterStatus(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::REACTION_CENTER_STATUS property.
CDPL_CHEM_API bool hasCanonicalNumber(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::CANONICAL_NUMBER property.
CDPL_CHEM_API bool hasName(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::NAME property.
CDPL_CHEM_API std::size_t getMorganNumber(const Atom &atom)
Returns the Chem::AtomProperty::MORGAN_NUMBER property of atom.
CDPL_CHEM_API void setSybylType(Atom &atom, unsigned int type)
Sets the Chem::AtomProperty::SYBYL_TYPE property of atom to type (see namespace Chem::SybylAtomType).
CDPL_CHEM_API void setMDLParity(Atom &atom, unsigned int parity)
Sets the Chem::AtomProperty::MDL_PARITY property of atom to parity (see namespace Chem::MDLParity).
CDPL_CHEM_API void clearStereoCenterFlag(Atom &atom)
Removes the Chem::AtomProperty::STEREO_CENTER_FLAG property from atom.
CDPL_CHEM_API void clearMOL2Name(Atom &atom)
Removes the Chem::AtomProperty::MOL2_NAME property from atom.
CDPL_CHEM_API void clearReactionCenterStatus(Atom &atom)
Removes the Chem::AtomProperty::REACTION_CENTER_STATUS property from atom.
CDPL_CHEM_API const std::string & getName(const Atom &atom)
Returns the Chem::AtomProperty::NAME property of atom.
CDPL_CHEM_API void clearCIPConfiguration(Atom &atom)
Removes the Chem::AtomProperty::CIP_CONFIGURATION property from atom.
CDPL_CHEM_API std::size_t getNumContainingFragments(const Atom &atom, const FragmentList &frag_list)
Returns the number of fragments in frag_list that contain atom.
CDPL_CHEM_API bool hasMDLStereoCareFlag(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::MDL_DB_STEREO_CARE_FLAG property.
CDPL_CHEM_API void get2DCoordinates(const AtomContainer &cntnr, Math::Vector2DArray &coords, bool append=false)
Extracts the 2D coordinates of all atoms in cntnr into coords.
CDPL_CHEM_API std::size_t getCIPPriority(const Atom &atom)
Returns the Chem::AtomProperty::CIP_PRIORITY property of atom.
CDPL_CHEM_API bool hasMOL2SubstructureSubtype(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::MOL2_SUBSTRUCTURE_SUBTYPE property.
CDPL_CHEM_API void setMatchExpression(Atom &atom, const MatchExpression< Atom, MolecularGraph >::SharedPointer &expr)
Sets the Chem::AtomProperty::MATCH_EXPRESSION property of atom to expr.
CDPL_CHEM_API bool hasStereoCenterFlag(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::STEREO_CENTER_FLAG property.
CDPL_CHEM_API void clearType(Atom &atom)
Removes the Chem::AtomProperty::TYPE property from atom.
CDPL_CHEM_API bool has3DCoordinatesArray(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::COORDINATES_3D_ARRAY property.
CDPL_CHEM_API void setMOL2Charge(Atom &atom, double charge)
Sets the Chem::AtomProperty::MOL2_CHARGE property of atom to charge.
CDPL_CHEM_API void clear3DCoordinatesArray(Atom &atom)
Removes the Chem::AtomProperty::COORDINATES_3D_ARRAY property from atom.
CDPL_CHEM_API bool hasAtomMappingID(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::ATOM_MAPPING_ID property.
CDPL_CHEM_API void setMOL2SubstructureID(Atom &atom, std::size_t id)
Sets the Chem::AtomProperty::MOL2_SUBSTRUCTURE_ID property of atom to id.
CDPL_CHEM_API void clearMorganNumber(Atom &atom)
Removes the Chem::AtomProperty::MORGAN_NUMBER property from atom.
CDPL_CHEM_API unsigned int perceiveSybylType(const Atom &atom, const MolecularGraph &molgraph)
Derives the Sybyl atom type of atom from its valence environment in molgraph.
CDPL_CHEM_API void setMOL2SubstructureName(Atom &atom, const std::string &id)
Sets the Chem::AtomProperty::MOL2_SUBSTRUCTURE_NAME property of atom to id.
CDPL_CHEM_API void clearStereoDescriptor(Atom &atom)
Removes the Chem::AtomProperty::STEREO_DESCRIPTOR property from atom.
CDPL_CHEM_API void setHybridizationState(Atom &atom, unsigned int state)
Sets the Chem::AtomProperty::HYBRIDIZATION property of atom to state (see namespace Chem::Hybridizati...
CDPL_CHEM_API unsigned int getSybylType(const Atom &atom)
Returns the Chem::AtomProperty::SYBYL_TYPE property of atom (see namespace Chem::SybylAtomType).
CDPL_CHEM_API void setMorganNumber(Atom &atom, std::size_t num)
Sets the Chem::AtomProperty::MORGAN_NUMBER property of atom to num.
CDPL_CHEM_API std::size_t calcImplicitHydrogenCount(const Atom &atom, const MolecularGraph &molgraph)
Computes the implicit hydrogen count of atom from its valence environment in molgraph.
CDPL_CHEM_API void clearMDLParity(Atom &atom)
Removes the Chem::AtomProperty::MDL_PARITY property from atom.
CDPL_CHEM_API bool hasCIPConfiguration(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::CIP_CONFIGURATION property.
CDPL_CHEM_API std::size_t getSizeOfLargestContainingFragment(const Atom &atom, const FragmentList &frag_list)
Returns the size (in atoms) of the largest fragment in frag_list that contains atom.
CDPL_CHEM_API MatchExpression< Atom, MolecularGraph >::SharedPointer generateMatchExpression(const Atom &atom, const MolecularGraph &molgraph)
Builds an atom-level match expression from the match-constraint list attached to atom.
CDPL_CHEM_API const MatchExpression< Atom, MolecularGraph >::SharedPointer & getMatchExpression(const Atom &atom)
Returns the Chem::AtomProperty::MATCH_EXPRESSION property of atom.
CDPL_CHEM_API std::size_t getComponentGroupID(const Atom &atom)
Returns the Chem::AtomProperty::COMPONENT_GROUP_ID property of atom.
CDPL_CHEM_API void setAromaticityFlag(Atom &atom, bool aromatic)
Sets the Chem::AtomProperty::AROMATICITY_FLAG property of atom to aromatic.
CDPL_CHEM_API void markReachableAtoms(const Atom &atom, const MolecularGraph &molgraph, Util::BitSet &atom_mask, bool reset=true)
Sets bits in atom_mask for every atom of molgraph that is reachable from atom through the bonds of mo...
CDPL_CHEM_API long calcFormalCharge(const Atom &atom, const MolecularGraph &molgraph)
Computes the formal charge of atom from its valence environment in molgraph.
CDPL_CHEM_API unsigned int getMDLParity(const Atom &atom)
Returns the Chem::AtomProperty::MDL_PARITY property of atom (see namespace Chem::MDLParity).
CDPL_CHEM_API void setStereoCenterFlag(Atom &atom, bool is_center)
Sets the Chem::AtomProperty::STEREO_CENTER_FLAG property of atom to is_center.
CDPL_CHEM_API void clearMDLStereoCareFlag(Atom &atom)
Removes the Chem::AtomProperty::MDL_DB_STEREO_CARE_FLAG property from atom.
std::size_t getConnectedAtoms(AtomType &atom, const MolecularGraph &molgraph, OutputIterator it, AtomType *excl_atom=0)
Writes every neighbor of atom (with bonds belonging to molgraph) into it, skipping excl_atom.
Definition: Chem/AtomFunctions.hpp:925
CDPL_CHEM_API void setMDLStereoCareFlag(Atom &atom, bool flag)
Sets the Chem::AtomProperty::MDL_DB_STEREO_CARE_FLAG property of atom to flag.
CDPL_CHEM_API void setCIPConfiguration(Atom &atom, unsigned int config)
Sets the Chem::AtomProperty::CIP_CONFIGURATION property of atom to config (see namespace Chem::CIPDes...
CDPL_CHEM_API void clearMOL2Charge(Atom &atom)
Removes the Chem::AtomProperty::MOL2_CHARGE property from atom.
CDPL_CHEM_API StereoDescriptor calcStereoDescriptor(const Atom &atom, const MolecularGraph &molgraph, std::size_t dim=1)
Computes the stereo descriptor for atom based on the geometry of molgraph.
CDPL_CHEM_API void setReactionCenterStatus(Atom &atom, unsigned int status)
Sets the Chem::AtomProperty::REACTION_CENTER_STATUS property of atom to status.
CDPL_CHEM_API const StereoDescriptor & getStereoDescriptor(const Atom &atom)
Returns the Chem::AtomProperty::STEREO_DESCRIPTOR property of atom.
CDPL_CHEM_API void clearCanonicalNumber(Atom &atom)
Removes the Chem::AtomProperty::CANONICAL_NUMBER property from atom.
CDPL_CHEM_API void generateMatchExpressionString(const Atom &atom, const MolecularGraph &molgraph, std::string &expr_str)
Writes a textual representation of the atom-level match expression of atom into expr_str.
CDPL_CHEM_API unsigned int getRadicalType(const Atom &atom)
Returns the Chem::AtomProperty::RADICAL_TYPE property of atom (see namespace Chem::RadicalType).
CDPL_CHEM_API const std::string & getMOL2SubstructureName(const Atom &atom)
Returns the Chem::AtomProperty::MOL2_SUBSTRUCTURE_NAME property of atom.
CDPL_CHEM_API void clearMOL2SubstructureID(Atom &atom)
Removes the Chem::AtomProperty::MOL2_SUBSTRUCTURE_ID property from atom.
CDPL_CHEM_API void clearAromaticityFlag(Atom &atom)
Removes the Chem::AtomProperty::AROMATICITY_FLAG property from atom.
CDPL_CHEM_API void clearRadicalType(Atom &atom)
Removes the Chem::AtomProperty::RADICAL_TYPE property from atom.
CDPL_CHEM_API void setUnpairedElectronCount(Atom &atom, std::size_t count)
Sets the Chem::AtomProperty::UNPAIRED_ELECTRON_COUNT property of atom to count.
CDPL_CHEM_API bool isStereoCenter(const Atom &atom, const MolecularGraph &molgraph, bool check_asym=true, bool check_inv_n=true, bool check_quart_n=true, bool check_plan_n=true, bool check_amide_n=true, bool check_res_ctrs=true)
Tells whether atom qualifies as a stereo center in the context of molgraph.
CDPL_CHEM_API bool hasMOL2Name(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::MOL2_NAME property.
CDPL_CHEM_API void setAtomMappingID(Atom &atom, std::size_t id)
Sets the Chem::AtomProperty::ATOM_MAPPING_ID property of atom to id.
CDPL_CHEM_API StereoDescriptor calcStereoDescriptorFromMDLParity(const Atom &atom, const MolecularGraph &molgraph)
Derives the stereo descriptor of atom from its MDL parity in molgraph.
CDPL_CHEM_API void clearSybylType(Atom &atom)
Removes the Chem::AtomProperty::SYBYL_TYPE property from atom.
CDPL_CHEM_API void setIsotope(Atom &atom, std::size_t isotope)
Sets the Chem::AtomProperty::ISOTOPE property of atom to isotope.
CDPL_CHEM_API void setCIPPriority(Atom &atom, std::size_t priority)
Sets the Chem::AtomProperty::CIP_PRIORITY property of atom to priority.
CDPL_CHEM_API void setMatchConstraints(Atom &atom, const MatchConstraintList::SharedPointer &constr)
Sets the Chem::AtomProperty::MATCH_CONSTRAINTS property of atom to constr.
CDPL_CHEM_API unsigned int getType(const Atom &atom)
Returns the Chem::AtomProperty::TYPE property of atom (see namespace Chem::AtomType).
CDPL_CHEM_API bool has2DCoordinates(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::COORDINATES_2D property.
CDPL_CHEM_API std::size_t getImplicitHydrogenCount(const Atom &atom)
Returns the Chem::AtomProperty::IMPLICIT_HYDROGEN_COUNT property of atom.
CDPL_CHEM_API const std::string & getMOL2SubstructureSubtype(const Atom &atom)
Returns the Chem::AtomProperty::MOL2_SUBSTRUCTURE_SUBTYPE property of atom.
CDPL_CHEM_API void clearAtomMappingID(Atom &atom)
Removes the Chem::AtomProperty::ATOM_MAPPING_ID property from atom.
CDPL_CHEM_API bool hasMorganNumber(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::MORGAN_NUMBER property.
CDPL_CHEM_API void clearIsotope(Atom &atom)
Removes the Chem::AtomProperty::ISOTOPE property from atom.
CDPL_CHEM_API void setStereoDescriptor(Atom &atom, const StereoDescriptor &descr)
Sets the Chem::AtomProperty::STEREO_DESCRIPTOR property of atom to descr.
CDPL_CHEM_API const std::string & getMatchExpressionString(const Atom &atom)
Returns the Chem::AtomProperty::MATCH_EXPRESSION_STRING property of atom.
CDPL_CHEM_API bool hasMatchExpressionString(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::MATCH_EXPRESSION_STRING property.
CDPL_CHEM_API const Math::Vector3D & getConformer3DCoordinates(const Atom &atom, std::size_t conf_idx)
Returns the 3D coordinates of atom for conformer conf_idx (from the Chem::AtomProperty::COORDINATES_3...
CDPL_CHEM_API void clearSymbol(Atom &atom)
Removes the Chem::AtomProperty::SYMBOL property from atom.
CDPL_CHEM_API void clearHybridizationState(Atom &atom)
Removes the Chem::AtomProperty::HYBRIDIZATION property from atom.
CDPL_CHEM_API bool hasRingFlag(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::RING_FLAG property.
CDPL_CHEM_API bool hasComponentGroupID(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::COMPONENT_GROUP_ID property.
CDPL_CHEM_API std::size_t getUnpairedElectronCount(const Atom &atom)
Returns the Chem::AtomProperty::UNPAIRED_ELECTRON_COUNT property of atom.
CDPL_CHEM_API bool hasMatchExpression(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::MATCH_EXPRESSION property.
CDPL_CHEM_API std::size_t getCanonicalNumber(const Atom &atom)
Returns the Chem::AtomProperty::CANONICAL_NUMBER property of atom.
CDPL_CHEM_API void clearUnpairedElectronCount(Atom &atom)
Removes the Chem::AtomProperty::UNPAIRED_ELECTRON_COUNT property from atom.
CDPL_CHEM_API bool hasType(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::TYPE property.
CDPL_CHEM_API bool hasMOL2SubstructureID(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::MOL2_SUBSTRUCTURE_ID property.
CDPL_CHEM_API unsigned int getHybridizationState(const Atom &atom)
Returns the Chem::AtomProperty::HYBRIDIZATION property of atom (see namespace Chem::HybridizationStat...
CDPL_CHEM_API void setMOL2SubstructureChain(Atom &atom, const std::string &chain)
Sets the Chem::AtomProperty::MOL2_SUBSTRUCTURE_CHAIN property of atom to chain.
CDPL_CHEM_API bool hasStereoDescriptor(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::STEREO_DESCRIPTOR property.
CDPL_CHEM_API void clearMOL2SubstructureSubtype(Atom &atom)
Removes the Chem::AtomProperty::MOL2_SUBSTRUCTURE_SUBTYPE property from atom.
CDPL_CHEM_API void clearName(Atom &atom)
Removes the Chem::AtomProperty::NAME property from atom.
CDPL_CHEM_API void setSymmetryClass(Atom &atom, std::size_t class_id)
Sets the Chem::AtomProperty::SYMMETRY_CLASS property of atom to class_id.
CDPL_CHEM_API void set3DCoordinatesArray(Atom &atom, const Math::Vector3DArray::SharedPointer &coords_array)
Sets the Chem::AtomProperty::COORDINATES_3D_ARRAY property of atom to coords_array.
CDPL_CHEM_API const std::string & getSymbol(const Atom &atom)
Returns the Chem::AtomProperty::SYMBOL property of atom.
CDPL_CHEM_API bool hasRadicalType(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::RADICAL_TYPE property.
CDPL_CHEM_API void set2DCoordinates(AtomContainer &cntnr, const Math::Vector2DArray &coords)
Writes the 2D coordinates in coords back to the corresponding atoms of cntnr.
CDPL_CHEM_API void clearComponentGroupID(Atom &atom)
Removes the Chem::AtomProperty::COMPONENT_GROUP_ID property from atom.
CDPL_CHEM_API void setMOL2SubstructureSubtype(Atom &atom, const std::string &subtype)
Sets the Chem::AtomProperty::MOL2_SUBSTRUCTURE_SUBTYPE property of atom to subtype.
CDPL_CHEM_API void clearMatchConstraints(Atom &atom)
Removes the Chem::AtomProperty::MATCH_CONSTRAINTS property from atom.
CDPL_CHEM_API unsigned int getGenericType(const Atom &atom)
Returns the generic atom type (e.g. A, Q, X, ...) that the atom's Chem::AtomProperty::TYPE belongs to...
CDPL_CHEM_API bool hasMatchConstraints(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::MATCH_CONSTRAINTS property.
CDPL_CHEM_API bool hasUnpairedElectronCount(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::UNPAIRED_ELECTRON_COUNT property.
CDPL_CHEM_API unsigned int perceiveHybridizationState(const Atom &atom, const MolecularGraph &molgraph)
Derives the hybridization state of atom from its valence environment in molgraph.
CDPL_CHEM_API void setImplicitHydrogenCount(Atom &atom, std::size_t count)
Sets the Chem::AtomProperty::IMPLICIT_HYDROGEN_COUNT property of atom to count.
CDPL_CHEM_API bool getStereoCenterFlag(const Atom &atom)
Returns the Chem::AtomProperty::STEREO_CENTER_FLAG property of atom.
CDPL_CHEM_API bool getMDLStereoCareFlag(const Atom &atom)
Returns the Chem::AtomProperty::MDL_DB_STEREO_CARE_FLAG property of atom.
CDPL_CHEM_API double getMOL2Charge(const Atom &atom)
Returns the Chem::AtomProperty::MOL2_CHARGE property of atom.
CDPL_CHEM_API bool hasAromaticityFlag(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::AROMATICITY_FLAG property.
CDPL_CHEM_API unsigned int getReactionCenterStatus(const Atom &atom)
Returns the Chem::AtomProperty::REACTION_CENTER_STATUS property of atom (see namespace Chem::Reaction...
CDPL_CHEM_API void setMatchExpressionString(Atom &atom, const std::string &expr_str)
Sets the Chem::AtomProperty::MATCH_EXPRESSION_STRING property of atom to expr_str.
CDPL_CHEM_API std::size_t getMOL2SubstructureID(const Atom &atom)
Returns the Chem::AtomProperty::MOL2_SUBSTRUCTURE_ID property of atom.
CDPL_CHEM_API void clearImplicitHydrogenCount(Atom &atom)
Removes the Chem::AtomProperty::IMPLICIT_HYDROGEN_COUNT property from atom.
CDPL_CHEM_API bool isInFragmentOfSize(const Atom &atom, const FragmentList &frag_list, std::size_t size)
Tells whether atom is a member of any fragment in frag_list whose size matches size.
CDPL_CHEM_API void setComponentGroupID(Atom &atom, std::size_t id)
Sets the Chem::AtomProperty::COMPONENT_GROUP_ID property of atom to id.
CDPL_CHEM_API void setFormalCharge(Atom &atom, long charge)
Sets the Chem::AtomProperty::FORMAL_CHARGE property of atom to charge.
CDPL_CHEM_API void setType(Atom &atom, unsigned int type)
Sets the Chem::AtomProperty::TYPE property of atom to type (see namespace Chem::AtomType).
CDPL_CHEM_API unsigned int calcMDLParity(const Atom &atom, const MolecularGraph &molgraph)
Computes the MDL parity of atom from its 2D layout and stereo flags in molgraph.
CDPL_CHEM_API void clearCIPPriority(Atom &atom)
Removes the Chem::AtomProperty::CIP_PRIORITY property from atom.
CDPL_CHEM_API std::size_t getAtomMappingID(const Atom &atom)
Returns the Chem::AtomProperty::ATOM_MAPPING_ID property of atom.
CDPL_CHEM_API const std::string & getSymbolForType(const Atom &atom)
Returns the element symbol that corresponds to the Chem::AtomProperty::TYPE of atom.
CDPL_CHEM_API void clearMatchExpressionString(Atom &atom)
Removes the Chem::AtomProperty::MATCH_EXPRESSION_STRING property from atom.
CDPL_CHEM_API void clearMOL2SubstructureName(Atom &atom)
Removes the Chem::AtomProperty::MOL2_SUBSTRUCTURE_NAME property from atom.
CDPL_CHEM_API std::size_t getIsotope(const Atom &atom)
Returns the Chem::AtomProperty::ISOTOPE property of atom.
CDPL_CHEM_API bool hasSybylType(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::SYBYL_TYPE property.
CDPL_CHEM_API void setMOL2Name(Atom &atom, const std::string &name)
Sets the Chem::AtomProperty::MOL2_NAME property of atom to name.
CDPL_CHEM_API std::size_t getTopologicalDistance(const Atom &atom1, const Atom &atom2, const MolecularGraph &molgraph)
Returns the topological distance (number of edges along the shortest path) between two atoms of molgr...
CDPL_CHEM_API bool hasImplicitHydrogenCount(const Atom &atom)
Tells whether atom carries the Chem::AtomProperty::IMPLICIT_HYDROGEN_COUNT property.
CDPL_CHEM_API unsigned int getCIPConfiguration(const Atom &atom)
Returns the Chem::AtomProperty::CIP_CONFIGURATION property of atom (see namespace Chem::CIPDescriptor...
CDPL_CHEM_API const std::string & getMOL2Name(const Atom &atom)
Returns the Chem::AtomProperty::MOL2_NAME property of atom.
CDPL_CHEM_API void setName(Atom &atom, const std::string &name)
Sets the Chem::AtomProperty::NAME property of atom to name.
VectorArray< Vector3D > Vector3DArray
Array storing vectors of type Math::Vector3D.
Definition: VectorArray.hpp:85
CVector< double, 2 > Vector2D
Bounded 2 element vector holding floating point values of type double.
Definition: Vector.hpp:2932
CVector< double, 3 > Vector3D
Bounded 3 element vector holding floating point values of type double.
Definition: Vector.hpp:2937
boost::dynamic_bitset BitSet
Dynamic bitset class.
Definition: BitSet.hpp:46
The namespace of the Chemical Data Processing Library.