Chemical Data Processing Library C++ API - Version 1.2.0
Chem/ReactionFunctions.hpp
Go to the documentation of this file.
1 /*
2  * ReactionFunctions.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_CHEM_REACTIONFUNCTIONS_HPP
30 #define CDPL_CHEM_REACTIONFUNCTIONS_HPP
31 
32 #include <cstddef>
33 #include <cstdint>
34 #include <ctime>
35 #include <string>
36 
37 #include "CDPL/Chem/APIPrefix.hpp"
38 #include "CDPL/Chem/Molecule.hpp"
47 
48 
49 namespace CDPL
50 {
51 
52  namespace Chem
53  {
54 
55  class Reaction;
56 
57  CDPL_CHEM_API const std::string& getName(const Reaction& rxn);
58 
59  CDPL_CHEM_API void setName(Reaction& rxn, const std::string& name);
60 
62 
63  CDPL_CHEM_API bool hasName(const Reaction& rxn);
64 
65 
66  CDPL_CHEM_API std::time_t getTimestamp(const Reaction& rxn);
67 
68  CDPL_CHEM_API void setTimestamp(Reaction& rxn, std::time_t time);
69 
71 
73 
74 
75  CDPL_CHEM_API const std::string& getComment(const Reaction& rxn);
76 
77  CDPL_CHEM_API void setComment(Reaction& rxn, const std::string& comment);
78 
80 
81  CDPL_CHEM_API bool hasComment(const Reaction& rxn);
82 
83 
85 
87 
89 
91 
93 
95 
96 
98 
100 
102 
104 
105 
107 
109 
111 
113 
115 
117 
118 
120 
122 
124 
126 
128 
130 
131 
132  CDPL_CHEM_API bool generateSMILES(const Reaction& rxn, std::string& smiles, bool canonical = false,
133  bool ord_h_deplete = true, unsigned int atom_flags = AtomPropertyFlag::DEFAULT,
134  unsigned int bond_flags = BondPropertyFlag::DEFAULT);
135 
136  CDPL_CHEM_API std::uint64_t calcHashCode(const Reaction& rxn, unsigned int role_mask = ReactionRole::ALL,
137  unsigned int atom_flags = AtomPropertyFlag::DEFAULT,
138  unsigned int bond_flags = BondPropertyFlag::DEFAULT,
139  bool ord_h_deplete = true);
140 
141 
142  CDPL_CHEM_API const std::string& getMDLUserInitials(const Reaction& rxn);
143 
144  CDPL_CHEM_API void setMDLUserInitials(Reaction& rxn, const std::string& initials);
145 
147 
149 
150 
151  CDPL_CHEM_API const std::string& getMDLProgramName(const Reaction& rxn);
152 
153  CDPL_CHEM_API void setMDLProgramName(Reaction& rxn, const std::string& name);
154 
156 
158 
159 
160  CDPL_CHEM_API std::size_t getMDLRegistryNumber(const Reaction& rxn);
161 
162  CDPL_CHEM_API void setMDLRegistryNumber(Reaction& rxn, std::size_t reg_no);
163 
165 
167 
168 
170 
172 
174 
176 
177 
179 
181 
183 
185 
186 
187  CDPL_CHEM_API const std::string& getMDLInternalRegistryNumber(const Reaction& rxn);
188 
189  CDPL_CHEM_API void setMDLInternalRegistryNumber(Reaction& rxn, const std::string& reg_no);
190 
192 
194 
195 
196  CDPL_CHEM_API const std::string& getMDLExternalRegistryNumber(const Reaction& rxn);
197 
198  CDPL_CHEM_API void setMDLExternalRegistryNumber(Reaction& rxn, const std::string& reg_no);
199 
201 
203 
204 
205  CDPL_CHEM_API unsigned int getMDLRXNFileVersion(const Reaction& rxn);
206 
207  CDPL_CHEM_API void setMDLRXNFileVersion(Reaction& rxn, unsigned int version);
208 
210 
212 
213 
215 
216  CDPL_CHEM_API std::size_t getMaxAtomMappingID(const Reaction& rxn);
217 
218 
220 
222 
224 
225  CDPL_CHEM_API void generateMatchExpressions(Reaction& rxn, bool overwrite);
226 
228 
230 
234  CDPL_CHEM_API void calcBasicProperties(Reaction& rxn, bool overwrite);
235 
236  } // namespace Chem
237 } // namespace CDPL
238 
239 #endif // CDPL_CHEM_REACTIONFUNCTIONS_HPP
Definition of the type CDPL::Chem::AtomMapping.
Definition of constants in namespace CDPL::Chem::BondPropertyFlag.
Definition of the preprocessor macro CDPL_CHEM_API.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of constants in namespace CDPL::Chem::AtomPropertyFlag.
Definition of the class CDPL::Chem::FragmentList.
Definition of the class CDPL::Chem::MatchConstraintList.
Definition of the class CDPL::Chem::MatchExpression.
Definition of the class CDPL::Chem::Molecule.
Definition of constants in namespace CDPL::Chem::ReactionRole.
Definition of the class CDPL::Chem::StringDataBlockItem and the type CDPL::Chem::StringDataBlock.
std::shared_ptr< AtomMapping > SharedPointer
Definition: AtomMapping.hpp:57
std::shared_ptr< FragmentList > SharedPointer
Definition: FragmentList.hpp:52
std::shared_ptr< MatchConstraintList > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MatchConstraintList instances.
Definition: MatchConstraintList.hpp:197
A generic boolean expression interface for the implementation of query/target object equivalence test...
Definition: MatchExpression.hpp:75
std::shared_ptr< Molecule > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated Molecule instances.
Definition: Molecule.hpp:55
Reaction.
Definition: Reaction.hpp:52
std::shared_ptr< StringDataBlock > SharedPointer
Definition: StringDataBlock.hpp:128
constexpr unsigned int DEFAULT
Represents the default set of atom properties.
Definition: Chem/AtomPropertyFlag.hpp:53
constexpr unsigned int DEFAULT
Represents the default set of bond properties.
Definition: BondPropertyFlag.hpp:53
constexpr unsigned int ALL
Specifies reactants, agents and products of a reaction.
Definition: ReactionRole.hpp:74
CDPL_CHEM_API const Molecule::SharedPointer & getMDLMoleculeRecord(const Reaction &rxn)
CDPL_CHEM_API void setMDLUserInitials(MolecularGraph &molgraph, const std::string &initials)
CDPL_CHEM_API AtomMapping::SharedPointer perceiveAtomMapping(const Reaction &rxn)
CDPL_CHEM_API const std::string & getComment(const MolecularGraph &molgraph)
CDPL_CHEM_API void clearMDLExternalRegistryNumber(Reaction &rxn)
CDPL_CHEM_API void clearMatchExpression(Atom &atom)
CDPL_CHEM_API bool hasTimestamp(const MolecularGraph &molgraph)
CDPL_CHEM_API const StringDataBlock::SharedPointer & getReactionData(const Reaction &rxn)
CDPL_CHEM_API void setTimestamp(MolecularGraph &molgraph, std::time_t time)
CDPL_CHEM_API bool hasMDLUserInitials(const MolecularGraph &molgraph)
CDPL_CHEM_API void initSubstructureSearchQuery(MolecularGraph &molgraph, bool overwrite)
CDPL_CHEM_API const MatchConstraintList::SharedPointer & getMatchConstraints(const Atom &atom)
CDPL_CHEM_API void generateMatchExpressions(MolecularGraph &molgraph, bool overwrite)
CDPL_CHEM_API void setReactionData(Reaction &rxn, const StringDataBlock::SharedPointer &data)
CDPL_CHEM_API bool hasReactionData(const Reaction &rxn)
CDPL_CHEM_API bool hasName(const Atom &atom)
CDPL_CHEM_API const std::string & getMDLUserInitials(const MolecularGraph &molgraph)
CDPL_CHEM_API void clearMDLRegistryNumber(MolecularGraph &molgraph)
CDPL_CHEM_API const std::string & getName(const Atom &atom)
CDPL_CHEM_API void clearMDLRXNFileVersion(Reaction &rxn)
CDPL_CHEM_API const AtomMapping::SharedPointer & getAtomMapping(const Reaction &rxn)
CDPL_CHEM_API bool hasMDLInternalRegistryNumber(const Reaction &rxn)
CDPL_CHEM_API bool hasMDLRXNFileVersion(const Reaction &rxn)
CDPL_CHEM_API void setMatchExpression(Atom &atom, const MatchExpression< Atom, MolecularGraph >::SharedPointer &expr)
CDPL_CHEM_API void clearTimestamp(MolecularGraph &molgraph)
CDPL_CHEM_API bool hasMDLRegistryNumber(const MolecularGraph &molgraph)
CDPL_CHEM_API void setMDLInternalRegistryNumber(Reaction &rxn, const std::string &reg_no)
CDPL_CHEM_API MatchExpression< Atom, MolecularGraph >::SharedPointer generateMatchExpression(const Atom &atom, const MolecularGraph &molgraph)
CDPL_CHEM_API const MatchExpression< Atom, MolecularGraph >::SharedPointer & getMatchExpression(const Atom &atom)
CDPL_CHEM_API void setComment(MolecularGraph &molgraph, const std::string &comment)
CDPL_CHEM_API const std::string & getMDLInternalRegistryNumber(const Reaction &rxn)
CDPL_CHEM_API bool hasMDLExternalRegistryNumber(const Reaction &rxn)
CDPL_CHEM_API const std::string & getMDLExternalRegistryNumber(const Reaction &rxn)
CDPL_CHEM_API void setAtomMapping(Reaction &rxn, const AtomMapping::SharedPointer &mapping)
CDPL_CHEM_API void setComponentGroups(MolecularGraph &molgraph, const FragmentList::SharedPointer &comp_groups)
CDPL_CHEM_API void clearMDLProgramName(MolecularGraph &molgraph)
CDPL_CHEM_API void clearReactionData(Reaction &rxn)
CDPL_CHEM_API void setMDLExternalRegistryNumber(Reaction &rxn, const std::string &reg_no)
CDPL_CHEM_API const FragmentList::SharedPointer & getComponentGroups(const MolecularGraph &molgraph)
CDPL_CHEM_API void initSubstructureSearchTarget(MolecularGraph &molgraph, bool overwrite)
CDPL_CHEM_API FragmentList::SharedPointer perceiveComponentGroups(const MolecularGraph &molgraph)
CDPL_CHEM_API void setMDLRXNFileVersion(Reaction &rxn, unsigned int version)
CDPL_CHEM_API void setMatchConstraints(Atom &atom, const MatchConstraintList::SharedPointer &constr)
CDPL_CHEM_API std::time_t getTimestamp(const MolecularGraph &molgraph)
CDPL_CHEM_API std::uint64_t calcHashCode(const MolecularGraph &molgraph, unsigned int atom_flags=AtomPropertyFlag::DEFAULT, unsigned int bond_flags=BondPropertyFlag::DEFAULT, bool ord_h_deplete=true)
CDPL_CHEM_API std::size_t getMaxComponentGroupID(const AtomContainer &cntnr)
CDPL_CHEM_API void clearMDLMoleculeRecord(Reaction &rxn)
CDPL_CHEM_API bool hasMatchExpression(const Atom &atom)
CDPL_CHEM_API void setComponentMatchConstraints(Reaction &rxn, const MatchConstraintList::SharedPointer &constr, bool overwrite)
CDPL_CHEM_API void clearComment(MolecularGraph &molgraph)
CDPL_CHEM_API void clearComponentGroups(MolecularGraph &molgraph)
CDPL_CHEM_API const std::string & getMDLProgramName(const MolecularGraph &molgraph)
CDPL_CHEM_API void clearName(Atom &atom)
CDPL_CHEM_API bool hasComponentGroups(const MolecularGraph &molgraph)
CDPL_CHEM_API void setAtomMatchConstraints(MolecularGraph &molgraph, const MatchConstraintList::SharedPointer &constr, bool overwrite)
CDPL_CHEM_API void setMDLRegistryNumber(MolecularGraph &molgraph, std::size_t reg_no)
CDPL_CHEM_API void clearAtomMapping(Reaction &rxn)
CDPL_CHEM_API std::size_t getMDLRegistryNumber(const MolecularGraph &molgraph)
CDPL_CHEM_API std::size_t getMaxAtomMappingID(const AtomContainer &cntnr)
CDPL_CHEM_API void clearMatchConstraints(Atom &atom)
CDPL_CHEM_API void clearMDLUserInitials(MolecularGraph &molgraph)
CDPL_CHEM_API bool hasAtomMapping(const Reaction &rxn)
CDPL_CHEM_API bool hasMatchConstraints(const Atom &atom)
CDPL_CHEM_API void calcBasicProperties(MolecularGraph &molgraph, bool overwrite)
CDPL_CHEM_API void setMDLMoleculeRecord(Reaction &rxn, const Molecule::SharedPointer &mol_rec)
CDPL_CHEM_API bool hasComment(const MolecularGraph &molgraph)
CDPL_CHEM_API void setMDLProgramName(MolecularGraph &molgraph, const std::string &name)
CDPL_CHEM_API bool hasMDLMoleculeRecord(const Reaction &rxn)
CDPL_CHEM_API void setBondMatchConstraints(MolecularGraph &molgraph, const MatchConstraintList::SharedPointer &constr, bool overwrite)
CDPL_CHEM_API void clearMDLInternalRegistryNumber(Reaction &rxn)
CDPL_CHEM_API bool generateSMILES(const MolecularGraph &molgraph, std::string &smiles, bool canonical=false, bool ord_h_deplete=true, unsigned int atom_flags=AtomPropertyFlag::DEFAULT, unsigned int bond_flags=BondPropertyFlag::DEFAULT)
CDPL_CHEM_API unsigned int getMDLRXNFileVersion(const Reaction &rxn)
CDPL_CHEM_API bool hasMDLProgramName(const MolecularGraph &molgraph)
CDPL_CHEM_API void setName(Atom &atom, const std::string &name)
The namespace of the Chemical Data Processing Library.