RDKit
Open-source cheminformatics and machine learning.
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>
18 #include <string>
19 #include <vector>
20 #include <iostream>
21 
22 namespace RDKit {
23 class ROMol;
24 
25 namespace MolStandardize {
27  : public RDCatalog::CatalogParams {
28  public:
30  d_typeStr = "Transform Catalog Parameters";
31  d_transformations.clear();
32  }
33 
34  // if the string here is empty the default transforms will be used
35  TransformCatalogParams(const std::string &transformFile);
36  TransformCatalogParams(std::istream &transformStream);
38  const std::vector<std::pair<std::string, std::string>> &data);
39  // copy constructor
41 
43 
44  unsigned int getNumTransformations() const {
45  return static_cast<unsigned int>(d_transformations.size());
46  }
47 
48  const std::vector<std::shared_ptr<ChemicalReaction>> &getTransformations()
49  const;
50 
51  const ChemicalReaction *getTransformation(unsigned int fid) const;
52 
53  void toStream(std::ostream &) const override;
54  std::string Serialize() const override;
55  void initFromStream(std::istream &ss) override;
56  void initFromString(const std::string &text) override;
57 
58  private:
59  std::vector<std::shared_ptr<ChemicalReaction>> d_transformations;
60 
61 }; // class TransformCatalogParams
62 
63 } // namespace MolStandardize
64 } // namespace RDKit
65 
66 #endif
pulls in the core RDKit functionality
abstract base class for the container used to create a catalog
Definition: CatalogParams.h:18
This is a class for storing and applying general chemical reactions.
Definition: Reaction.h:121
void initFromString(const std::string &text) override
initializes from a string pickle
TransformCatalogParams(const std::vector< std::pair< std::string, std::string >> &data)
void initFromStream(std::istream &ss) override
initializes from a stream pickle
TransformCatalogParams(const TransformCatalogParams &other)
std::string Serialize() const override
returns a string with a serialized (pickled) representation
void toStream(std::ostream &) const override
serializes (pickles) to a stream
const ChemicalReaction * getTransformation(unsigned int fid) const
TransformCatalogParams(std::istream &transformStream)
TransformCatalogParams(const std::string &transformFile)
const std::vector< std::shared_ptr< ChemicalReaction > > & getTransformations() const
#define RDKIT_MOLSTANDARDIZE_EXPORT
Definition: export.h:321
Std stuff.
Definition: Abbreviations.h:19