Chemical Data Processing Library C++ API - Version 1.1.1
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
CDPL::Chem::setComponentMatchConstraints
CDPL_CHEM_API void setComponentMatchConstraints(Reaction &rxn, const MatchConstraintList::SharedPointer &constr, bool overwrite)
CDPL::Chem::getMDLExternalRegistryNumber
CDPL_CHEM_API const std::string & getMDLExternalRegistryNumber(const Reaction &rxn)
Molecule.hpp
Definition of the class CDPL::Chem::Molecule.
CDPL::Chem::setMDLExternalRegistryNumber
CDPL_CHEM_API void setMDLExternalRegistryNumber(Reaction &rxn, const std::string &reg_no)
CDPL::Chem::setAtomMapping
CDPL_CHEM_API void setAtomMapping(Reaction &rxn, const AtomMapping::SharedPointer &mapping)
ReactionRole.hpp
Definition of constants in namespace CDPL::Chem::ReactionRole.
CDPL::Chem::clearMDLInternalRegistryNumber
CDPL_CHEM_API void clearMDLInternalRegistryNumber(Reaction &rxn)
CDPL::Chem::getMDLInternalRegistryNumber
CDPL_CHEM_API const std::string & getMDLInternalRegistryNumber(const Reaction &rxn)
CDPL::Chem::getMDLRXNFileVersion
CDPL_CHEM_API unsigned int getMDLRXNFileVersion(const Reaction &rxn)
APIPrefix.hpp
Definition of the preprocessor macro CDPL_CHEM_API.
CDPL::Chem::clearMDLMoleculeRecord
CDPL_CHEM_API void clearMDLMoleculeRecord(Reaction &rxn)
CDPL::Chem::getMDLUserInitials
CDPL_CHEM_API const std::string & getMDLUserInitials(const MolecularGraph &molgraph)
CDPL::Chem::hasTimestamp
CDPL_CHEM_API bool hasTimestamp(const MolecularGraph &molgraph)
CDPL::Chem::getAtomMapping
CDPL_CHEM_API const AtomMapping::SharedPointer & getAtomMapping(const Reaction &rxn)
CDPL::Chem::hasMDLRegistryNumber
CDPL_CHEM_API bool hasMDLRegistryNumber(const MolecularGraph &molgraph)
CDPL::Chem::setMDLMoleculeRecord
CDPL_CHEM_API void setMDLMoleculeRecord(Reaction &rxn, const Molecule::SharedPointer &mol_rec)
CDPL::Chem::setMDLRegistryNumber
CDPL_CHEM_API void setMDLRegistryNumber(MolecularGraph &molgraph, std::size_t reg_no)
CDPL::Chem::hasReactionData
CDPL_CHEM_API bool hasReactionData(const Reaction &rxn)
CDPL_CHEM_API
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::Chem::generateMatchExpressions
CDPL_CHEM_API void generateMatchExpressions(MolecularGraph &molgraph, bool overwrite)
CDPL::Chem::clearTimestamp
CDPL_CHEM_API void clearTimestamp(MolecularGraph &molgraph)
CDPL::Chem::initSubstructureSearchQuery
CDPL_CHEM_API void initSubstructureSearchQuery(MolecularGraph &molgraph, bool overwrite)
CDPL::Chem::getMDLProgramName
CDPL_CHEM_API const std::string & getMDLProgramName(const MolecularGraph &molgraph)
CDPL::Chem::getReactionData
CDPL_CHEM_API const StringDataBlock::SharedPointer & getReactionData(const Reaction &rxn)
CDPL::Chem::setMatchExpression
CDPL_CHEM_API void setMatchExpression(Atom &atom, const MatchExpression< Atom, MolecularGraph >::SharedPointer &expr)
CDPL::Chem::calcHashCode
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::getMaxComponentGroupID
CDPL_CHEM_API std::size_t getMaxComponentGroupID(const AtomContainer &cntnr)
CDPL::Chem::setReactionData
CDPL_CHEM_API void setReactionData(Reaction &rxn, const StringDataBlock::SharedPointer &data)
CDPL::Chem::ReactionRole::ALL
const unsigned int ALL
Specifies reactants, agents and products of a reaction.
Definition: ReactionRole.hpp:74
CDPL::Chem::setAtomMatchConstraints
CDPL_CHEM_API void setAtomMatchConstraints(MolecularGraph &molgraph, const MatchConstraintList::SharedPointer &constr, bool overwrite)
CDPL::Chem::AtomMapping::SharedPointer
std::shared_ptr< AtomMapping > SharedPointer
Definition: AtomMapping.hpp:57
CDPL::Chem::MatchConstraintList::SharedPointer
std::shared_ptr< MatchConstraintList > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MatchConstraintList instances.
Definition: MatchConstraintList.hpp:197
CDPL::Chem::StringDataBlock::SharedPointer
std::shared_ptr< StringDataBlock > SharedPointer
Definition: StringDataBlock.hpp:128
CDPL::Chem::clearMatchExpression
CDPL_CHEM_API void clearMatchExpression(Atom &atom)
CDPL::Chem::hasMatchExpression
CDPL_CHEM_API bool hasMatchExpression(const Atom &atom)
CDPL::Chem::hasAtomMapping
CDPL_CHEM_API bool hasAtomMapping(const Reaction &rxn)
CDPL::Chem::setBondMatchConstraints
CDPL_CHEM_API void setBondMatchConstraints(MolecularGraph &molgraph, const MatchConstraintList::SharedPointer &constr, bool overwrite)
CDPL::Chem::Molecule::SharedPointer
std::shared_ptr< Molecule > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated Molecule instances.
Definition: Molecule.hpp:55
CDPL::Chem::clearComponentGroups
CDPL_CHEM_API void clearComponentGroups(MolecularGraph &molgraph)
CDPL::Chem::generateMatchExpression
CDPL_CHEM_API MatchExpression< Atom, MolecularGraph >::SharedPointer generateMatchExpression(const Atom &atom, const MolecularGraph &molgraph)
CDPL::Chem::hasComponentGroups
CDPL_CHEM_API bool hasComponentGroups(const MolecularGraph &molgraph)
CDPL::Chem::clearName
CDPL_CHEM_API void clearName(Atom &atom)
CDPL::Chem::FragmentList::SharedPointer
std::shared_ptr< FragmentList > SharedPointer
Definition: FragmentList.hpp:52
CDPL::Chem::setComponentGroups
CDPL_CHEM_API void setComponentGroups(MolecularGraph &molgraph, const FragmentList::SharedPointer &comp_groups)
CDPL::Chem::hasMDLMoleculeRecord
CDPL_CHEM_API bool hasMDLMoleculeRecord(const Reaction &rxn)
CDPL::Chem::setComment
CDPL_CHEM_API void setComment(MolecularGraph &molgraph, const std::string &comment)
AtomPropertyFlag.hpp
Definition of constants in namespace CDPL::Chem::AtomPropertyFlag.
CDPL::Chem::perceiveComponentGroups
CDPL_CHEM_API FragmentList::SharedPointer perceiveComponentGroups(const MolecularGraph &molgraph)
CDPL::Chem::getName
CDPL_CHEM_API const std::string & getName(const Atom &atom)
CDPL::Chem::hasComment
CDPL_CHEM_API bool hasComment(const MolecularGraph &molgraph)
CDPL::Chem::clearMDLRegistryNumber
CDPL_CHEM_API void clearMDLRegistryNumber(MolecularGraph &molgraph)
CDPL::Chem::calcBasicProperties
CDPL_CHEM_API void calcBasicProperties(MolecularGraph &molgraph, bool overwrite)
CDPL::Chem::setMDLUserInitials
CDPL_CHEM_API void setMDLUserInitials(MolecularGraph &molgraph, const std::string &initials)
CDPL::Chem::clearComment
CDPL_CHEM_API void clearComment(MolecularGraph &molgraph)
CDPL::Chem::clearReactionData
CDPL_CHEM_API void clearReactionData(Reaction &rxn)
CDPL::Chem::perceiveAtomMapping
CDPL_CHEM_API AtomMapping::SharedPointer perceiveAtomMapping(const Reaction &rxn)
CDPL::Chem::initSubstructureSearchTarget
CDPL_CHEM_API void initSubstructureSearchTarget(MolecularGraph &molgraph, bool overwrite)
CDPL::Chem::clearAtomMapping
CDPL_CHEM_API void clearAtomMapping(Reaction &rxn)
CDPL::Chem::hasMDLUserInitials
CDPL_CHEM_API bool hasMDLUserInitials(const MolecularGraph &molgraph)
CDPL::Chem::clearMatchConstraints
CDPL_CHEM_API void clearMatchConstraints(Atom &atom)
CDPL::Chem::AtomPropertyFlag::DEFAULT
const unsigned int DEFAULT
Represents the default set of atom properties.
Definition: Chem/AtomPropertyFlag.hpp:53
CDPL::Chem::hasMDLRXNFileVersion
CDPL_CHEM_API bool hasMDLRXNFileVersion(const Reaction &rxn)
CDPL::Chem::getMaxAtomMappingID
CDPL_CHEM_API std::size_t getMaxAtomMappingID(const AtomContainer &cntnr)
CDPL::Chem::getMDLMoleculeRecord
CDPL_CHEM_API const Molecule::SharedPointer & getMDLMoleculeRecord(const Reaction &rxn)
CDPL::Chem::hasMDLProgramName
CDPL_CHEM_API bool hasMDLProgramName(const MolecularGraph &molgraph)
CDPL::Chem::MatchExpression
A generic boolean expression interface for the implementation of query/target object equivalence test...
Definition: MatchExpression.hpp:75
CDPL::Chem::getComment
CDPL_CHEM_API const std::string & getComment(const MolecularGraph &molgraph)
CDPL::Chem::generateSMILES
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::getTimestamp
CDPL_CHEM_API std::time_t getTimestamp(const MolecularGraph &molgraph)
MatchExpression.hpp
Definition of the class CDPL::Chem::MatchExpression.
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Chem::hasMDLInternalRegistryNumber
CDPL_CHEM_API bool hasMDLInternalRegistryNumber(const Reaction &rxn)
CDPL::Chem::setMDLProgramName
CDPL_CHEM_API void setMDLProgramName(MolecularGraph &molgraph, const std::string &name)
CDPL::Chem::getMDLRegistryNumber
CDPL_CHEM_API std::size_t getMDLRegistryNumber(const MolecularGraph &molgraph)
CDPL::Chem::Reaction
Reaction.
Definition: Reaction.hpp:52
CDPL::Chem::setTimestamp
CDPL_CHEM_API void setTimestamp(MolecularGraph &molgraph, std::time_t time)
CDPL::Chem::hasName
CDPL_CHEM_API bool hasName(const Atom &atom)
CDPL::Chem::clearMDLExternalRegistryNumber
CDPL_CHEM_API void clearMDLExternalRegistryNumber(Reaction &rxn)
CDPL::Chem::getMatchExpression
CDPL_CHEM_API const MatchExpression< Atom, MolecularGraph >::SharedPointer & getMatchExpression(const Atom &atom)
CDPL::Chem::clearMDLUserInitials
CDPL_CHEM_API void clearMDLUserInitials(MolecularGraph &molgraph)
CDPL::Chem::setName
CDPL_CHEM_API void setName(Atom &atom, const std::string &name)
CDPL::Chem::clearMDLProgramName
CDPL_CHEM_API void clearMDLProgramName(MolecularGraph &molgraph)
AtomMapping.hpp
Definition of the type CDPL::Chem::AtomMapping.
CDPL::Chem::setMDLInternalRegistryNumber
CDPL_CHEM_API void setMDLInternalRegistryNumber(Reaction &rxn, const std::string &reg_no)
CDPL::Chem::setMatchConstraints
CDPL_CHEM_API void setMatchConstraints(Atom &atom, const MatchConstraintList::SharedPointer &constr)
BondPropertyFlag.hpp
Definition of constants in namespace CDPL::Chem::BondPropertyFlag.
CDPL::Chem::hasMatchConstraints
CDPL_CHEM_API bool hasMatchConstraints(const Atom &atom)
MatchConstraintList.hpp
Definition of the class CDPL::Chem::MatchConstraintList.
FragmentList.hpp
Definition of the class CDPL::Chem::FragmentList.
CDPL::Chem::setMDLRXNFileVersion
CDPL_CHEM_API void setMDLRXNFileVersion(Reaction &rxn, unsigned int version)
CDPL::Chem::hasMDLExternalRegistryNumber
CDPL_CHEM_API bool hasMDLExternalRegistryNumber(const Reaction &rxn)
StringDataBlock.hpp
Definition of the class CDPL::Chem::StringDataBlockItem and the type CDPL::Chem::StringDataBlock.
CDPL::Chem::getMatchConstraints
CDPL_CHEM_API const MatchConstraintList::SharedPointer & getMatchConstraints(const Atom &atom)
CDPL::Chem::getComponentGroups
CDPL_CHEM_API const FragmentList::SharedPointer & getComponentGroups(const MolecularGraph &molgraph)
CDPL::Chem::BondPropertyFlag::DEFAULT
const unsigned int DEFAULT
Represents the default set of bond properties.
Definition: BondPropertyFlag.hpp:53
CDPL::Chem::clearMDLRXNFileVersion
CDPL_CHEM_API void clearMDLRXNFileVersion(Reaction &rxn)