RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
RGroupDecompParams.h
Go to the documentation of this file.
1//
2// Copyright (c) 2017-2023, Novartis Institutes for BioMedical Research Inc.
3// and other RDKit contributors
4//
5// @@ All Rights Reserved @@
6// This file is part of the RDKit.
7// The contents are covered by the terms of the BSD license
8// which is included in the file license.txt, found at the root
9// of the RDKit source tree.
10//
11
12#ifndef RDKIT_RGROUPDECOMPPARAMS_H
13#define RDKIT_RGROUPDECOMPPARAMS_H
14
15#include "../RDKitBase.h"
18
19namespace RDKit {
20
22 IsotopeLabels = 0x01,
23 AtomMapLabels = 0x02,
24 AtomIndexLabels = 0x04,
26 MDLRGroupLabels = 0x10,
27 DummyAtomLabels = 0x20, // These are rgroups but will get relabelled
28 AutoDetect = 0xFF
29);
30
32 Greedy = 0x01,
33 GreedyChunks = 0x02,
34 Exhaustive = 0x04, // not really useful for large sets
35 NoSymmetrization = 0x08,
36 GA = 0x10
37);
38
40 RGroupLabelling, unsigned int,
41 AtomMap = 0x01,
42 Isotope = 0x02,
43 MDLRGroup = 0x04
44);
45
47 NoAlignment = 0x0,
48 MCS = 0x01
49);
50
52 Match = 0x1,
54);
55
57 unsigned int labels = RGroupLabels::AutoDetect;
58 unsigned int matchingStrategy = RGroupMatching::GreedyChunks;
59 unsigned int scoreMethod = RGroupScore::Match;
60 unsigned int rgroupLabelling =
61 RGroupLabelling::AtomMap | RGroupLabelling::MDLRGroup;
62 unsigned int alignment = RGroupCoreAlignment::MCS;
63
64 unsigned int chunkSize = 5;
65 //! only allow rgroup decomposition at the specified rgroups
66 bool onlyMatchAtRGroups = false;
67 //! remove all user-defined rgroups that only have hydrogens
68 bool removeAllHydrogenRGroups = true;
69 //! remove all user-defined rgroups that only have hydrogens,
70 //! and also remove the corresponding labels from the core
71 bool removeAllHydrogenRGroupsAndLabels = true;
72 //! remove all hydrogens from the output molecules
73 bool removeHydrogensPostMatch = true;
74 //! allow labelled Rgroups of degree 2 or more
75 bool allowNonTerminalRGroups = false;
76 //! unlabelled core atoms can have multiple rgroups
77 bool allowMultipleRGroupsOnUnlabelled = false;
78 // extended query settings for core matching
79 bool doTautomers = false;
80 bool doEnumeration = false;
81 //! include target molecule (featuring explicit hydrogens where they
82 //! coincide with R groups in the core) into RGD results,
83 //! and set _rgroupTargetAtoms and _rgroupTargetBonds properties
84 //! on R groups and core as vectors of target atom and bond indices
85 //! to enable highlighting for SAR analysis (see
86 //! https://greglandrum.github.io/rdkit-blog/posts/2021-08-07-rgd-and-highlighting.html)
87 bool includeTargetMolInResults = false;
88
89 double timeout = -1.0; ///< timeout in seconds. <=0 indicates no timeout
90
91 // Determine how to assign the rgroup labels from the given core
92 unsigned int autoGetLabels(const RWMol &);
93
94 // Prepare the core for substructure searching and rgroup assignment
95 bool prepareCore(RWMol &, const RWMol *alignCore);
96
97 // Add r groups to unlabelled atoms if allowMultipleRGroupsOnUnlabelled is set
99
100 // Parameters specific to GA
101
102 // GA population size or -1 to use best guess
103 int gaPopulationSize = -1;
104 // GA maximum number of operations or -1 to use best guess
105 int gaMaximumOperations = -1;
106 // GA number of operations permitted without improvement before exiting (-1
107 // for best guess)
108 int gaNumberOperationsWithoutImprovement = -1;
109 // GA random number seed (-1 for default, -2 for random seed)
110 int gaRandomSeed = -1;
111 // Number of runs
112 int gaNumberRuns = 1;
113 // Sequential or parallel runs?
114#ifdef RDK_BUILD_THREADSAFE_SSS
115 bool gaParallelRuns = true;
116#else
117 bool gaParallelRuns = false;
118#endif
119 // Controls the way substructure matching with the core is done
121
122 RGroupDecompositionParameters() { substructmatchParams.useChirality = true; }
123
124 private:
125 int indexOffset{-1};
126 void checkNonTerminal(const Atom &atom) const;
127};
128
129} // namespace RDKit
130
131#endif // RDKIT_RGROUPDECOMPPARAMS_H
#define BETTER_ENUM(Enum, Underlying,...)
Definition BetterEnums.h:17
RWMol is a molecule class that is intended to be edited.
Definition RWMol.h:32
#define RDKIT_RGROUPDECOMPOSITION_EXPORT
Definition export.h:441
Std stuff.
bool rdvalue_is(const RDValue_cast_t)
void addDummyAtomsToUnlabelledCoreAtoms(RWMol &core)
unsigned int autoGetLabels(const RWMol &)
bool prepareCore(RWMol &, const RWMol *alignCore)
SubstructMatchParameters substructmatchParams