Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ProteinInterfaceDesignOperation.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 protocols/toolbox/task_operations/ProteinInterfaceDesignOperation.cc
11 /// @brief
12 /// @author Sarelf Fleishman sarelf@uw.edu
13 
14 // Unit Headers
17 
18 // Project Headers
19 #include <core/pose/Pose.hh>
20 
21 // AUTO-REMOVED #include <core/pack/task/PackerTask.hh>
23 
24 // Utility Headers
25 #include <core/types.hh>
26 #include <basic/Tracer.hh>
27 #include <utility/exit.hh>
28 #include <utility/vector1.hh>
30 #include <utility/tag/Tag.hh>
32 // AUTO-REMOVED #include <basic/options/keys/pose_metrics.OptionKeys.gen.hh>
33 // AUTO-REMOVED #include <basic/options/option.hh>
36 // AUTO-REMOVED #include <protocols/toolbox/task_operations/RestrictToInterface.hh>
40 // C++ Headers
41 #include <set>
42 
43 #include <utility/vector0.hh>
44 
45 
46 using basic::Error;
47 using basic::Warning;
48 static basic::Tracer TR( "protocols.toolbox.TaskOperations.ProteinInterfaceDesignOperation" );
49 
50 namespace protocols {
51 namespace toolbox {
52 namespace task_operations {
53 
54 using namespace core::pack::task::operation;
55 
57  repack_chain1_( 1 ),
58  repack_chain2_( 1 ),
59  design_chain1_( 0 ),
60  design_chain2_( 1 ),
61  allow_all_aas_( 0 ),
62  design_all_aas_( 0 ),
63  interface_distance_cutoff_( 8.0 ),
64  jump_( 1 ),
65  modify_before_jump_( true ),
66  modify_after_jump_ ( true )
67 {}
68 
70 
73 {
75 }
76 
78 {
79  return new ProteinInterfaceDesignOperation( *this );
80 }
81 
82 ///@brief the default taskoperation for protein-interface design. Sets up which chains to repack/design
83 /// disable disulfides, prolines and glycines from design, restrict designable positions to all but pro/gly/cys
84 void
86 {
87  using namespace core::pack::task::operation;
88  using namespace protocols::toolbox::task_operations;
89 
90  core::Size const chains( pose.conformation().num_chains() );
91 
92  DesignAroundOperation dao1, dao2;
94  for( core::Size resi = 1; resi <= pose.total_residue(); ++resi ){
95  if( resi <= pose.conformation().chain_end( jump() ) ){
96  dao1.include_residue( resi );
97  }
98  else
99  dao2.include_residue( resi );
100  }
101  if( modify_after_jump() )
102  dao1.apply( pose, task );
103  if( modify_before_jump() )
104  dao2.apply( pose, task );
105 
106  for( core::Size chain=1; chain<=chains; ++chain ){
108  if( chain<=jump() && !repack_chain1_ && modify_before_jump() ){
109  pcfr.chain( chain );
110  pcfr.apply( pose, task );
111  }
112  if( chain > jump() && !repack_chain2_ && modify_after_jump() ){
113  pcfr.chain( chain );
114  pcfr.apply( pose, task );
115  }
117  if( chain<=jump() && !design_chain1_ && modify_before_jump() ){
118  rctr.chain( chain );
119  rctr.apply( pose, task );
120  }
121  if( chain > jump() && !design_chain2_ && modify_after_jump() ){
122  rctr.chain( chain );
123  rctr.apply( pose, task );
124  }
125 
126  }
127  NoRepackDisulfides nrd;
128  nrd.apply( pose, task );
130  using namespace core::chemical;
132  // check if we are allowing design of all cannonical aas
133  if( !allow_all_aas_ ){
134  allowed_aas[ aa_cys ] = false;
135  allowed_aas[ aa_gly ] = false;
136  allowed_aas[ aa_pro ] = false;
137  }
138  for( core::Size i = 1; i<=pose.total_residue(); ++i ){
139  utility::vector1< bool > specific_allowed_aas( allowed_aas );
140  if( pose.residue( i ).aa() == aa_cys ) specific_allowed_aas[ aa_cys ] = true; // allow a native cystein in packer task
141  RestrictAbsentCanonicalAAS racaas( i, specific_allowed_aas );
142  racaas.apply( pose, task );
143  //check if we are designing all residues
144  if ( !design_all_aas_ ){
145  if( pose.residue( i ).aa() == aa_pro || pose.residue( i ).aa() == aa_gly ){
146  residues.push_back( i );
147  }
148  }
149  }
150  // needed because OperateOnCertainResidues will act on all residues in
151  // the pose if the vector of indices is empty
152  if( residues.size() != 0 ){
154  oocr.op( new PreventRepackingRLT );
155  oocr.residue_indices( residues );
156  oocr.apply( pose, task );
157  }
158 }
159 
160 void
162 {
163  repack_chain1_ = repack;
164 }
165 void
167 {
168  repack_chain2_ = repack;
169 }
170 void
172 {
173  design_chain1_ = design;
174 }
175 void
177 {
178  design_chain2_ = design;
179 }
180 
181 void
183 {
184  allow_all_aas_ = allow;
185 }
186 void
188 {
189  design_all_aas_ = design_all;
190 }
191 void
193 {
195 }
196 void
198 {
199  jump_ = j;
200 }
203 {
204  return( jump_ );
205 }
206 
207 void
209 {
210  repack_chain1( tag->getOption< core::Size >( "repack_chain1", 1 ) );
211  repack_chain2( tag->getOption< core::Size >( "repack_chain2", 1 ) );
212  design_chain1( tag->getOption< core::Size >( "design_chain1", 0 ) );
213  design_chain2( tag->getOption< core::Size >( "design_chain2", 1 ) );
214  allow_all_aas( tag->getOption< core::Size >( "allow_all_aas", 0 ) );
215  design_all_aas( tag->getOption< core::Size >( "design_all_aas", 0 ) );
216  jump( tag->getOption< core::Size >( "jump", 1 ) );
217  interface_distance_cutoff( tag->getOption< core::Real >( "interface_distance_cutoff", 8.0 ) );
218  modify_before_jump( tag->getOption< bool >( "modify_before_jump", 1 ) );
219  modify_after_jump( tag->getOption< bool >( "modify_after_jump", 1 ) );
220 }
221 
222 } //namespace protocols
223 } //namespace toolbox
224 } //namespace task_operations