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 
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 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, std::string fgroupFile, double tol=1e-08);
43  //! copy constructor
44  FragCatParams(const FragCatParams &other);
45  //! construct from a pickle string (serialized representation)
46  FragCatParams(const std::string &pickle);
47 
49 
50  //! returns our lower fragment length
51  unsigned int getLowerFragLength() const { return d_lowerFragLen;}
52  //! sets our lower fragment length
53  void setLowerFragLength(unsigned int lFrLen) {d_lowerFragLen = lFrLen;}
54 
55  //! returns our upper fragment length
56  unsigned int getUpperFragLength() const { return d_upperFragLen;}
57  //! sets our upper fragment length
58  void setUpperFragLength(unsigned int uFrLen) { d_upperFragLen = uFrLen;}
59 
60  //! returns our fragment-comparison tolerance
61  double getTolerance() const {return d_tolerance;}
62  //! sets our fragment-comparison tolerance
63  void setTolerance(double val) { d_tolerance = val;}
64 
65  //! returns our number of functional groups
66  unsigned int getNumFuncGroups() const {return d_funcGroups.size();}
67 
68  //! returns our std::vector of functional groups
69  const MOL_SPTR_VECT &getFuncGroups() const;
70 
71  //! returns a pointer to a specific functional group
72  const ROMol *getFuncGroup(unsigned int fid) const;
73 
74  void toStream(std::ostream &) const;
75  std::string Serialize() const;
76  void initFromStream(std::istream &ss);
77  void initFromString(const std::string &text);
78  private:
79  unsigned int d_lowerFragLen;
80  unsigned int d_upperFragLen;
81 
82  double d_tolerance; //!< tolerance value used when comparing subgraph discriminators
83 
84  MOL_SPTR_VECT d_funcGroups;
85  };
86 }
87 
88 #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:56
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:105
std::vector< boost::shared_ptr< ROMol > > MOL_SPTR_VECT
Definition: FragCatParams.h:20
void toStream(std::ostream &) const
serializes (pickles) to a stream
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28
unsigned int getNumFuncGroups() const
returns our number of functional groups
Definition: FragCatParams.h:66
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:61
unsigned int getLowerFragLength() const
returns our lower fragment length
Definition: FragCatParams.h:51
container for user parameters used to create a fragment catalog
Definition: FragCatParams.h:24
void setLowerFragLength(unsigned int lFrLen)
sets our lower fragment length
Definition: FragCatParams.h:53
void setUpperFragLength(unsigned int uFrLen)
sets our upper fragment length
Definition: FragCatParams.h:58
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 initFromString(const std::string &text)
initializes from a string pickle
void setTolerance(double val)
sets our fragment-comparison tolerance
Definition: FragCatParams.h:63