Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EnzdesFixBBProtocol.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/enzdes/EnzdesFixBBProtocol.cc
11 ///
12 /// @brief
13 /// @author Florian Richter
14 
15 
18 // AUTO-REMOVED #include <protocols/toolbox/match_enzdes_util/EnzConstraintIO.hh>
21 // AUTO-REMOVED #include <core/chemical/ResidueType.hh>
22 #include <basic/options/option.hh>
24 #include <core/pose/Pose.hh>
27 // AUTO-REMOVED #include <protocols/moves/MonteCarlo.hh>
30 
31 #include <basic/Tracer.hh>
32 
33 // option key includes
34 
35 #include <basic/options/keys/enzdes.OptionKeys.gen.hh>
36 #include <basic/options/keys/in.OptionKeys.gen.hh>
37 #include <utility/vector0.hh>
38 #include <utility/vector1.hh>
39 
40 namespace protocols{
41 namespace enzdes{
42 
43 static basic::Tracer tr("protocols.enzdes.EnzdesFixBBProtocol");
44 
47  start_from_random_rb_conf_( basic::options::option[basic::options::OptionKeys::enzdes::start_from_random_rb_conf] )
48 {}
49 
51 
52 void
54  core::pose::Pose & pose
55 ){
56 
57 
58  using namespace protocols::moves;
59  using namespace core::pack::task;
60 
61  // Scoring function already set up by superclass
62  tr.Info << "starting apply function..." << std::endl;
63 
64  //set the native pose if requested
65  if( ! basic::options::option[basic::options::OptionKeys::in::file::native].user() ){
66 
67  core::pose::PoseOP natpose = new core::pose::Pose( pose );
68  (*scorefxn_)( *natpose );
69  this->set_native_pose( natpose );
70  }
71 
72  //set up constraints (read cstfile, do mapping, etc, then add to pose)
73  if( basic::options::option[basic::options::OptionKeys::enzdes::cstfile].user() ){
75  setup_enzdes_constraints( pose, false );
76  }
77 
80  ranconf.apply( pose );
81  }
82 
83  //create packer task (read resfile, etc)
84  PackerTaskOP design_pack_task;
85 
86  tr.Info << "Done setting up the task and constraints... " << std::endl;
87  //score pose to make sure everything is initialised correctly
88  (*scorefxn_)( pose );
89 
90  //cst opt stage, if demanded
91  if(basic::options::option[basic::options::OptionKeys::enzdes::cst_opt]){
92  design_pack_task = create_enzdes_pack_task( pose );
93  tr.Info << "starting cst_opt minimization..." << std::endl;
94  cst_minimize(pose, design_pack_task, true);
95  (*scorefxn_)( pose );
96  tr.Info << "done cst_opt minimization." << std::endl;
97  }
98 
99 
100  if(basic::options::option[basic::options::OptionKeys::enzdes::cst_predock])
101  {
102  //design_pack_task = create_enzdes_pack_task( pose );
104  predock->set_ligand( get_ligand_id(pose, pose.num_jump()) );
105  predock->apply(pose);
106  (*scorefxn_)( pose );
107  }
108 
109 
110  if(basic::options::option[basic::options::OptionKeys::enzdes::cst_design]){
111 
112  design_pack_task = create_enzdes_pack_task( pose ); //make a new task in case the ligand has moved a lot
113  tr.Info << "starting cst_design, " << basic::options::option[basic::options::OptionKeys::enzdes::design_min_cycles] << " cycles of design/minimization ... " << std::endl;
114 
115  core::Size design_min_cycles = basic::options::option[basic::options::OptionKeys::enzdes::design_min_cycles];
116 
117 // bool favor_native_res(false);
118 // if( basic::options::option[basic::options::OptionKeys::enzdes::favor_native_res].user() ) favor_native_res = true;
119 
120  enzdes_pack( pose, design_pack_task, scorefxn_, design_min_cycles, basic::options::option[basic::options::OptionKeys::enzdes::cst_min], false, true );
121 
122  design_pack_task = create_enzdes_pack_task( pose, false );
123 
124  if( basic::options::option[basic::options::OptionKeys::enzdes::cst_min] ){
125  remove_enzdes_constraints( pose, true );
126  cst_minimize(pose, design_pack_task);
128  }
129  (*scorefxn_)( pose );
130 
131  } //if cst_design
132 
133  else if( basic::options::option[basic::options::OptionKeys::enzdes::cst_min] ){
134 
135  design_pack_task = create_enzdes_pack_task( pose );
136 
137  cst_minimize(pose, design_pack_task);
138 
139  (*scorefxn_)( pose );
140  }
141 
142  if( basic::options::option[basic::options::OptionKeys::enzdes::make_consensus_mutations] ){
143 
144  simple_moves::ConsensusDesignMover consensus_mover( create_enzdes_pack_task( pose, false ), scorefxn_ );
145  consensus_mover.set_invert_task( true );
146  consensus_mover.set_use_seqprof_constraints( true );
147  consensus_mover.set_sasa_cutoff( 1.0 ); //let's prevent totally buried residues from being redesigned
148  consensus_mover.apply( pose );
149  }
150 
151  PackerTaskOP repack_task;
152 
153 
154  //do a repack without constraints
155  if( ! basic::options::option[basic::options::OptionKeys::enzdes::no_unconstrained_repack]){
156 
157  remove_enzdes_constraints( pose, true );
158  (*scorefxn_)( pose );
159  repack_task = create_enzdes_pack_task( pose, false ); //remake task in case the ligand has moved a lot
160  tr.Info << "Starting after design unconstrained repack/minimization... " << std::endl;
162  enzdes_repack->apply( pose );
163 
164  if(basic::options::option[basic::options::OptionKeys::enzdes::cst_min]) cst_minimize(pose, repack_task);
165 
166  //and turn constraints back on for the final scoring
168  tr.Info <<"Finished after design unconstrained repack/minimization... " << std::endl;
169 
170  (*scorefxn_)( pose );
171 
172  }
173 
174  if(basic::options::option[basic::options::OptionKeys::enzdes::cst_dock] ){
175 
176 
177  //note: this is not really ready to go yet, still to be developed
178  //to do: write a wrapper that executes the docking protocol a number
179  //of times, either till a maximum number of decoys is produced, or
180  //until a decoy is found that has a better energy than the designed pose
181 
182  tr.Info << "Starting ligand docking... " << std::endl;
183  remove_enzdes_constraints( pose, false );
184  //write stuff for ligand docking protocol
186  dock_lig_protocol->apply( pose );
187 
189  (*scorefxn_)( pose );
190 
191  }
192 
193 
194 } //apply function
195 
196 
199  return "EnzdesFixBBProtocol";
200 }
201 
202 void
204 {
205  using namespace basic::options;
206 
207  option.add_relevant( OptionKeys::enzdes::cstfile );
208  option.add_relevant( OptionKeys::enzdes::cst_opt );
209  option.add_relevant( OptionKeys::enzdes::cst_predock );
210 
212 
213  option.add_relevant( OptionKeys::enzdes::cst_design );
214  option.add_relevant( OptionKeys::enzdes::design_min_cycles );
215  option.add_relevant( OptionKeys::enzdes::no_unconstrained_repack );
216 
217  option.add_relevant( OptionKeys::in::file::pssm);
218 }
219 
220 } //namespace enzdes
221 } //namespace protocols
222