RDKit: TransformCatalogParams.h Source File

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
TransformCatalogParams.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_TRANSFORM_CATALOG_PARAMS_H
12#define RD_TRANSFORM_CATALOG_PARAMS_H
13
14#include <Catalogs/CatalogParams.h>
15#include "TransformCatalogUtils.h"
16#include <GraphMol/RDKitBase.h>
17#include <GraphMol/ChemReactions/Reaction.h>
18#include <string>
19#include <vector>
20
21namespace RDKit {
22class ROMol;
23
24namespace MolStandardize {
25 class RDKIT_MOLSTANDARDIZE_EXPORT TransformCatalogParams
26 : public RDCatalog::CatalogParams {
27 public:
28 TransformCatalogParams() {
29 d_typeStr = "Transform Catalog Parameters";
30 d_transformations.clear();
31 }
32
33 // if the string here is empty the default transforms will be used
34 TransformCatalogParams(const std::string &transformFile);
35 TransformCatalogParams(std::istream &transformStream);
36 TransformCatalogParams(
37 const std::vector<std::pair<std::string, std::string>> &data);
38 // copy constructor
39 TransformCatalogParams(const TransformCatalogParams &other);
40
41 ~TransformCatalogParams() override;
42
43 unsigned int getNumTransformations() const {
44 return static_cast<unsigned int>(d_transformations.size());
45 }
46
47 const std::vector<std::shared_ptr<ChemicalReaction>> &getTransformations()
48 const;
49
50 const ChemicalReaction *getTransformation(unsigned int fid) const;
51
52 void toStream(std::ostream &) const override;
53 std::string Serialize() const override;
54 void initFromStream(std::istream &ss) override;
55 void initFromString(const std::string &text) override;
56
57 // it's a bit dirty to make this "const", but it's weakly defensible
58 // since the set of transformations themselves will not be changed.
59 void initializeTransforms() const;
60
61 private:
62 std::vector<std::shared_ptr<ChemicalReaction>> d_transformations;
63
64}; // class TransformCatalogParams
65
66} // namespace MolStandardize
67} // namespace RDKit
68
69#endif
CatalogParams.h
RDKitBase.h
pulls in the core RDKit functionality
Reaction.h
TransformCatalogUtils.h
RDCatalog::CatalogParams
abstract base class for the container used to create a catalog
Definition CatalogParams.h:18
RDCatalog::CatalogParams::d_typeStr
std::string d_typeStr
our type string
Definition CatalogParams.h:38
RDKit::ChemicalReaction
This is a class for storing and applying general chemical reactions.
Definition Reaction.h:121
RDKit::MolStandardize::TransformCatalogParams::initFromString
void initFromString(const std::string &text) override
initializes from a string pickle
RDKit::MolStandardize::TransformCatalogParams::TransformCatalogParams
TransformCatalogParams(const std::vector< std::pair< std::string, std::string > > &data)
RDKit::MolStandardize::TransformCatalogParams::initFromStream
void initFromStream(std::istream &ss) override
initializes from a stream pickle
RDKit::MolStandardize::TransformCatalogParams::getTransformation
const ChemicalReaction * getTransformation(unsigned int fid) const
RDKit::MolStandardize::TransformCatalogParams::TransformCatalogParams
TransformCatalogParams(const TransformCatalogParams &other)
RDKit::MolStandardize::TransformCatalogParams::getTransformations
const std::vector< std::shared_ptr< ChemicalReaction > > & getTransformations() const
RDKit::MolStandardize::TransformCatalogParams::Serialize
std::string Serialize() const override
returns a string with a serialized (pickled) representation
RDKit::MolStandardize::TransformCatalogParams::TransformCatalogParams
TransformCatalogParams()
Definition TransformCatalogParams.h:28
RDKit::MolStandardize::TransformCatalogParams::initializeTransforms
void initializeTransforms() const
RDKit::MolStandardize::TransformCatalogParams::toStream
void toStream(std::ostream &) const override
serializes (pickles) to a stream
RDKit::MolStandardize::TransformCatalogParams::getNumTransformations
unsigned int getNumTransformations() const
Definition TransformCatalogParams.h:43
RDKit::MolStandardize::TransformCatalogParams::~TransformCatalogParams
~TransformCatalogParams() override
RDKit::MolStandardize::TransformCatalogParams::TransformCatalogParams
TransformCatalogParams(std::istream &transformStream)
RDKit::MolStandardize::TransformCatalogParams::TransformCatalogParams
TransformCatalogParams(const std::string &transformFile)
RDKit::ROMol
Definition ROMol.h:199
export.h
RDKIT_MOLSTANDARDIZE_EXPORT
#define RDKIT_MOLSTANDARDIZE_EXPORT
Definition export.h:369
RDKit::MolStandardize
Definition AcidBaseCatalogEntry.h:22
RDKit
Std stuff.
Definition Abbreviations.h:19