RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
TautomerCatalogParams.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_PARAMS_H
12#define RD_TAUTOMER_CATALOG_PARAMS_H
13
15#include <GraphMol/RDKitBase.h>
16#include <string>
17#include <vector>
18
19namespace RDKit {
20class ROMol;
21
22namespace MolStandardize {
23
25 std::vector<std::tuple<std::string, std::string, std::string, std::string>>;
26
33
35 public:
36 ROMol *Mol = nullptr;
37 std::vector<Bond::BondType> BondTypes;
38 std::vector<int> Charges;
39
40 TautomerTransform(ROMol *mol, std::vector<Bond::BondType> bondtypes,
41 std::vector<int> charges)
42 : Mol(mol),
43 BondTypes(std::move(bondtypes)),
44 Charges(std::move(charges)) {}
45
47 : BondTypes(other.BondTypes), Charges(other.Charges) {
48 Mol = new ROMol(*other.Mol);
49 }
50
52 if (this != &other) {
53 delete Mol;
54 Mol = new ROMol(*other.Mol);
55 BondTypes = other.BondTypes;
56 Charges = other.Charges;
57 }
58 return *this;
59 }
60
61 ~TautomerTransform() { delete Mol; }
62};
63
66 public:
68 d_typeStr = "Tautomer Catalog Parameters";
69 d_transforms.clear();
70 }
71
72 TautomerCatalogParams(const std::string &tautomerFile);
74 // copy constructor
76
78
79 const std::vector<TautomerTransform> &getTransforms() const;
80
81 const TautomerTransform getTransform(unsigned int fid) const;
82
83 void toStream(std::ostream &) const override;
84 std::string Serialize() const override;
85 void initFromStream(std::istream &ss) override;
86 void initFromString(const std::string &text) override;
87
88 private:
89 // std::vector<std::pair<ROMol*, ROMol*>> d_pairs;
90 std::vector<TautomerTransform> d_transforms;
91
92}; // class TautomerCatalogParams
93
94} // namespace MolStandardize
95} // namespace RDKit
96
97#endif
pulls in the core RDKit functionality
abstract base class for the container used to create a catalog
std::string d_typeStr
our type string
std::string Serialize() const override
returns a string with a serialized (pickled) representation
const TautomerTransform getTransform(unsigned int fid) const
void initFromStream(std::istream &ss) override
initializes from a stream pickle
TautomerCatalogParams(const std::string &tautomerFile)
void initFromString(const std::string &text) override
initializes from a string pickle
TautomerCatalogParams(const TautomerTransformDefs &data)
void toStream(std::ostream &) const override
serializes (pickles) to a stream
TautomerCatalogParams(const TautomerCatalogParams &other)
const std::vector< TautomerTransform > & getTransforms() const
TautomerTransform(ROMol *mol, std::vector< Bond::BondType > bondtypes, std::vector< int > charges)
TautomerTransform(const TautomerTransform &other)
TautomerTransform & operator=(const TautomerTransform &other)
#define RDKIT_MOLSTANDARDIZE_EXPORT
Definition export.h:369
RDKIT_MOLSTANDARDIZE_EXPORT const TautomerTransformDefs defaultTautomerTransforms
RDKIT_MOLSTANDARDIZE_EXPORT const TautomerTransformDefs defaultTautomerTransformsv1
std::vector< std::tuple< std::string, std::string, std::string, std::string > > TautomerTransformDefs
Std stuff.