Chemical Data Processing Library C++ API - Version 1.1.1
RMSDConformerSelector.hpp
Go to the documentation of this file.
1 /*
2  * RMSDConformerSelector.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_CONFGEN_RMSDCONFORMERSELECTOR_HPP
30 #define CDPL_CONFGEN_RMSDCONFORMERSELECTOR_HPP
31 
32 #include <vector>
33 #include <cstddef>
34 #include <unordered_map>
35 
38 #include "CDPL/Chem/Fragment.hpp"
41 #include "CDPL/Util/BitSet.hpp"
43 #include "CDPL/Util/ObjectPool.hpp"
46 
47 
48 namespace CDPL
49 {
50 
51  namespace ConfGen
52  {
53 
55  {
56 
57  public:
58  static constexpr std::size_t DEF_MAX_NUM_SYMMETRY_MAPPINGS = 32768;
59 
61 
62  void setMinRMSD(double min_rmsd);
63 
64  double getMinRMSD() const;
65 
67 
69 
70  std::size_t getNumSymmetryMappings() const;
71 
72  void setMaxNumSymmetryMappings(std::size_t max_num);
73 
74  std::size_t getMaxNumSymmetryMappings() const;
75 
76  void setup(const Chem::MolecularGraph& molgraph, const Util::BitSet& atom_mask);
77 
78  void setup(const Chem::MolecularGraph& molgraph, const Util::BitSet& atom_mask,
79  const Util::BitSet& stable_config_atom_mask, const Math::Vector3DArray& coords);
80 
81  bool selected(const Math::Vector3DArray& conf_coords);
82 
83  private:
84  typedef std::vector<std::size_t> IndexArray;
86  typedef VectorArrayCache::SharedObjectPointer VectorArrayPtr;
87 
89 
91 
92  void buildSymMappingSearchMolGraph(const Util::BitSet& atom_mask);
93  void setupSymMappingValidationData(const Util::BitSet& stable_config_atom_mask,
94  const Math::Vector3DArray& conf_coords);
95 
96  bool processSymMapping(const Chem::MolecularGraph& molgraph,
97  const Chem::AtomBondMapping& mapping);
98  bool isValidSymMapping(const Chem::AtomBondMapping& mapping) const;
99 
100  VectorArrayPtr buildCoordsArrayForMapping(const IndexArray& mapping,
101  const Math::Vector3DArray& conf_coords);
102 
103  typedef std::unordered_map<const Chem::Atom*, Chem::StereoDescriptor> AtomStereoDescriptorMap;
104  typedef std::vector<const Chem::Atom*> AtomList;
106  typedef std::vector<IndexArray*> IndexArrayList;
107  typedef std::vector<VectorArrayPtr> VectorArrayList;
109 
110  IndexArrayCache idxArrayCache;
111  VectorArrayCache vecArrayCache;
112  const Chem::MolecularGraph* molGraph;
113  Chem::AutomorphismGroupSearch symMappingSearch;
114  Chem::Fragment symMappingSearchMolGraph;
115  IndexArrayList symMappings;
116  AtomStereoDescriptorMap atomStereoDescrs;
117  AlignmentCalculator alignmentCalc;
118  VectorArrayList confAlignCoords;
119  VectorArrayList selectedConfAlignCoords;
120  AtomList atomNeighbors;
121  double minRMSD;
122  std::size_t maxNumSymMappings;
123  CallbackFunction abortCallback;
124  };
125  } // namespace ConfGen
126 } // namespace CDPL
127 
128 #endif // CDPL_CONFGEN_RMSDCONFORMERSELECTOR_HPP
ObjectStack.hpp
Definition of the class CDPL::Util::ObjectStack.
ObjectPool.hpp
Definition of the class CDPL::Util::ObjectPool.
VectorArrayAlignmentCalculator.hpp
Implementation of the Kabsch algorithm.
VectorArray.hpp
Definition of the class CDPL::Math::VectorArray.
CDPL::ConfGen::RMSDConformerSelector::getAbortCallback
const CallbackFunction & getAbortCallback() const
CDPL::Util::BitSet
boost::dynamic_bitset BitSet
A dynamic bitset class.
Definition: BitSet.hpp:46
CDPL::Chem::Fragment
Fragment.
Definition: Fragment.hpp:52
CDPL::Math::VectorArrayAlignmentCalculator< Math::Vector3DArray >
CDPL::ConfGen::RMSDConformerSelector
Definition: RMSDConformerSelector.hpp:55
VectorArray< Vector3D >
CDPL::Chem::MolecularGraph
MolecularGraph.
Definition: MolecularGraph.hpp:52
BitSet.hpp
Definition of the type CDPL::Util::BitSet.
CDPL::ConfGen::RMSDConformerSelector::setAbortCallback
void setAbortCallback(const CallbackFunction &func)
CDPL::ConfGen::RMSDConformerSelector::setMaxNumSymmetryMappings
void setMaxNumSymmetryMappings(std::size_t max_num)
CDPL::ConfGen::RMSDConformerSelector::RMSDConformerSelector
RMSDConformerSelector()
CDPL::Util::ObjectPool< Math::Vector3DArray >
APIPrefix.hpp
Definition of the preprocessor macro CDPL_CONFGEN_API.
AutomorphismGroupSearch.hpp
Definition of the class CDPL::Chem::AutomorphismGroupSearch.
Fragment.hpp
Definition of the class CDPL::Chem::Fragment.
CDPL_CONFGEN_API
#define CDPL_CONFGEN_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::ConfGen::RMSDConformerSelector::getMaxNumSymmetryMappings
std::size_t getMaxNumSymmetryMappings() const
CDPL::ConfGen::RMSDConformerSelector::getNumSymmetryMappings
std::size_t getNumSymmetryMappings() const
CDPL::ConfGen::RMSDConformerSelector::selected
bool selected(const Math::Vector3DArray &conf_coords)
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::ConfGen::RMSDConformerSelector::setup
void setup(const Chem::MolecularGraph &molgraph, const Util::BitSet &atom_mask, const Util::BitSet &stable_config_atom_mask, const Math::Vector3DArray &coords)
StereoDescriptor.hpp
Definition of the type CDPL::Chem::StereoDescriptor.
CDPL::ConfGen::RMSDConformerSelector::setMinRMSD
void setMinRMSD(double min_rmsd)
CDPL::Chem::AtomBondMapping
A data structure for the common storage of related atom to atom and bond to bond mappings.
Definition: AtomBondMapping.hpp:55
CDPL::ConfGen::RMSDConformerSelector::setup
void setup(const Chem::MolecularGraph &molgraph, const Util::BitSet &atom_mask)
CDPL::Util::ObjectStack< IndexArray >
CDPL::Chem::AutomorphismGroupSearch
AutomorphismGroupSearch.
Definition: AutomorphismGroupSearch.hpp:52
CDPL::ConfGen::CallbackFunction
std::function< bool()> CallbackFunction
A generic wrapper class used to store a user-defined callback functions (see [FUNWRP]).
Definition: CallbackFunction.hpp:44
CallbackFunction.hpp
Type definition of a generic wrapper class for storing user-defined callback functions.
CDPL::ConfGen::RMSDConformerSelector::getMinRMSD
double getMinRMSD() const