Chemical Data Processing Library C++ API - Version 1.4.0
FunctionalGroupList.hpp
Go to the documentation of this file.
1 /*
2  * FunctionalGroupList.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_MOLPROP_FUNCTIONALGROUPLIST_HPP
30 #define CDPL_MOLPROP_FUNCTIONALGROUPLIST_HPP
31 
32 #include <memory>
33 #include <sstream>
34 
40 #include "CDPL/Util/BitSet.hpp"
41 
42 
43 namespace CDPL
44 {
45 
46  namespace MolProp
47  {
48 
54  {
55 
56  public:
58  typedef std::shared_ptr<FunctionalGroupList> SharedPointer;
59 
62 
68 
74 
81 
86  void extract(const Chem::MolecularGraph& molgraph);
87 
88  private:
89  void init();
90 
91  void markAtoms(const Chem::MolecularGraph& molgraph);
92 
93  void combineMarkedAtoms(const Chem::MolecularGraph& molgraph);
94  void combineMarkedAtoms(const Chem::Atom& atom, bool aromatic, const Chem::MolecularGraph& molgraph,
95  Chem::Fragment& func_grp);
96 
97  void generateAndSetName(Chem::Fragment& func_grp, const Chem::MolecularGraph& molgraph);
98 
99  std::size_t getEnvironmentCarbons(const Chem::Atom& atom, const Chem::Fragment& func_grp,
100  const Chem::MolecularGraph& molgraph);
101 
102  void createEnvironmentBonds(std::size_t atom_idx, std::size_t num_bonds, unsigned int atom_type,
103  bool aromatic);
104 
105  const char* getClassName() const
106  {
107  return "FunctionalGroupList";
108  }
109 
110  typedef std::vector<const Chem::Atom*> AtomList;
111 
112  Util::BitSet markedAtoms;
113  std::ostringstream strStream;
115  Chem::ProtonationStateStandardizer chargeStandardizer;
116  Chem::BasicMolecule funcGroupMol;
117  Chem::FragmentList::SharedPointer funcGroupMolComps;
118  AtomList envCarbons;
119  };
120  } // namespace MolProp
121 } // namespace CDPL
122 
123 #endif // CDPL_MOLPROP_FUNCTIONALGROUPLIST_HPP
Definition of class CDPL::Chem::BasicMolecule.
Declaration of type CDPL::Util::BitSet.
Definition of class CDPL::Chem::FragmentList.
Definition of the preprocessor macro CDPL_MOLPROP_API.
#define CDPL_MOLPROP_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of class CDPL::Chem::ProtonationStateStandardizer.
Definition of class CDPL::Chem::SMILESMolecularGraphWriter.
Abstract base class representing a chemical atom and its bonded neighborhood.
Definition: Atom.hpp:57
Concrete Chem::Molecule implementation that owns Chem::BasicAtom and Chem::BasicBond instances.
Definition: BasicMolecule.hpp:60
Data type for the storage of Chem::Fragment objects.
Definition: FragmentList.hpp:49
std::shared_ptr< FragmentList > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated FragmentList instances.
Definition: FragmentList.hpp:53
Concrete Chem::MolecularGraph implementation that stores references to a selectable subset of atoms a...
Definition: Fragment.hpp:57
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
Adjusts the protonation state of a molecule (atom formal charges and bonded hydrogen counts) accordin...
Definition: ProtonationStateStandardizer.hpp:58
Writer for molecular graph data in the Daylight SMILES [SMILES] format.
Definition: SMILESMolecularGraphWriter.hpp:130
Implementation of Ertl's algorithm [FGPE] for the identification of functional groups in organic mole...
Definition: FunctionalGroupList.hpp:54
FunctionalGroupList(const FunctionalGroupList &fg_list)
Constructs a copy of the FunctionalGroupList instance fg_list.
std::shared_ptr< FunctionalGroupList > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated FunctionalGroupList instances.
Definition: FunctionalGroupList.hpp:58
void extract(const Chem::MolecularGraph &molgraph)
Extracts the functional groups of molgraph and stores them as fragments of this list.
FunctionalGroupList(const Chem::MolecularGraph &molgraph)
Constructs a FunctionalGroupList instance and extracts the functional groups of molgraph.
FunctionalGroupList()
Constructs an empty FunctionalGroupList instance.
FunctionalGroupList & operator=(FunctionalGroupList &fg_list)
Replaces the contents of this list with a copy of fg_list.
boost::dynamic_bitset BitSet
Dynamic bitset class.
Definition: BitSet.hpp:46
The namespace of the Chemical Data Processing Library.