RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
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
15#include <string>
16#include <vector>
17#include <boost/shared_ptr.hpp>
18
19namespace RDKit {
20class ROMol;
21typedef 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
47 //! construct from a pickle string (serialized representation)
48 FragCatParams(const std::string &pickle);
49
50 ~FragCatParams() override;
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 {
69 return static_cast<unsigned int>(d_funcGroups.size());
70 }
71
72 //! returns our std::vector of functional groups
74
75 //! returns a pointer to a specific functional group
76 const ROMol *getFuncGroup(unsigned int fid) const;
77
78 void toStream(std::ostream &) const override;
79 std::string Serialize() const override;
80 void initFromStream(std::istream &ss) override;
81 void initFromString(const std::string &text) override;
82
83 private:
84 unsigned int d_lowerFragLen;
85 unsigned int d_upperFragLen;
86
87 double d_tolerance; //!< tolerance value used when comparing subgraph
88 // discriminators
89
90 MOL_SPTR_VECT d_funcGroups;
91};
92} // namespace RDKit
93
94#endif
abstract base class for the container used to create a catalog
container for user parameters used to create a fragment catalog
FragCatParams(const FragCatParams &other)
copy constructor
void setLowerFragLength(unsigned int lFrLen)
sets our lower fragment length
void initFromStream(std::istream &ss) override
initializes from a stream pickle
unsigned int getUpperFragLength() const
returns our upper fragment length
void initFromString(const std::string &text) override
initializes from a string pickle
const ROMol * getFuncGroup(unsigned int fid) const
returns a pointer to a specific functional group
void setUpperFragLength(unsigned int uFrLen)
sets our upper fragment length
double getTolerance() const
returns our fragment-comparison tolerance
void toStream(std::ostream &) const override
serializes (pickles) to a stream
FragCatParams(unsigned int lLen, unsigned int uLen, const std::string &fgroupFile, double tol=1e-08)
construct from a function-group file
unsigned int getNumFuncGroups() const
returns our number of functional groups
FragCatParams(const std::string &pickle)
construct from a pickle string (serialized representation)
const MOL_SPTR_VECT & getFuncGroups() const
returns our std::vector of functional groups
std::string Serialize() const override
returns a string with a serialized (pickled) representation
unsigned int getLowerFragLength() const
returns our lower fragment length
void setTolerance(double val)
sets our fragment-comparison tolerance
~FragCatParams() override
#define RDKIT_FRAGCATALOG_EXPORT
Definition export.h:201
Std stuff.
std::vector< boost::shared_ptr< ROMol > > MOL_SPTR_VECT