Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BindingStrainFilter.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 sw=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 /// @author Sarel Fleishman (sarelf@uw.edu)
18 #include <protocols/moves/Mover.hh>
23 #include <core/pose/Pose.hh>
24 #include <utility/tag/Tag.hh>
26 // AUTO-REMOVED #include <protocols/moves/DataMap.hh>
27 #include <basic/Tracer.hh>
29 
30 // AUTO-REMOVED #include <core/id/types.hh>
31 #include <utility/vector0.hh>
32 #include <utility/vector1.hh>
33 
34 //Auto Headers
36 
37 
38 
39 namespace protocols {
40 namespace protein_interface_design{
41 namespace filters {
42 
43 static basic::Tracer TR( "protocols.protein_interface_design.filters.BindingStrainFilter" );
44 
45 ///@brief default ctor
47  parent( "BindingStrain" ),
48  task_factory_( NULL ),
49  scorefxn_( NULL ),
50  relax_mover_( NULL ),
51  jump_( 1 ),
52  threshold_( 3.0 )
53 {}
54 
57  return jump_;
58 }
59 
60 void
62  jump_ = j;
63 }
64 
67  return task_factory_;
68 }
69 
70 void
72  task_factory_ = task;
73 }
74 
77  return scorefxn_;
78 }
79 
80 void
83 }
84 
87  return threshold_;
88 }
89 
90 void
92  threshold_ = t;
93 }
94 
95 bool
97 {
98  core::Real const strain( compute( pose ) );
99  return( strain <= threshold() );
100 }
101 
102 void
105  rbtm.step_size( 10000.0 );
106  rbtm.apply( pose );
107 }
108 
111  using namespace core::pack;
112  using namespace core::pack::task;
113 
114  PackerTaskOP pack = task_factory()->create_task_and_apply_taskoperations( p );
115  pack->restrict_to_repacking();
116  pack->initialize_from_command_line();
118  core::pose::Pose pose( p );
119  unbind( pose );
120  core::Real const energy_before_pack( stf.compute( pose ));
121 
125  else
127  prm->apply( pose );
128  core::Real const energy_after_pack( stf.compute( pose ) );
129  return( energy_before_pack - energy_after_pack );
130 }
131 
134 {
135  return( compute( pose ) );
136 }
137 
138 void
139 BindingStrainFilter::report( std::ostream & out, core::pose::Pose const & pose ) const
140 {
141  out<<"BindingStrainFilter returns "<<compute( pose )<<std::endl;
142 }
143 
144 void
148  protocols::moves::Movers_map const & movers,
149  core::pose::Pose const & )
150 {
151  using namespace protocols::rosetta_scripts;
152  TR << "BindingStrainFilter"<<std::endl;
153  task_factory( parse_task_operations( tag, data ) );
154  scorefxn( parse_score_function( tag, data ) );
155  jump( tag->getOption< core::Size >( "jump", 1 ) );
156  runtime_assert( jump() > 0 );
157  threshold( tag->getOption< core::Real >( "threshold", 3.0 ));
158  relax_mover( protocols::rosetta_scripts::parse_mover( tag->getOption< std::string >( "relax_mover", "null" ), movers ) );
159 
160  TR<<"with options jump: "<<jump()<<" and strain threshold: "<<threshold()<<std::endl;
161 }
162 
165  return new BindingStrainFilter();
166 }
167 
169 
172  return new BindingStrainFilter( *this );
173 }
174 
177 
179 BindingStrainFilterCreator::keyname() const { return "BindingStrain"; }
180 
183  return relax_mover_;
184 }
185 
186 void
188  relax_mover_ = m;
189 }
190 
191 } // filters
192 } // protein_interface_design
193 } // protocols