Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RestrictToInterface.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 RestrictToInterface.cc
11 /// @brief When passed to a PackerTask, pack/design is limited to the protein interface
12 /// @author ashworth
13 
16 
20 #include <core/pose/Pose.hh>
21 // AUTO-REMOVED #include <core/scoring/ScoreFunction.hh>
22 
27 // AUTO-REMOVED #include <core/conformation/symmetry/util.hh>
28 
29 // AUTO-REMOVED #include <core/scoring/ScoreFunctionFactory.hh>
30 #include <utility/tag/Tag.hh>
31 #include <utility/vector1.hh>
33 
34 #include <utility/vector0.hh>
35 #include <utility/options/IntegerVectorOption.hh>
36 
37 
38 
39 namespace protocols {
40 namespace toolbox {
41 namespace task_operations {
42 
43 using namespace core;
44 using namespace scoring;
45 
46 //RestrictTaskForDocking::RestrictTaskForDocking()
47 // : parent(),
48 // scorefxn_( 0 ),
49 // rb_jump_( 0 ),
50 // include_current_( true ),
51 // distance_( 0 )
52 //{}
53 //
54 //RestrictTaskForDocking::RestrictTaskForDocking(
55 // ScoreFunctionCOP scorefxn,
56 // core::Size rb_jump,
57 // bool include_current,
58 // core::Real distance
59 //) : parent(),
60 // scorefxn_( scorefxn ),
61 // rb_jump_( rb_jump ),
62 // include_current_( include_current ),
63 // distance_( distance )
64 //{}
65 //
66 //RestrictTaskForDocking::~RestrictTaskForDocking(){}
67 //
68 //
69 //task::operation::TaskOperationOP RestrictTaskForDocking::clone() const
70 //{
71 // return new RestrictTaskForDocking( *this );
72 //}
73 //
74 //void
75 //RestrictTaskForDocking::apply(
76 // pose::Pose const & pose,
77 // task::PackerTask & task
78 //) const
79 //{
80 // task.initialize_from_command_line().restrict_to_repacking().or_include_current( include_current_ );
81 //
82 // runtime_assert( scorefxn_ != 0 );
83 // runtime_assert( rb_jump_ );
84 // runtime_assert( distance_ );
85 // // (existing comment) /// why is this still necessary???
86 //// (*scorefxn_)(pose);
87 //// scorefxn_->accumulate_residue_total_energies( pose );
88 //
89 // core::conformation::Interface interface( rb_jump_ );
90 // interface.distance( distance_ );
91 // interface.calculate( pose );
92 // interface.set_pack( pose, &task );
93 //}
94 
96  : parent(), rb_jump_(1)
97 {}
98 
100  : parent(), rb_jump_(rb_jump_in)
101 {}
102 
104 
106 {
107  return new DockingNoRepack1( *this );
108 }
109 
110 void
112  core::pose::Pose const & pose,
114 ) const
115 {
116 using namespace core;
117 Size cutpoint ( pose.fold_tree().cutpoint_by_jump( rb_jump_ ) );
118  for ( Size ii = 1 ; ii <= cutpoint; ++ii ) {
120  }
121 }
122 
124  : parent(), rb_jump_(1)
125 {}
126 
128  : parent(), rb_jump_(rb_jump_in)
129 {}
130 
132 
134 {
135  return new DockingNoRepack2( *this );
136 }
137 
138 void
140  core::pose::Pose const & pose,
142 ) const
143 {
144 Size cutpoint ( pose.fold_tree().cutpoint_by_jump( rb_jump_ ) );
145  for ( Size ii = cutpoint+1 ; ii <= pose.total_residue(); ++ii ) {
147  }
148 }
149 
151 
153  parent(), distance_( 8 ), loopy_interface_( true ) {
154  set_movable_jumps( utility::vector1_int() );
155  ObjexxFCL::FArray1D_bool hack_loop_residues( loop_residues.size(), false );
156  for( core::Size ii = 1; ii <= loop_residues.size(); ii++ ) {
157  if( loop_residues[ii] )
158  hack_loop_residues(ii) = true;
159  }
160  loop_residues_ = hack_loop_residues;
161 }
162 
164 {
165  return new RestrictToInterface;
166 }
167 
169 {
170  return new RestrictToInterface( *this );
171 }
172 
173 void
175  core::pose::Pose const & pose,
177 ) const
178 {
179  using core::Size;
180  utility::vector1<bool> is_interface( pose.total_residue(), false );
181 
182  core::Size num_jump_ = movable_jumps().size();
183  for( Size jj=1; jj<=num_jump_; jj++ ) {
184  protocols::scoring::Interface interface( movable_jumps()[jj] );
185  interface.distance( distance_ );
186  interface.calculate( pose );
187 
188  for ( Size ii=1; ii<=pose.total_residue(); ++ii )
189  if( interface.is_interface(ii) )
190  is_interface[ii] = true;
191  }
192 
193  if( loopy_interface_ ) {
194  for ( Size ii=1; ii<=pose.total_residue(); ++ii )
195  if( loop_residues_(ii) )
196  is_interface[ii] = true;
197  }
198 
199  for ( Size ii=1; ii<=pose.total_residue(); ++ii ) {
200  if ( !is_interface[ii] ) //|| pose.residue(ii).is_ligand() )
202  }
203  if ( core::pose::symmetry::is_symmetric( pose ) ) symmetric_task( pose, task );
204 }
205 
207  core::pose::Pose const & pose,
209 ) const {
210  using namespace conformation::symmetry;
211 
212  SymmetricConformation const & SymmConf (
213  dynamic_cast< SymmetricConformation const &> ( pose.conformation()) );
214 
215  for ( Size i = 1; i <= pose.total_residue(); ++i ) {
216  if ( !SymmConf.Symmetry_Info()->chi_is_independent(i) ) {
218  }
219  }
220 }
221 
222 void RestrictToInterface::rb_jump( int jump_in ) {
223 
224  add_movable_jump( jump_in );
225 }
226 
227 /*
228 void RestrictToInterface::set_movable_jumps( utility::vector1_int const movable_jumps ) {
229  rb_jump_ = movable_jumps;
230 }
231 */
232 
233 void RestrictToInterface::distance( core::Real const distance_in ) {
234  distance_ = distance_in;
235 }
236 
237 void
239 {
240  add_movable_jump( ( tag->getOption< core::Size >( "jump", 1 ) ) );
241  distance_ = tag->getOption< core::Real >( "distance", 8 ) ;
242 }
243 
244 }
245 }
246 }