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