Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RRReporterSQLite.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file src/protocols/rotamer_recovery/RRReporterSQLite.hh
11 /// @author Matthew O'Meara (mattjomeara@gmail.com)
12 
13 #ifndef INCLUDED_protocols_rotamer_recovery_RRReporterSQLite_hh
14 #define INCLUDED_protocols_rotamer_recovery_RRReporterSQLite_hh
15 
16 // Unit Headers
19 
20 //External
21 #include <boost/uuid/uuid.hpp>
22 
23 // Project Headers
24 #include <core/types.hh>
25 #include <core/pose/Pose.fwd.hh>
26 
27 // Utility Headers
28 #include <utility/pointer/ReferenceCount.hh>
29 #include <utility/sql_database/DatabaseSessionManager.fwd.hh>
30 #include <utility/vector1.hh>
31 
32 //Auto Headers
33 #include <string>
34 // C++ Headers
35 
36 
37 namespace protocols {
38 namespace rotamer_recovery {
39 
40 class RRReporterSQLite : public RRReporter {
41 
42 public: // constructors destructors
43 
44  struct OutputLevel{
45  enum e {
46  full = 1,
49  };
50  };
51 
53 
55  std::string const & database_name,
56  std::string const & database_pq_schema = "",
57  OutputLevel::e const output_level = OutputLevel::full
58  );
59 
61  utility::sql_database::sessionOP db_session,
62  OutputLevel::e const output_level = OutputLevel::full
63  );
64 
66 
68 
69 public: // public interface
70 
71  ///@brief generate the table schemas and write them to the database
72  void
74  utility::sql_database::sessionOP db_session,
75  OutputLevel::e output_level = OutputLevel::full) const;
76 
77 private:
78  ///@brief generate the nchi table schema
79  void
81  utility::sql_database::sessionOP db_session) const;
82 
83  ///@brief generate the full rotamer_recovery table schema
84  void
86  utility::sql_database::sessionOP db_session) const;
87 
88  ///@brief generate the features rotamer_recovery table schema
89  void
91  utility::sql_database::sessionOP db_session) const;
92 
93 public:
94  void
96  std::string const & protocol_name,
97  std::string const & protocol_params);
98 
99  void
101  std::string const & comparer_name,
102  std::string const & comparer_params);
103 
104  utility::sql_database::sessionOP
105  db_session();
106 
107  void
109  OutputLevel::e const output_level );
110 
112  get_output_level() const;
113 
114  void
116  boost::uuids::uuid const struct_id1);
117 
118  boost::uuids::uuid
119  get_struct_id1() const;
120 
121  void
123  boost::uuids::uuid const struct_id1);
124 
125  boost::uuids::uuid
126  get_struct_id2() const;
127 
128  virtual
129  void
130  reset_recovery();
131 
132  virtual
133  void
135  core::pose::Pose const & pose1,
136  core::pose::Pose const & pose2,
137  core::conformation::Residue const & res1,
138  core::conformation::Residue const & res2,
139  core::Real score,
140  bool recovered
141  );
142 
143 
144  virtual
145  void
147  core::pose::Pose const & pose1,
148  core::pose::Pose const & pose2,
149  core::conformation::Residue const & res1,
150  core::conformation::Residue const & res2,
151  core::Real score,
152  bool recovered
153  );
154 
155  virtual
156  void
158  boost::uuids::uuid struct_id1,
159  core::conformation::Residue const & res1,
160  core::Real score,
161  bool recovered
162  );
163 
164  virtual
165  core::Real
166  recovery_rate() const;
167 
168  virtual
169  void
170  show(std::ostream & out ) const;
171 
172  virtual
173  void
174  show() const;
175 
176 private: // data members
177 
179 
180  boost::uuids::uuid struct_id1_;
181  boost::uuids::uuid struct_id2_;
182 
185 
188 
191 
194  utility::sql_database::sessionOP db_session_;
195 
196 };
197 
198 } // namespace rotamer_recovery
199 } // namespace protocols
200 
201 #endif // include guard