Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RotamerRecovery.cc
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/RotamerRecovery.cc
11 /// @author Matthew O'Meara (mattjomeara@gmail.com)
12 /// Adapted from:
13 /// protocols::optimize_weights::IterativeOptEDriver::measure_rotamer_recovery()
14 /// and apps::pilot::doug::rotamer_prediction_benchmark()
15 
16 
17 // Unit Headers
22 
23 // Project Headers
24 #include <core/types.hh>
25 #include <basic/options/option.hh>
26 // AUTO-REMOVED #include <core/pose/Pose.hh>
27 #include <basic/Tracer.hh>
28 // AUTO-REMOVED #include <protocols/moves/Mover.hh>
29 
30 // Utility Headers
31 #include <utility/vector1.hh>
32 
33 // option key includes
34 #include <basic/options/keys/in.OptionKeys.gen.hh>
35 
36 // C++ headers
37 #include <sstream>
38 #include <ostream>
39 #include <string>
40 
41 //Auto Headers
43 namespace protocols {
44 namespace rotamer_recovery {
45 
46 using std::string;
47 using std::stringstream;
48 using std::endl;
49 using std::ostream;
50 using core::Size;
51 using core::Real;
53 using core::pose::Pose;
55 using basic::Tracer;
57 using utility::vector1;
58 
59 static Tracer TR("protocol.rotamer_recovery.RotamerRecovery");
60 
62  protocol_( new RRProtocolMinPack),
63  comparer_( new RRComparerAutomorphicRMSD),
64  reporter_( new RRReporterSimple),
65  ignore_unrecognized_res_(false)
66 {}
67 
69  RRProtocolOP protocol,
70  RRComparerOP comparer,
71  RRReporterOP reporter) :
72  protocol_( protocol ),
73  comparer_( comparer ),
74  reporter_( reporter ),
75  ignore_unrecognized_res_(false)
76 {
77  reporter_->set_protocol_info( protocol_->get_name(), protocol_->get_parameters() );
78  reporter_->set_comparer_info( comparer_->get_name(), comparer_->get_parameters() );
79 }
80 
82 
84  RotamerRecovery const & src
85 ) :
86  ReferenceCount(),
87  protocol_( src.protocol_ ),
88  comparer_( src.comparer_ ),
89  reporter_( src.reporter_ )
90 {}
91 
92 void
94 ) {
95  reporter_->reset_recovery();
96 }
97 
98 void
100  using basic::options::option;
101  using basic::options::OptionKeys::in::ignore_unrecognized_res;
102 
103  /// options from the main Option file that are relevant in this context ( and should appear in -help output )
104  option.add_relevant( ignore_unrecognized_res );
105 }
106 
107 
108 Real
110  Pose const & pose,
111  ScoreFunction const & score_function,
112  PackerTask const & packer_task
113 ) {
114  protocol_->run(comparer_, reporter_, pose, score_function, packer_task);
115  return reporter_->recovery_rate();
116 }
117 
118 void
119 RotamerRecovery::show( ostream & out ) const {
120  reporter_->show( out );
121 }
122 
123 void
125  reporter_->show( TR );
126 }
127 
128 Real
130  return reporter_->recovery_rate();
131 }
132 
133 void
135  RotamerRecovery & rotamer_recovery
136 ) {
137 
138  using basic::options::option;
139  using basic::options::OptionKeys::in::ignore_unrecognized_res;
140 
141  if( option[ ignore_unrecognized_res ].user() ){
142  rotamer_recovery.set_ignore_unrecognized_res(
143  option[ ignore_unrecognized_res ].value() );
144  }
145 }
146 
147 void
149 {
151 }
152 
153 void
155  bool const ignore_unrecognized_res
156 ) {
157  ignore_unrecognized_res_ = ignore_unrecognized_res;
158 }
159 
160 bool
162 {
164 }
165 
166 } // rotamer_recovery
167 } // protocols