Generated on Wed Apr 29 2015 11:51:40 for GGL-4.1.2 by doxygen 1.8.3.1
Reaction.hh
Go to the documentation of this file.
1 #ifndef GGL_CHEM_REACTION_HH_
2 #define GGL_CHEM_REACTION_HH_
3 
4 
5 #include <string>
6 #include <set>
7 #include <ostream>
8 
9 namespace ggl {
10  namespace chem {
11 
12  /*! @brief Reaction description
13  *
14  * A data container describing information of a chemical reaction.
15  *
16  * @author Martin Mann (c) 2009 http://www.bioinf.uni-freiburg.de/~mmann/
17  * @author Alexander Ullrich
18  *
19  */
20  class Reaction {
21 
22  public:
23 
24  //! container that stores all metabolites/educts of the reaction
25  typedef std::multiset< std::string > Metabolite_Container;
26 
27  //! container that stores all products of the reaction
28  typedef std::multiset< std::string > Product_Container;
29 
30  public:
31 
32  /*! the identifier of the ggl::chem::ChemRule rule that was applied
33  * in this reaction.
34  */
35  std::string rule_id;
36 
37  //! the SMILES of the molecules involved in this reaction
39 
40  //! the SMILES of the produced molecules of this reaction
42 
43  //! the rate of the reaction
44  double rate;
45 
46  //! The SMILES of the transition state along the reaction. It is used
47  //! to calculate appropriate reaction rates.
48  std::string transState;
49 
50  public:
51 
52  //! Default construction with empty content
53  Reaction();
54 
55  /*! Construction
56  * @param rule_id the identifier of the rule that was applied
57  * @param metabolites the SMILES of the molecules involved
58  * @param products the SMILES of the produced molecules
59  * @param rate the rate of the reaction
60  * @param transState the SMILES of the transition state
61  */
62  Reaction( const std::string& rule_id
65  , const double rate
66  , const std::string& transState );
67 
68  //! Destruction
69  ~Reaction();
70 
71  //! resets the content to values of default construction;
72  void
73  clear( void );
74 
75  /*! Comparison operator to enable the storage of Reaction objects in
76  * ordered containers like std::set that require a strict less
77  * ordering.
78  *
79  * @param r2 the Reaction to compare to
80  * @return true if [
81  * (rule_id < r2.rule_id) or equal and
82  * (less products) or equal and
83  * (less metabolites) or equal and
84  * (equal product number and one SMILES smaller) or equal and
85  * (equal metabolites number and one SMILES smaller) or equal and
86  * (both rates are set) and (rate < r2.rate) ],
87  * false otherwise
88  */
89  bool
90  operator < ( const Reaction& r2 ) const ;
91 
92 
93  };
94 
95  } // namespace chem
96 } // namespace ggl
97 
98  /*! outstream operator for Reaction class that prints the reaction to stream
99  * @param out the stream to write to
100  * @param r the Reaction to write
101  * @return the modified stream
102  */
103  std::ostream&
104  operator << ( std::ostream& out, const ggl::chem::Reaction& r );
105 
106 
107 #endif /*REACTION_HH_*/
108 
109