RDKit
Open-source cheminformatics and machine learning.
Fragment.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2018 Susan H. Leung
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_FRAGMENT_REMOVER_H__
12 #define __RD_FRAGMENT_REMOVER_H__
13 
14 #include <Catalogs/Catalog.h>
18 
19 namespace RDKit {
20 class ROMol;
21 
22 namespace MolStandardize {
23 
24 RDKIT_MOLSTANDARDIZE_EXPORT extern const CleanupParameters
26 
28  int>
30 
32  public:
34  FragmentRemover(const std::string fragmentFile, const bool leave_last);
35  // FragmentRemover(bool leave_last) : LEAVE_LAST(leave_last){};
36  //! making FragmentRemover objects non-copyable
37  FragmentRemover(const FragmentRemover &other) = delete;
38  FragmentRemover &operator=(FragmentRemover const &) = delete;
39  ~FragmentRemover();
40 
41  ROMol *remove(const ROMol &mol);
42 
43  private:
44  // Setting leave_last to True will ensure at least one fragment
45  // is left in the molecule, even if it is matched by a
46  // FragmentPattern
47  bool LEAVE_LAST;
48  FragmentCatalog *d_fcat;
49 
50 }; // class FragmentRemover
51 
53  public:
54  // LargestFragmentChooser(){};
55  LargestFragmentChooser(bool prefer_organic = false)
56  : PREFER_ORGANIC(prefer_organic){};
59 
60  ROMol *choose(const ROMol &mol);
61  struct Largest {
62  Largest();
63  Largest(std::string &smiles, const boost::shared_ptr<ROMol> &fragment,
64  unsigned int &numatoms, double &weight, bool &organic);
65  std::string Smiles;
66  boost::shared_ptr<ROMol> Fragment;
67  unsigned int NumAtoms;
68  double Weight;
69  bool Organic;
70  };
71 
72  private:
73  bool PREFER_ORGANIC;
74 }; // class LargestFragmentChooser
75 } // namespace MolStandardize
76 } // namespace RDKit
77 
78 #endif
RDKIT_MOLSTANDARDIZE_EXPORT const CleanupParameters defaultCleanupParameters
Definition: Fragment.h:25
A Catalog with a hierarchical structure.
Definition: Catalog.h:135
Std stuff.
Definition: Atom.h:30
LargestFragmentChooser(bool prefer_organic=false)
Definition: Fragment.h:55
Defines the CleanupParameters and some convenience functions.
RDCatalog::HierarchCatalog< FragmentCatalogEntry, FragmentCatalogParams, int > FragmentCatalog
Definition: Fragment.h:29
#define RDKIT_MOLSTANDARDIZE_EXPORT
Definition: export.h:424