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