Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SidechainMinMover.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
11 /// @brief
12 /// @author Sid Chaudhury
13 
14 // Unit headers
16 
17 // Package Headers
19 
20 // Project headers
24 
25 #include <core/pose/Pose.hh>
26 
29 
32 
34 
35 // Utility Headers
36 #include <basic/Tracer.hh>
37 
38 // AUTO-REMOVED #include <core/pack/task/operation/TaskOperation.hh>
39 
40 #include <utility/vector1.hh>
41 
42 
43 using basic::T;
44 using basic::Error;
45 using basic::Warning;
46 
47 static basic::Tracer TR("protocols.docking.SidechainMinMover");
48 
49 namespace protocols {
50 namespace docking {
51 
52 //default constructor
54 {
55  DockingHighRes::type( "SidechainMin" );
56  update_movemap_ = true;
58  set_scorefxn( temp_sf );
59  set_default();
60 }
61 
62 //construtor with arguments
64 {
65  DockingHighRes::type( "SidechainMin" );
66  //scorefxn_ = new core::scoring::ScoreFunction( *scorefxn() );
67  set_default();
68 }
69 
70 //construtor with arguments
74 ) : DockingHighRes( 1, scorefxn ), movemap_(movemap), update_movemap_(false)
75 {
76  DockingHighRes::type( "SidechainMin" );
77  //scorefxn_ = new core::scoring::ScoreFunction( *scorefxn );
78  set_default();
79 }
80 
81 //constructor with arguments
84  core::pack::task::PackerTaskOP task) : DockingHighRes( 1, scorefxn ), task_(task), update_movemap_(true)
85 {
86  DockingHighRes::type( "SidechainMin" );
87  //scorefxn_ = new core::scoring::ScoreFunction( *scorefxn() );
88  set_default();
89 }
90 
91 //constructor with arguments
94  core::pack::task::TaskFactoryCOP tf) : DockingHighRes( 1, scorefxn), update_movemap_(true)
95 {
96  DockingHighRes::type( "SidechainMin" );
97  //scorefxn_ = new core::scoring::ScoreFunction( *scorefxn() );
98  //tf_ = new core::pack::task::TaskFactory( *tf );
99  set_task_factory( tf );
100  set_default();
101 }
102 
104  core::Size rb_jump, core::scoring::ScoreFunctionOP scorefxn ): DockingHighRes( rb_jump, scorefxn)
105 {
106  DockingHighRes::type( "SidechainMin" );
107  set_default();
108 }
109 //destructor
111 
113 
114 //default options setup for SidechainMinMover
116 {
117  if(update_movemap_){
119  movemap_->set_chi( true );
120  }
121  minmover_ = new protocols::simple_moves::MinMover(movemap_, scorefxn(), "dfpmin_armijo_nonmonotone", 0.01, true/*nblist*/, false/*deriv_check*/ );
122 }
123 
126  return "SidechainMin";
127 }
128 
129 //SidechainMinMover updates the movemap based on a packer task
131 {
132  movemap_->set_chi( true );
133  if ( task_factory() ) task_ = task_factory()->create_task_and_apply_taskoperations( pose );
134  if ( task_ ){
135  for(Size i = 1; i <= pose.total_residue(); i++){
136  if (!task_->nonconst_residue_task(i).being_packed()) movemap_->set_chi(i, false);
137  }
138  }
139 }
140 
141 //SidechainMinMover apply function
143 {
144  //runtime_assert(pose.is_fullatom());
145  if(update_movemap_) update_movemap( pose );
146  minmover_->apply( pose );
147 }
148 
149 /////////////////////////// InterfaceSidechainMinMover ////////////////////////////////
150 
151 //constructor
153 {
154  Mover::type( "InterfaceSidechainMinMover" );
155  set_default();
156 }
157 
159  core::Size rb_jump,
161  core::Real interface_dist
162 ) : SidechainMinMover(rb_jump, scorefxn), interface_dist_(interface_dist)
163 {
164  Mover::type( "InterfaceSidechainMin" );
165  set_default();
166 }
167 
168 //destructor
170 
172 {
173  interface_dist_ = interface_dist;
174  interface_->distance(interface_dist_);
175 }
176 
177 //default setup for InterfaceSidechainMinMover
178 void
180 {
182 }
183 
184 //apply function for InterfaceSidechainMinMover
185 void
187 {
188  //reset movemap
189  movemap_->set_bb(false);
190  movemap_->set_jump(false);
191  movemap_->set_chi(false);
192 
193  //calculate interface
194  interface_->calculate( pose );
195 
196  Size cutpoint ( pose.fold_tree().cutpoint_by_jump( movable_jumps()[1] ) );
197 
198  //set move map for interface residues only
199  if ( !( tf2() )->get_norepack1() ){
200  for(core::Size i = 1; i <= cutpoint; i++){
201  if (interface_->is_interface(i)) movemap_->set_chi(i, true);
202  }
203  }
204 
205  if ( !( tf2() )->get_norepack2() ){
206  for(core::Size i = cutpoint+1; i <= pose.total_residue(); i++){
207  if (interface_->is_interface(i)) movemap_->set_chi(i, true);
208  }
209  }
210 
211  minmover_->apply(pose);
212 
213 }
214 
217  return "InterfaceSidechainMin";
218 }
219 
220 } // docking
221 } // protocols