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 
15 #include <core/pack/task/operation/RestrictToInterfaceCreator.hh>
16 
20 #include <core/pose/Pose.hh>
22 
27 // AUTO-REMOVED #include <core/scoring/ScoreFunctionFactory.hh>
28 #include <utility/tag/Tag.hh>
29 #include <utility/vector1.hh>
30 #include <core/conformation/Interface.hh>
31 
32 
33 namespace core {
34 namespace pack {
35 namespace task {
36 namespace operation {
37 
38 using namespace scoring;
39 
40 //RestrictTaskForDocking::RestrictTaskForDocking()
41 // : parent(),
42 // scorefxn_( 0 ),
43 // rb_jump_( 0 ),
44 // include_current_( true ),
45 // distance_( 0 )
46 //{}
47 //
48 //RestrictTaskForDocking::RestrictTaskForDocking(
49 // ScoreFunctionCOP scorefxn,
50 // core::Size rb_jump,
51 // bool include_current,
52 // core::Real distance
53 //) : parent(),
54 // scorefxn_( scorefxn ),
55 // rb_jump_( rb_jump ),
56 // include_current_( include_current ),
57 // distance_( distance )
58 //{}
59 //
60 //RestrictTaskForDocking::~RestrictTaskForDocking(){}
61 //
62 //
63 //task::operation::TaskOperationOP RestrictTaskForDocking::clone() const
64 //{
65 // return new RestrictTaskForDocking( *this );
66 //}
67 //
68 //void
69 //RestrictTaskForDocking::apply(
70 // pose::Pose const & pose,
71 // task::PackerTask & task
72 //) const
73 //{
74 // task.initialize_from_command_line().restrict_to_repacking().or_include_current( include_current_ );
75 //
76 // runtime_assert( scorefxn_ != 0 );
77 // runtime_assert( rb_jump_ );
78 // runtime_assert( distance_ );
79 // // (existing comment) /// why is this still necessary???
80 //// (*scorefxn_)(pose);
81 //// scorefxn_->accumulate_residue_total_energies( pose );
82 //
83 // core::conformation::Interface interface( rb_jump_ );
84 // interface.distance( distance_ );
85 // interface.calculate( pose );
86 // interface.set_pack( pose, &task );
87 //}
88 
90  : parent(), rb_jump_(1)
91 {}
92 
94  : parent(), rb_jump_(rb_jump_in)
95 {}
96 
98 
100 {
101  return new DockingNoRepack1( *this );
102 }
103 
104 void
106  pose::Pose const & pose,
107  task::PackerTask & task
108 ) const
109 {
110 Size cutpoint ( pose.fold_tree().cutpoint_by_jump( rb_jump_ ) );
111  for ( Size ii = 1 ; ii <= cutpoint; ++ii ) {
113  }
114 }
115 
117  : parent(), rb_jump_(1)
118 {}
119 
121  : parent(), rb_jump_(rb_jump_in)
122 {}
123 
125 
127 {
128  return new DockingNoRepack2( *this );
129 }
130 
131 void
133  pose::Pose const & pose,
134  task::PackerTask & task
135 ) const
136 {
137 Size cutpoint ( pose.fold_tree().cutpoint_by_jump( rb_jump_ ) );
138  for ( Size ii = cutpoint+1 ; ii <= pose.total_residue(); ++ii ) {
140  }
141 }
142 
144 
146  parent(), distance_( 8 ), loopy_interface_( true ) {
147  ObjexxFCL::FArray1D_bool hack_loop_residues( loop_residues.size(), false );
148  for( core::Size ii = 1; ii <= loop_residues.size(); ii++ ) {
149  if( loop_residues[ii] )
150  hack_loop_residues(ii) = true;
151  }
152  loop_residues_ = hack_loop_residues;
153 }
154 
155 TaskOperationOP RestrictToInterfaceCreator::create_task_operation() const
156 {
157  return new RestrictToInterface;
158 }
159 
161 {
162  return new RestrictToInterface( *this );
163 }
164 
165 void
167  pose::Pose const & pose,
168  task::PackerTask & task
169 ) const
170 {
171  utility::vector1<bool> is_interface( pose.total_residue(), false );
172 
173  core::Size num_jump_ = rb_jump_.size();
174  for( Size jj=1; jj<=num_jump_; jj++ ) {
175  core::conformation::Interface interface( rb_jump_[jj] );
176  interface.distance( distance_ );
177  interface.calculate( pose );
178 
179  for ( Size ii=1; ii<=pose.total_residue(); ++ii )
180  if( interface.is_interface(ii) )
181  is_interface[ii] = true;
182  }
183 
184  if( loopy_interface_ ) {
185  for ( Size ii=1; ii<=pose.total_residue(); ++ii )
186  if( loop_residues_(ii) )
187  is_interface[ii] = true;
188  }
189 
190  for ( Size ii=1; ii<=pose.total_residue(); ++ii ) {
191  if ( !is_interface[ii] ) //|| pose.residue(ii).is_ligand() )
193  }
194  if ( core::conformation::symmetry::is_symmetric( pose ) ) symmetric_task( pose, task );
195 }
196 
198 {
199  using namespace conformation::symmetry;
200 
201  SymmetricConformation const & SymmConf (
202  dynamic_cast< SymmetricConformation const &> ( pose.conformation()) );
203 
204  for ( Size i = 1; i <= pose.total_residue(); ++i ) {
205  if ( !SymmConf.Symmetry_Info()->chi_is_independent(i) ) {
207  }
208  }
209 }
210 
212 
213  rb_jump_.push_back( jump_in );
214 }
215 
216 void RestrictToInterface::distance( core::Real const distance_in ) {
217  distance_ = distance_in;
218 }
219 
220 void
222 {
223  rb_jump_.push_back( ( tag->getOption< core::Size >( "jump", 1 ) ) );
224  distance_ = tag->getOption< core::Real >( "distance", 8 ) ;
225 }
226 
227 } // namespace operation
228 } // namespace task
229 } // namespace pack
230 } // namespace core
231