RDKit
Open-source cheminformatics and machine learning.
FragCatParams.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2003-2006 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 #ifndef _RD_FRAG_CAT_PARAMS_H_
11 #define _RD_FRAG_CAT_PARAMS_H_
12 
13 #include <Catalogs/CatalogParams.h>
14 #include <string>
15 #include <vector>
16 #include <boost/shared_ptr.hpp>
17 
18 namespace RDKit {
19 class ROMol;
20 typedef std::vector<boost::shared_ptr<ROMol> > MOL_SPTR_VECT;
21 
22 //! container for user parameters used to create a fragment catalog
24  // FIX: this container is still missing all the CASE-type functional groups
25  // stuff
26  public:
28  d_typeStr = "Fragment Catalog Parameters";
29  d_lowerFragLen = 0;
30  d_upperFragLen = 0;
31  d_tolerance = 1e-8;
32  d_funcGroups.clear();
33  }
34  //! construct from a function-group file
35  /*!
36  \param lLen the lower limit on fragment size
37  \param uLen the upper limit on fragment size
38  \param fgroupFile the name of the function-group file
39  \param tol (optional) the eigenvalue tolerance to be used
40  when comparing fragments
41  */
42  FragCatParams(unsigned int lLen, unsigned int uLen,
43  const std::string &fgroupFile, double tol = 1e-08);
44  //! copy constructor
45  FragCatParams(const FragCatParams &other);
46  //! construct from a pickle string (serialized representation)
47  FragCatParams(const std::string &pickle);
48 
50 
51  //! returns our lower fragment length
52  unsigned int getLowerFragLength() const { return d_lowerFragLen; }
53  //! sets our lower fragment length
54  void setLowerFragLength(unsigned int lFrLen) { d_lowerFragLen = lFrLen; }
55 
56  //! returns our upper fragment length
57  unsigned int getUpperFragLength() const { return d_upperFragLen; }
58  //! sets our upper fragment length
59  void setUpperFragLength(unsigned int uFrLen) { d_upperFragLen = uFrLen; }
60 
61  //! returns our fragment-comparison tolerance
62  double getTolerance() const { return d_tolerance; }
63  //! sets our fragment-comparison tolerance
64  void setTolerance(double val) { d_tolerance = val; }
65 
66  //! returns our number of functional groups
67  unsigned int getNumFuncGroups() const { return static_cast<unsigned int>(d_funcGroups.size()); }
68 
69  //! returns our std::vector of functional groups
70  const MOL_SPTR_VECT &getFuncGroups() const;
71 
72  //! returns a pointer to a specific functional group
73  const ROMol *getFuncGroup(unsigned int fid) const;
74 
75  void toStream(std::ostream &) const;
76  std::string Serialize() const;
77  void initFromStream(std::istream &ss);
78  void initFromString(const std::string &text);
79 
80  private:
81  unsigned int d_lowerFragLen;
82  unsigned int d_upperFragLen;
83 
84  double d_tolerance; //!< tolerance value used when comparing subgraph
85  // discriminators
86 
87  MOL_SPTR_VECT d_funcGroups;
88 };
89 }
90 
91 #endif
std::string Serialize() const
returns a string with a serialized (pickled) representation
unsigned int getUpperFragLength() const
returns our upper fragment length
Definition: FragCatParams.h:57
std::string d_typeStr
our type string
Definition: CatalogParams.h:37
void initFromStream(std::istream &ss)
initializes from a stream pickle
ROMol is a molecule class that is intended to have a fixed topology.
Definition: ROMol.h:103
std::vector< boost::shared_ptr< ROMol > > MOL_SPTR_VECT
Definition: FragCatParams.h:19
void toStream(std::ostream &) const
serializes (pickles) to a stream
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:29
unsigned int getNumFuncGroups() const
returns our number of functional groups
Definition: FragCatParams.h:67
const ROMol * getFuncGroup(unsigned int fid) const
returns a pointer to a specific functional group
double getTolerance() const
returns our fragment-comparison tolerance
Definition: FragCatParams.h:62
unsigned int getLowerFragLength() const
returns our lower fragment length
Definition: FragCatParams.h:52
container for user parameters used to create a fragment catalog
Definition: FragCatParams.h:23
void setLowerFragLength(unsigned int lFrLen)
sets our lower fragment length
Definition: FragCatParams.h:54
void setUpperFragLength(unsigned int uFrLen)
sets our upper fragment length
Definition: FragCatParams.h:59
const MOL_SPTR_VECT & getFuncGroups() const
returns our std::vector of functional groups
abstract base class for the container used to create a catalog
Definition: CatalogParams.h:17
void pickle(const boost::shared_ptr< EnumerationStrategyBase > &enumerator, std::ostream &ss)
pickles a EnumerationStrategy and adds the results to a stream ss
void initFromString(const std::string &text)
initializes from a string pickle
void setTolerance(double val)
sets our fragment-comparison tolerance
Definition: FragCatParams.h:64