RDKit
Open-source cheminformatics and machine learning.
TautomerCatalogUtils.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2018-2021 Susan H. Leung and other RDKit contributors
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_TAUTOMER_CATALOG_UTILS_H
12 #define RD_TAUTOMER_CATALOG_UTILS_H
13 
14 #include <GraphMol/RDKitBase.h>
15 #include "TautomerCatalogParams.h"
18 #include <GraphMol/Bond.h>
19 #include <iostream>
20 #include <utility>
21 
22 namespace RDKit {
23 class ROMol;
24 
25 namespace MolStandardize {
26 class TautomerCatalogParams;
27 
28 // typedef enum {
29 // SINGLE,
30 // DOUBLE,
31 // TRIPLE,
32 // AROMATIC,
33 //} BondType;
34 
35 // typedef std::vector<ROMol*, std::string, std::string> tautomerTransform;
37  public:
38  ROMol* Mol = nullptr;
39  std::vector<Bond::BondType> BondTypes;
40  std::vector<int> Charges;
41 
42  TautomerTransform(ROMol* mol, std::vector<Bond::BondType> bondtypes,
43  std::vector<int> charges)
44  : Mol(mol),
45  BondTypes(std::move(bondtypes)),
46  Charges(std::move(charges)) {}
47 
49  : BondTypes(other.BondTypes), Charges(other.Charges) {
50  Mol = new ROMol(*other.Mol);
51  }
52 
54  if (this != &other) {
55  delete Mol;
56  Mol = new ROMol(*other.Mol);
57  BondTypes = other.BondTypes;
58  Charges = other.Charges;
59  }
60  return *this;
61  }
62 
63  ~TautomerTransform() { delete Mol; }
64 };
65 
66 RDKIT_MOLSTANDARDIZE_EXPORT std::vector<Bond::BondType> stringToBondType(
67  std::string bond_str);
69  std::string charge_str);
70 
71 RDKIT_MOLSTANDARDIZE_EXPORT std::vector<TautomerTransform> readTautomers(
72  std::string fileName);
73 RDKIT_MOLSTANDARDIZE_EXPORT std::vector<TautomerTransform> readTautomers(
74  std::istream& inStream, int nToRead = -1);
75 RDKIT_MOLSTANDARDIZE_EXPORT std::vector<TautomerTransform> readTautomers(
76  const std::vector<
77  std::tuple<std::string, std::string, std::string, std::string>>& data);
78 } // namespace MolStandardize
79 } // namespace RDKit
80 
81 #endif
pulls in the core RDKit functionality
TautomerTransform(ROMol *mol, std::vector< Bond::BondType > bondtypes, std::vector< int > charges)
TautomerTransform(const TautomerTransform &other)
std::vector< Bond::BondType > BondTypes
TautomerTransform & operator=(const TautomerTransform &other)
#define RDKIT_MOLSTANDARDIZE_EXPORT
Definition: export.h:305
RDKIT_MOLSTANDARDIZE_EXPORT std::vector< TautomerTransform > readTautomers(std::string fileName)
RDKIT_MOLSTANDARDIZE_EXPORT std::vector< Bond::BondType > stringToBondType(std::string bond_str)
RDKIT_MOLSTANDARDIZE_EXPORT std::vector< int > stringToCharge(std::string charge_str)
Std stuff.
Definition: Abbreviations.h:18