RDKit
Open-source cheminformatics and machine learning.
RGroupDecomp.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2017 Novartis Institutes for BioMedical Research
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 RDKIT_RGROUPDECOMP_H
12 #define RDKIT_RGROUPDECOMP_H
13 
14 #include "../RDKitBase.h"
16 
17 namespace RDKit {
18 
19 //! Compute the isomporphic degenerative points in the
20 //! molecule. These are points that are symmetrically
21 //! equivalent.
22 /*!
23  \param mol Molecule to compute the degenerative points
24 
25  \return the set of degenerative points (set<unsigned int>)
26 */
27 
28 typedef enum {
29  IsotopeLabels = 0x01,
30  AtomMapLabels = 0x02,
33  AutoDetect = 0x0F,
34 } RGroupLabels;
35 
36 typedef enum {
37  Greedy = 0x01,
38  GreedyChunks = 0x02,
39  Exhaustive = 0x04, // not really useful for large sets
41 
42 typedef enum {
43  AtomMap = 0x01,
44  Isotope = 0x02,
45  MDLRGroup = 0x04,
47 
48 typedef enum {
49  None = 0x0,
50  MCS = 0x01,
52 
54  unsigned int labels;
55  unsigned int matchingStrategy;
56  unsigned int rgroupLabelling;
57  unsigned int alignment;
58 
59  unsigned int chunkSize;
63 
65  unsigned int strategy = GreedyChunks,
66  unsigned int labelling = AtomMap | MDLRGroup,
67  unsigned int alignment = MCS,
68  unsigned int chunkSize = 5,
69  bool matchOnlyAtRGroups = false,
70  bool removeHydrogenOnlyGroups = true,
71  bool removeHydrogensPostMatch = false)
72  : labels(labels),
73  matchingStrategy(strategy),
74  rgroupLabelling(labelling),
75  alignment(alignment),
76  chunkSize(chunkSize),
77  onlyMatchAtRGroups(matchOnlyAtRGroups),
78  removeAllHydrogenRGroups(removeHydrogenOnlyGroups),
79  removeHydrogensPostMatch(removeHydrogensPostMatch),
80  indexOffset(-1) {}
81  bool prepareCore(RWMol &, const RWMol *alignCore);
82 
83  private:
84  int indexOffset;
85 };
86 
87 typedef std::map<std::string, boost::shared_ptr<ROMol>> RGroupRow;
88 typedef std::vector<boost::shared_ptr<ROMol>> RGroupColumn;
89 
90 typedef std::vector<RGroupRow> RGroupRows;
91 typedef std::map<std::string, RGroupColumn> RGroupColumns;
92 
93 struct RGroupDecompData;
95  RGroupDecompData *data; // implementation details
96  RGroupDecomposition(const RGroupDecomposition &); // no copy construct
97  RGroupDecomposition &operator=(
98  const RGroupDecomposition &); // Prevent assignment
99 
100  public:
101  RGroupDecomposition(const ROMol &core,
102  const RGroupDecompositionParameters &params =
104  RGroupDecomposition(const std::vector<ROMOL_SPTR> &cores,
105  const RGroupDecompositionParameters &params =
107 
109 
110  int add(const ROMol &mol);
111  bool process();
112 
113  //! return rgroups in row order group[row][attachment_point] = ROMol
114  RGroupRows getRGroupsAsRows() const;
115  //! return rgroups in column order group[attachment_point][row] = ROMol
116  RGroupColumns getRGroupsAsColumns() const;
117 };
118 
119 RDKIT_RGROUPDECOMPOSITION_EXPORT unsigned int RGroupDecompose(const std::vector<ROMOL_SPTR> &cores,
120  const std::vector<ROMOL_SPTR> &mols,
121  RGroupRows &rows,
122  std::vector<unsigned int> *unmatched = 0,
123  const RGroupDecompositionParameters &options =
125 
126 RDKIT_RGROUPDECOMPOSITION_EXPORT unsigned int RGroupDecompose(const std::vector<ROMOL_SPTR> &cores,
127  const std::vector<ROMOL_SPTR> &mols,
128  RGroupColumns &columns,
129  std::vector<unsigned int> *unmatched = 0,
130  const RGroupDecompositionParameters &options =
132 }
133 
134 #endif
RGroupMatching
Definition: RGroupDecomp.h:36
RDKIT_RGROUPDECOMPOSITION_EXPORT unsigned int RGroupDecompose(const std::vector< ROMOL_SPTR > &cores, const std::vector< ROMOL_SPTR > &mols, RGroupRows &rows, std::vector< unsigned int > *unmatched=0, const RGroupDecompositionParameters &options=RGroupDecompositionParameters())
RWMol is a molecule class that is intended to be edited.
Definition: RWMol.h:31
std::vector< boost::shared_ptr< ROMol > > RGroupColumn
Definition: RGroupDecomp.h:88
#define RDKIT_RGROUPDECOMPOSITION_EXPORT
Definition: export.h:528
RGroupLabelling
Definition: RGroupDecomp.h:42
Std stuff.
Definition: Atom.h:30
std::vector< RGroupRow > RGroupRows
Definition: RGroupDecomp.h:90
std::map< std::string, boost::shared_ptr< ROMol > > RGroupRow
Definition: RGroupDecomp.h:87
std::map< std::string, RGroupColumn > RGroupColumns
Definition: RGroupDecomp.h:91
RGroupDecompositionParameters(unsigned int labels=AutoDetect, unsigned int strategy=GreedyChunks, unsigned int labelling=AtomMap|MDLRGroup, unsigned int alignment=MCS, unsigned int chunkSize=5, bool matchOnlyAtRGroups=false, bool removeHydrogenOnlyGroups=true, bool removeHydrogensPostMatch=false)
Definition: RGroupDecomp.h:64
RGroupCoreAlignment
Definition: RGroupDecomp.h:48
RGroupLabels
Definition: RGroupDecomp.h:28