File: FragCatParams.h

package info (click to toggle)
rdkit 201809.1%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 123,688 kB
  • sloc: cpp: 230,509; python: 70,501; java: 6,329; ansic: 5,427; sql: 1,899; yacc: 1,739; lex: 1,243; makefile: 445; xml: 229; fortran: 183; sh: 123; cs: 93
file content (92 lines) | stat: -rw-r--r-- 3,024 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//
//  Copyright (C) 2003-2006 Rational Discovery LLC
//
//   @@ All Rights Reserved @@
//  This file is part of the RDKit.
//  The contents are covered by the terms of the BSD license
//  which is included in the file license.txt, found at the root
//  of the RDKit source tree.
//
#include <RDGeneral/export.h>
#ifndef _RD_FRAG_CAT_PARAMS_H_
#define _RD_FRAG_CAT_PARAMS_H_

#include <Catalogs/CatalogParams.h>
#include <string>
#include <vector>
#include <boost/shared_ptr.hpp>

namespace RDKit {
class ROMol;
typedef std::vector<boost::shared_ptr<ROMol> > MOL_SPTR_VECT;

//! container for user parameters used to create a fragment catalog
class RDKIT_FRAGCATALOG_EXPORT FragCatParams : public RDCatalog::CatalogParams {
  // FIX: this container is still missing all the CASE-type functional groups
  // stuff
 public:
  FragCatParams() {
    d_typeStr = "Fragment Catalog Parameters";
    d_lowerFragLen = 0;
    d_upperFragLen = 0;
    d_tolerance = 1e-8;
    d_funcGroups.clear();
  }
  //! construct from a function-group file
  /*!
    \param lLen       the lower limit on fragment size
    \param uLen       the upper limit on fragment size
    \param fgroupFile the name of the function-group file
    \param tol        (optional) the eigenvalue tolerance to be used
                      when comparing fragments
  */
  FragCatParams(unsigned int lLen, unsigned int uLen,
                const std::string &fgroupFile, double tol = 1e-08);
  //! copy constructor
  FragCatParams(const FragCatParams &other);
  //! construct from a pickle string (serialized representation)
  FragCatParams(const std::string &pickle);

  ~FragCatParams();

  //! returns our lower fragment length
  unsigned int getLowerFragLength() const { return d_lowerFragLen; }
  //! sets our lower fragment length
  void setLowerFragLength(unsigned int lFrLen) { d_lowerFragLen = lFrLen; }

  //! returns our upper fragment length
  unsigned int getUpperFragLength() const { return d_upperFragLen; }
  //! sets our upper fragment length
  void setUpperFragLength(unsigned int uFrLen) { d_upperFragLen = uFrLen; }

  //! returns our fragment-comparison tolerance
  double getTolerance() const { return d_tolerance; }
  //! sets our fragment-comparison tolerance
  void setTolerance(double val) { d_tolerance = val; }

  //! returns our number of functional groups
  unsigned int getNumFuncGroups() const { return static_cast<unsigned int>(d_funcGroups.size()); }

  //! returns our std::vector of functional groups
  const MOL_SPTR_VECT &getFuncGroups() const;

  //! returns a pointer to a specific functional group
  const ROMol *getFuncGroup(unsigned int fid) const;

  void toStream(std::ostream &) const;
  std::string Serialize() const;
  void initFromStream(std::istream &ss);
  void initFromString(const std::string &text);

 private:
  unsigned int d_lowerFragLen;
  unsigned int d_upperFragLen;

  double d_tolerance;  //!< tolerance value used when comparing subgraph
  // discriminators

  MOL_SPTR_VECT d_funcGroups;
};
}

#endif