Chemical Data Processing Library C++ API - Version 1.4.0
FragmentLibraryGenerator.hpp
Go to the documentation of this file.
1 /*
2  * FragmentLibraryGenerator.hpp
3  *
4  * This file is part of the ConfGenical 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_FRAGMENTLIBRARYGENERATOR_HPP
30 #define CDPL_CONFGEN_FRAGMENTLIBRARYGENERATOR_HPP
31 
32 #include <sstream>
33 
39 
40 
41 namespace CDPL
42 {
43 
44  namespace ConfGen
45  {
46 
57  {
58 
59  public:
64 
70 
72 
74 
80 
86 
92 
98 
104 
110 
116 
122 
128 
134 
141  unsigned int process(const Chem::MolecularGraph& frag, const Chem::MolecularGraph& parent);
142 
147  std::size_t getNumGeneratedConformers() const;
148 
153  std::uint64_t getLibraryEntryHashCode() const;
154 
155  private:
156  FragmentLibraryEntry::SharedPointer addNewLibraryEntry(const Chem::MolecularGraph& frag, const Chem::MolecularGraph& parent);
157 
158  void removeNewLibraryEntry() const;
159 
160  void init();
161 
163  CanonicalFragment canonFrag;
164  FragmentConformerGenerator fragConfGen;
165  std::ostringstream smilesStream;
167  std::size_t numGenConfs;
168  };
169  } // namespace ConfGen
170 } // namespace CDPL
171 
172 #endif // CDPL_CONFGEN_FRAGMENTLIBRARYGENERATOR_HPP
Definition of class CDPL::ConfGen::CanonicalFragment.
Definition of the preprocessor macro CDPL_CONFGEN_API.
#define CDPL_CONFGEN_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of class CDPL::ConfGen::FragmentConformerGenerator.
Definition of class CDPL::ConfGen::FragmentLibrary.
Definition of class CDPL::Chem::SMILESMolecularGraphWriter.
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
Writer for molecular graph data in the Daylight SMILES [SMILES] format.
Definition: SMILESMolecularGraphWriter.hpp:130
Data structure representing a canonicalized molecular fragment.
Definition: CanonicalFragment.hpp:61
Bundle of configuration parameters for fragment conformer ensemble generation via class ConfGen::Frag...
Definition: FragmentConformerGeneratorSettings.hpp:48
Driver for the generation of low-energy conformer ensembles for single molecular fragments (chain,...
Definition: FragmentConformerGenerator.hpp:67
std::shared_ptr< FragmentLibraryEntry > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated FragmentLibraryEntry instances.
Definition: FragmentLibraryEntry.hpp:62
Driver for populating a ConfGen::FragmentLibrary with conformers of canonicalized molecular fragments...
Definition: FragmentLibraryGenerator.hpp:57
unsigned int process(const Chem::MolecularGraph &frag, const Chem::MolecularGraph &parent)
Adds a library entry for the fragment frag of the parent molecular graph parent.
FragmentLibraryGenerator()
Constructs the FragmentLibraryGenerator instance without an associated fragment library.
const FragmentLibrary::SharedPointer & getFragmentLibrary() const
Returns the currently associated fragment library.
const CallbackFunction & getTimeoutCallback() const
Returns the currently configured timeout-check callback.
const LogMessageCallbackFunction & getLogMessageCallback() const
Returns the currently configured log-message callback.
FragmentLibraryGenerator(const FragmentLibraryGenerator &)=delete
std::uint64_t getLibraryEntryHashCode() const
Returns the hash code of the library entry created during the last process() call.
const FragmentConformerGeneratorSettings & getSettings() const
Returns a const reference to the fragment conformer generation settings.
void setFragmentLibrary(const FragmentLibrary::SharedPointer &lib)
Sets the fragment library to populate.
const CallbackFunction & getAbortCallback() const
Returns the currently configured abort-check callback.
FragmentConformerGeneratorSettings & getSettings()
Returns a reference to the fragment conformer generation settings.
FragmentLibraryGenerator & operator=(const FragmentLibraryGenerator &)=delete
std::size_t getNumGeneratedConformers() const
Returns the number of conformers generated during the last process() call.
FragmentLibraryGenerator(const FragmentLibrary::SharedPointer &lib)
Constructs the FragmentLibraryGenerator instance and associates it with lib.
void setAbortCallback(const CallbackFunction &func)
Sets the callback invoked periodically to allow conformer generation to be aborted.
void setLogMessageCallback(const LogMessageCallbackFunction &func)
Sets the callback that receives log messages produced during fragment processing.
void setTimeoutCallback(const CallbackFunction &func)
Sets the callback invoked periodically to check whether the configured timeout has elapsed.
std::shared_ptr< FragmentLibrary > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated FragmentLibrary instances.
Definition: FragmentLibrary.hpp:68
std::function< void(const std::string &)> LogMessageCallbackFunction
Generic wrapper for storing user-defined log message callback functions (see [FUNWRP]).
Definition: LogMessageCallbackFunction.hpp:48
std::function< bool()> CallbackFunction
Generic wrapper for storing user-defined callback functions returning a bool status flag (see [FUNWRP...
Definition: CallbackFunction.hpp:47
The namespace of the Chemical Data Processing Library.