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#include <iostream>
19
20namespace RDKit {
21class ROMol;
22
23namespace MolStandardize {
24
26 std::vector<std::tuple<std::string, std::string, std::string, std::string>>;
27
34
36 public:
37 ROMol *Mol = nullptr;
38 std::vector<Bond::BondType> BondTypes;
39 std::vector<int> Charges;
40
41 TautomerTransform(ROMol *mol, std::vector<Bond::BondType> bondtypes,
42 std::vector<int> charges)
43 : Mol(mol),
44 BondTypes(std::move(bondtypes)),
45 Charges(std::move(charges)) {}
46
48 : BondTypes(other.BondTypes), Charges(other.Charges) {
49 Mol = new ROMol(*other.Mol);
50 }
51
53 if (this != &other) {
54 delete Mol;
55 Mol = new ROMol(*other.Mol);
56 BondTypes = other.BondTypes;
57 Charges = other.Charges;
58 }
59 return *this;
60 }
61
62 ~TautomerTransform() { delete Mol; }
63};
64
67 public:
69 d_typeStr = "Tautomer Catalog Parameters";
70 d_transforms.clear();
71 }
72
73 TautomerCatalogParams(const std::string &tautomerFile);
75 // copy constructor
77
79
80 const std::vector<TautomerTransform> &getTransforms() const;
81
82 const TautomerTransform getTransform(unsigned int fid) const;
83
84 void toStream(std::ostream &) const override;
85 std::string Serialize() const override;
86 void initFromStream(std::istream &ss) override;
87 void initFromString(const std::string &text) override;
88
89 private:
90 // std::vector<std::pair<ROMol*, ROMol*>> d_pairs;
91 std::vector<TautomerTransform> d_transforms;
92
93}; // class TautomerCatalogParams
94
95} // namespace MolStandardize
96} // namespace RDKit
97
98#endif
pulls in the core RDKit functionality
abstract base class for the container used to create a catalog
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:353
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.