RDKit
Open-source cheminformatics and machine learning.
MolStandardize.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 /*! \file MolStandardize.h
11 
12  \brief Defines the CleanupParameters and some convenience functions.
13 
14 */
15 #include <RDGeneral/export.h>
16 #ifndef __RD_MOLSTANDARDIZE_H__
17 #define __RD_MOLSTANDARDIZE_H__
18 
19 #include <string>
20 #include <GraphMol/RDKitBase.h>
21 
22 namespace RDKit {
23 class RWMol;
24 class ROMol;
25 
26 namespace MolStandardize {
27 
28 //! The CleanupParameters structure defines the default parameters for the
29 // cleanup process and also allows the user to customize the process by changing
30 // the parameters.
31 /*!
32 
33  <b>Notes:</b>
34  - To customize the parameters, the stucture must be initialized first.
35  (Another on the TODO list)
36  - For this project, not all the parameters have been revealed.
37  (TODO)
38 
39 */
41  // TODO reveal all parameters
42  std::string rdbase = std::getenv("RDBASE");
43  std::string normalizations;
44  std::string acidbaseFile;
45  std::string fragmentFile;
46  // std::vector<std::string> chargeCorrections;
47  std::string tautomerTransforms;
48  // std::vector<std::string> TautomerScores;
49  int maxRestarts; // The maximum number of times to attempt to apply the
50  // series of normalizations (default 200).
51  int maxTautomers; // The maximum number of tautomers to enumerate (default
52  // 1000).
53  bool preferOrganic; // Whether to prioritize organic fragments when choosing
54  // fragment parent (default False).
55 
57  : // TODO
58  // normalizations(""),//this->DEFAULT_TRANSFORMS),
59  normalizations(rdbase + "/Data/MolStandardize/normalizations.txt"),
60  acidbaseFile(rdbase + "/Data/MolStandardize/acid_base_pairs.txt"),
61  fragmentFile(rdbase + "/Data/MolStandardize/fragmentPatterns.txt"),
62  // chargeCorrections()
63  tautomerTransforms(rdbase +
64  "/Data/MolStandardize/tautomerTransforms.in"),
65  // TautomerScores()
66  maxRestarts(200),
67  maxTautomers(1000),
68  preferOrganic(false) {}
69 };
70 
73 
74 //! The cleanup function is equivalent to the
75 // molvs.Standardizer().standardize(mol) function. It calls the same steps,
76 // namely: RemoveHs, RDKit SanitizeMol, MetalDisconnector, Normalizer,
77 // Reionizer, RDKit AssignStereochemistry.
79  const RWMol &mol,
80  const CleanupParameters &params = defaultCleanupParameters);
81 
82 //! TODO not yet finished!
84  RWMol &mol, const CleanupParameters &params = defaultCleanupParameters);
85 
86 //! Returns the fragment parent of a given molecule. The fragment parent is the
87 // largest organic covalent unit in the molecule.
89  const RWMol &mol,
90  const CleanupParameters &params = defaultCleanupParameters,
91  bool skip_standardize = false);
92 
93 // TODO
95  RWMol &mol, const CleanupParameters &params = defaultCleanupParameters);
96 
97 // TODO
99  RWMol &mol, const CleanupParameters &params = defaultCleanupParameters);
100 
101 //! Returns the charge parent of a given molecule. The charge parent is the
102 //! uncharged
103 // version of the fragment parent.
105  const RWMol &mol,
106  const CleanupParameters &params = defaultCleanupParameters,
107  bool skip_standardize = false);
108 
109 // TODO Need to do tautomers first
111  RWMol &mol, const CleanupParameters &params = defaultCleanupParameters);
112 
113 //! Works the same as Normalizer().normalize(mol)
115  const RWMol *mol,
116  const CleanupParameters &params = defaultCleanupParameters);
117 
118 //! Works the same as Reionizer().reionize(mol)
120  const RWMol *mol,
121  const CleanupParameters &params = defaultCleanupParameters);
122 
123 //! Convenience function for quickly standardizing a single SMILES string.
124 // Returns a standardized canonical SMILES string given a SMILES string.
126  const std::string &smiles);
127 
128 //! TODO
130  const std::string &smiles,
131  const CleanupParameters &params = defaultCleanupParameters);
132 }; // namespace MolStandardize
133 } // namespace RDKit
134 #endif
RDKIT_MOLSTANDARDIZE_EXPORT RWMol * fragmentParent(const RWMol &mol, const CleanupParameters &params=defaultCleanupParameters, bool skip_standardize=false)
Returns the fragment parent of a given molecule. The fragment parent is the.
RDKIT_MOLSTANDARDIZE_EXPORT void stereoParent(RWMol &mol, const CleanupParameters &params=defaultCleanupParameters)
RWMol is a molecule class that is intended to be edited.
Definition: RWMol.h:31
RDKIT_MOLSTANDARDIZE_EXPORT RWMol * normalize(const RWMol *mol, const CleanupParameters &params=defaultCleanupParameters)
Works the same as Normalizer().normalize(mol)
RDKIT_MOLSTANDARDIZE_EXPORT void tautomerParent(RWMol &mol, const CleanupParameters &params=defaultCleanupParameters)
TODO not yet finished!
pulls in the core RDKit functionality
RDKIT_MOLSTANDARDIZE_EXPORT const CleanupParameters defaultCleanupParameters
Definition: Fragment.h:25
RDKIT_MOLSTANDARDIZE_EXPORT std::string standardizeSmiles(const std::string &smiles)
Convenience function for quickly standardizing a single SMILES string.
RDKIT_MOLSTANDARDIZE_EXPORT void isotopeParent(RWMol &mol, const CleanupParameters &params=defaultCleanupParameters)
RDKIT_MOLSTANDARDIZE_EXPORT RWMol * cleanup(const RWMol &mol, const CleanupParameters &params=defaultCleanupParameters)
The cleanup function is equivalent to the.
RDKIT_MOLSTANDARDIZE_EXPORT RWMol * reionize(const RWMol *mol, const CleanupParameters &params=defaultCleanupParameters)
Works the same as Reionizer().reionize(mol)
Std stuff.
Definition: Atom.h:30
RDKIT_MOLSTANDARDIZE_EXPORT std::vector< std::string > enumerateTautomerSmiles(const std::string &smiles, const CleanupParameters &params=defaultCleanupParameters)
TODO.
The CleanupParameters structure defines the default parameters for the.
RDKIT_MOLSTANDARDIZE_EXPORT RWMol * chargeParent(const RWMol &mol, const CleanupParameters &params=defaultCleanupParameters, bool skip_standardize=false)
#define RDKIT_MOLSTANDARDIZE_EXPORT
Definition: export.h:424
RDKIT_MOLSTANDARDIZE_EXPORT void superParent(RWMol &mol, const CleanupParameters &params=defaultCleanupParameters)