Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
homodimer_design.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 /src/apps/public/scenarios/beta_strand_homodimer_design/homodimer_design.cc
11 /// @brief Symmetric homodimer design
12 
13 
14 // Unit headers
15 //none
16 
17 // devel headers
18 #include <devel/init.hh>
19 
20 //core headers
21 #include <core/pose/Pose.hh>
22 #include <core/import_pose/import_pose.hh>
23 #include <core/pose/metrics/CalculatorFactory.hh>
24 #include <core/conformation/Conformation.hh>
25 #include <core/kinematics/MoveMap.hh>
26 #include <core/kinematics/FoldTree.hh>
27 #include <core/pack/task/operation/TaskOperations.hh>
28 #include <core/pack/task/PackerTask.hh>
29 #include <core/pack/task/TaskFactory.hh>
30 
31 #include <core/scoring/ScoreFunction.hh>
32 #include <core/scoring/ScoreFunctionFactory.hh>
33 #include <core/scoring/methods/EnergyMethodOptions.hh>
34 #include <core/scoring/rms_util.tmpl.hh>
35 #include <core/scoring/rms_util.hh>
36 #include <core/scoring/hbonds/HBondOptions.hh>
37 #include <core/scoring/hbonds/hbonds.hh>
38 #include <core/scoring/hbonds/HBondSet.hh>
39 #include <core/scoring/dssp/Dssp.hh>
40 #include <core/scoring/constraints/Constraint.hh>
41 #include <core/scoring/constraints/ResidueTypeConstraint.hh>
42 #include <core/scoring/ScoreType.hh>
43 
44 //basic
45 #include <basic/MetricValue.hh>
47 #include <basic/Tracer.hh>
48 
49 //protocols
50 #include <protocols/moves/Mover.hh>
51 #include <core/pose/metrics/simple_calculators/InterfaceNeighborDefinitionCalculator.hh>
52 #include <protocols/toolbox/task_operations/RestrictToInterfaceOperation.hh>
53 #include <protocols/protein_interface_design/movers/BuildAlaPose.hh>
54 #include <protocols/protein_interface_design/movers/SaveAndRetrieveSidechains.hh>
55 #include <protocols/simple_moves/ddG.hh>
56 //#include <protocols/moves/PymolMover.hh>
57 //symmetry
58 #include <protocols/symmetric_docking/SymDockProtocol.hh>
59 #include <protocols/simple_moves/symmetry/SetupForSymmetryMover.hh>
60 #include <protocols/simple_moves/symmetry/SymMinMover.hh>
61 #include <protocols/simple_moves/symmetry/SymPackRotamersMover.hh>
62 #include <core/scoring/symmetry/SymmetricScoreFunction.hh>
63 
64 //JD2
65 #include <protocols/jd2/JobDistributor.hh>
66 #include <protocols/jd2/Job.hh>
67 
68 
69 // option key includes
70 #include <basic/options/keys/run.OptionKeys.gen.hh>
71 #include <basic/options/option.hh>
72 #include <basic/options/keys/packing.OptionKeys.gen.hh>
73 #include <basic/options/keys/in.OptionKeys.gen.hh>
74 #include <basic/options/keys/symmetry.OptionKeys.gen.hh>
75 #include <basic/options/keys/enzdes.OptionKeys.gen.hh>
76 
77 // Utility Headers
78 #include <utility/vector1.hh>
79 
80 // C++ headers
81 #include <sstream>
82 #include <iostream>
83 #include <string>
84 
85 //Auto Headers
86 #include <utility/vector0.hh>
88 
89 using basic::Error;
90 using basic::Warning;
91 static THREAD_LOCAL basic::Tracer TR( "apps.public.beta_strand_homodimer_design.homodimer_design" );
92 
93 using namespace core;
94 using namespace utility;
95 using namespace protocols;
96 using namespace protocols::moves;
97 using namespace core::pack::task;
98 using namespace core::pack::task::operation;
99 using namespace basic::options;
100 using namespace basic::options::OptionKeys;
101 using namespace protocols::jd2;
102 using namespace core::pose::metrics;
103 
104 // Index for option[ OptionKeys::symmetry::perturb_rigid_body_dofs ] values
105 enum Index{
106  trans = 1,
107  rot = 2
108 };
109 
110 // application specific options
111 basic::options::BooleanOptionKey const make_ala_interface( "make_ala_interface" );
112 basic::options::IntegerOptionKey const pack_min_runs( "pack_min_runs" );
113 basic::options::BooleanOptionKey const find_bb_hbond_E( "find_bb_hbond_E" );
114 basic::options::BooleanOptionKey const skip_hd_docking( "skip_hd_docking" );
115 basic::options::StringOptionKey const disallow_res( "disallow_res" );
116 //basic::options::BooleanOptionKey const pymolreport( "pymolreport" );
117 
118 // mover deffinition
119 class HDdesignMover : public Mover {
120 public:
121 
122  HDdesignMover();
123 
124  virtual void apply( core::pose::Pose& pose );
125 
126  virtual ~HDdesignMover(){};
127 
128  void cloak_and_setup(core::pose::Pose & pose);
129 
130  void task_constraint_setup(core::pose::Pose & pose );
131 
132  void sym_repack_minimize(core::pose::Pose & pose );
133 
134  void register_calculators();
135 
136  void ala_interface(core::pose::Pose & pose);
137 
138  core::Real calc_bb_E(core::pose::Pose & pose,
139  core::scoring::symmetry::SymmetricScoreFunctionOP scorefxn);
140 
141  virtual MoverOP clone() const {
142  return MoverOP( new HDdesignMover( *this ) );
143  }
144 
145  virtual MoverOP fresh_instance() const {
146  return MoverOP( new HDdesignMover );
147  }
148  virtual
149  std::string
150  get_name() const {
151  return "HDdesignMover";
152  }
153 
154 private:
155  //init on new input control
156  //bool init_new_input_;
157  core::scoring::ScoreFunctionOP scorefxn_a;
158  core::scoring::symmetry::SymmetricScoreFunctionOP scorefxn_;
159  TaskFactoryOP tf_design_;
160  //kinematics::MoveMapOP movemap_;
161  pack::task::PackerTaskOP task_design_;
163  bool ala_interface_, find_bb_binding_E_, skip_hd_docking_;// pymolreport_;
165  std::string disallow_res_;
166 
167 
168  //alanine interface movers
169  protocols::protein_interface_design::movers::BuildAlaPoseOP build_ala_mover_;
170  protocols::protein_interface_design::movers::SaveAndRetrieveSidechainsOP get_sidechains_mover_;
171  //calculators
172  /// @brief InterfaceNeighborDefinition calculator name string
174  //other movers
175  //devel::anchored_design::InterfaceAnalyzerMoverOP interface_mover_;
176 
177 };
178 
180  // variable definitions
181  scorefxn_a = core::scoring::get_score_function();
182  scorefxn_ = core::scoring::symmetry::symmetrize_scorefunction( *scorefxn_a );
183  tf_design_ = TaskFactoryOP( new TaskFactory() );
184  //movemap_ = new core::kinematics::MoveMap();
185  //options
186  ala_interface_ = option[ make_ala_interface];
187  n_pack_min_runs_ = option[ pack_min_runs ];
188  find_bb_binding_E_ = option[ find_bb_hbond_E ];
189  disallow_res_ = option[ disallow_res ];
190  skip_hd_docking_ = option[ skip_hd_docking ];
191  //pymolreport_ = option[ pymolreport ];
192  //EM options for bb-bb hbond output
193  //scoring::methods::EnergyMethodOptions energymethodoptions( scorefxn_->energy_method_options() );
194  //energymethodoptions.hbond_options()->decompose_bb_hb_into_pair_energies(true);
195  //scorefxn_->set_energy_method_options( energymethodoptions );
196 
197 }
198 
199 
201 
202  //cloak symmetry::perturb_rigid_body_dofs
203  if ( basic::options::option[ OptionKeys::symmetry::perturb_rigid_body_dofs ].user() ) {
204  TR<< "Cloaking option[ OptionKeys::symmetry::perturb_rigid_body_dofs ] before setup." <<std::endl;
205  utility::vector1< Real > pert_mags = basic::options::option[ OptionKeys::symmetry::perturb_rigid_body_dofs ]();
206  TR << "Input symmetry::perturb_rigid_body_dofs rot=" << pert_mags[rot] << " trans=" << pert_mags[trans] << std::endl;
207  vector1<Real> zero_vector;
208  zero_vector.push_back(0.0);
209  zero_vector.push_back(0.0);
210  basic::options::option[ OptionKeys::symmetry::perturb_rigid_body_dofs ].value(zero_vector);
211  //setup apply
212  protocols::simple_moves::symmetry::SetupForSymmetryMoverOP setup_mover( new protocols::simple_moves::symmetry::SetupForSymmetryMover );
213  setup_mover->apply(pose);
214  //uncloak
215  basic::options::option[ OptionKeys::symmetry::perturb_rigid_body_dofs ].value(pert_mags);
216  } else {
217  //setup apply
218  protocols::simple_moves::symmetry::SetupForSymmetryMoverOP setup_mover( new protocols::simple_moves::symmetry::SetupForSymmetryMover );
219  setup_mover->apply(pose);
220  }
221 
222 
223 }//end cloak_and_setup
224 
226  Size const chain1(1), chain2(2);
227  //Interface calculator should only have 2 chains here.
228  InterfaceNeighborDefinition_ = "InterfaceNeighborCalc";
229  if ( CalculatorFactory::Instance().check_calculator_exists( InterfaceNeighborDefinition_ ) ) {
230  TR << "In InterfaceNeighborCalc, calculator " << InterfaceNeighborDefinition_
231  << " already exists." << std::endl;
232  } else {
233  CalculatorFactory::Instance().register_calculator(
234  InterfaceNeighborDefinition_,
235  PoseMetricCalculatorOP( new core::pose::metrics::simple_calculators::InterfaceNeighborDefinitionCalculator(chain1, chain2) ));
236  //TR<<"Registering calculator " << InterfaceNeighborDefinition_ << std::endl;
237  }
238 }//end register_calculators
239 
241 
242  //allowed_aas_[ chemical::aa_cys ] = false;
243  //task factory setup
244  tf_design_->clear();
245  tf_design_->push_back( TaskOperationCOP( new InitializeFromCommandline() ) );
246  tf_design_->push_back( TaskOperationCOP( new operation::IncludeCurrent ) );
247  //if using a resfile ignore all other task restrictions
248  if ( basic::options::option[basic::options::OptionKeys::packing::resfile].user() ) {
249  TR << "Using resfile, ignoring all other task info" << std::endl;
250  tf_design_->push_back( TaskOperationCOP( new operation::ReadResfile() ) );
251  } else {
252  if ( option[ disallow_res ].user() ) {
253  TR << "Not allowing residues: " << disallow_res_ << " unless native" << std::endl;
254  DisallowIfNonnativeOP disallow_op( new DisallowIfNonnative() );
255  disallow_op->disallow_aas(disallow_res_);
256  tf_design_->push_back(disallow_op);
257  }
258 
259  //restrict to interface
260  tf_design_->push_back( TaskOperationCOP( new protocols::toolbox::task_operations::RestrictToInterfaceOperation( InterfaceNeighborDefinition_ ) ) );
261  }
262 
263 
264  //apply any constraints
265  if ( option[OptionKeys::enzdes::favor_native_res].user() ) {
267  using namespace core::scoring::constraints;
268  core::Real bonus = option[OptionKeys::enzdes::favor_native_res].value();
269  TR << "favor_native_res: adding a bonus of " << bonus << " for native residues to pose." << std::endl;
270  // //safety check first
271  // if( favor_native_constraints.size() != 0 ){
272  // TR << "Warning: when setting up favor native constraints, there might already be some previously generated favor_native constraints in the pose, trying to remove these first." << std::endl;
273  // favor_native_constraints.clear();
274  // }
275  for ( core::Size i = 1; i <= pose.total_residue(); ++i ) {
276  ConstraintOP resconstraint( new ResidueTypeConstraint( pose, i, bonus ) );
277  favor_native_constraints.push_back( resconstraint );
278  }
279  //adds to pose and scorefxn
280  pose.add_constraints( favor_native_constraints );
281  scorefxn_->set_weight( core::scoring::res_type_constraint, 1.0 ); //weight of 1.0 means that all is controled by favor_native_res flag
282  }
283 
284 
285  //now make the movemap symmetric so it will work and not break the pose
286  //shouldn't need to do this...
287  //core::pose::symmetry::make_symmetric_movemap( pose, *movemap_ );
288 
289 }//end task_constraint_setup
290 
292  //need to setup the movemap her to correspond to what is at the interface currently
293  //calc interface for
295  pose.metric( InterfaceNeighborDefinition_, "interface_residues", interface_mv);
296 
297 #ifndef NDEBUG
298  std::set< Size > interface_set = ( interface_mv.value() );
299  TR<< "Interface residues are: \n";
300  for ( std::set< core::Size >::const_iterator it(interface_set.begin()), end(interface_set.end());
301  it != end; ++it ) {
302  TR << *it << ", ";
303  }
304  TR << std::endl;
305  TR<< "Fold tree for pose: \n" << pose.fold_tree() << std::endl;
306 #endif
307 
308  //std::set< Size > interface_set = ( interface_mv.value() );
309  kinematics::MoveMapOP mm( new kinematics::MoveMap );
310  mm->set_bb( true ); mm->set_chi( true ); mm->set_jump( true );
311  // make_symmetric_movemap( pose, *mm );
312 
313  // SymAtomTreeMinimizer minimizer;
314  // MinimizerOptionsOP min_options = new MinimizerOptions( "dfpmin", 0.00001, true, false, false );
315  // minimizer.run( pose, *mm, *scorefxn, *min_options );
316 
317 
318  // //setup move map
319  // //set move map to allow bb and sc minimization for interface residues
320  // movemap_->clear();
321  // movemap_->set_jump(true);
322  // //movemap_->set_bb(false); //this works while setting individual doesn't
323  // for( Size ii=1; ii<= pose.total_residue(); ++ii){
324  // if( interface_set.count(ii) ){
325  // movemap_->set_bb(ii, true);
326  // movemap_->set_chi(ii, true);
327  // }
328  // else{
329  // movemap_->set_bb(ii, false);
330  // movemap_->set_chi(ii, false);
331  // }
332  // } //end the movemap creation
333 
334 
335  protocols::simple_moves::symmetry::SymMinMoverOP sym_minmover( new protocols::simple_moves::symmetry::SymMinMover(mm, scorefxn_, option[ OptionKeys::run::min_type ].value(), 0.001, true /*use_nblist*/ ) );
336 
337  task_design_ = tf_design_->create_task_and_apply_taskoperations( pose );
338  protocols::simple_moves::symmetry::SymPackRotamersMoverOP sym_pack_design( new protocols::simple_moves::symmetry::SymPackRotamersMover(scorefxn_, task_design_) );
339 
340  TR<< "Monomer total residues: "<< monomer_nres_ << " Repacked/Designed residues: "
341  << task_design_->num_to_be_packed() / 2 << std::endl;
342 
343 #ifndef NDEBUG
344  TR<< "DESIGN Packer Task after setup: " << *(task_design_) <<std::endl;
345 #endif
346 
347  TR<< "Number of repack/minimize runs to do: " << n_pack_min_runs_ << std::endl;
348  TR << "Minimizing with: " << option[ OptionKeys::run::min_type ].value() << std::endl;
349  for ( int ii = 1; ii<= n_pack_min_runs_; ++ii ) {
350  sym_pack_design->apply(pose);
351  sym_minmover->apply(pose);
352  TR << "Run " << ii << " of " << n_pack_min_runs_ << " SCORE:"
353  << (* scorefxn_ )(pose) << std::endl;
354  }
355 }
356 
357 //mutate the interface to all alanine if needed
359  build_ala_mover_ = protocols::protein_interface_design::movers::BuildAlaPoseOP( new protocols::protein_interface_design::movers::BuildAlaPose( true, true, 8.0) ) ;
360  get_sidechains_mover_ = protocols::protein_interface_design::movers::SaveAndRetrieveSidechainsOP( new protocols::protein_interface_design::movers::SaveAndRetrieveSidechains(pose) );
361  build_ala_mover_->apply( pose );
362 } //end ala _interface
363 
364 ///////////////////////////////////////////////////////////////
365 //finds the bb-bb hbonding energy between chains and returns it
367  core::scoring::symmetry::SymmetricScoreFunctionOP scorefxn){
368 
369  using namespace core::scoring::hbonds;
370 
371  //make copies to avoid screwing up real score and pose
372  core::pose::Pose pose_copy ( pose );
373  core::scoring::symmetry::SymmetricScoreFunctionOP scorefxn_copy (scorefxn);
374  //set up dssp info
375  core::scoring::dssp::Dssp dssp( pose_copy );
376  dssp.insert_ss_into_pose( pose_copy );
377 
378  //EM options for bb-bb hbond output
379  scoring::methods::EnergyMethodOptions energymethodoptions( scorefxn_copy->energy_method_options() );
380  energymethodoptions.hbond_options().decompose_bb_hb_into_pair_energies(true);
381  scorefxn_copy->set_energy_method_options( energymethodoptions );
382 
383  //now score with everything set.
384  (*scorefxn_copy)(pose_copy);
385 
386  //figure out energy statistics
387  core::scoring::hbonds::HBondSet hbond_set;
388  Real bb_score(0.0);
389  Size n_hbonds (0);
390  //Real hb_wt( (*scorefxn_copy).get_weight(core::scoring::hbond_lr_bb) );
391  //find backbone hbonds for pdb
392  pose_copy.update_residue_neighbors();
393  fill_hbond_set( pose_copy,
394  false /*calc_deriv*/,
395  hbond_set,
396  true /*bb only*/ );
397  //call to try to resize bb_don/accept arrays
398  //need this for everything to work right
399  hbond_set.setup_for_residue_pair_energies(pose_copy);
400 
401  //itterate through all hbonds and figure out which ones are bb-bb betas
402  for ( Size ii=1; ii <= hbond_set.nhbonds(); ++ii ) {
403  HBond hbond ( hbond_set.hbond(ii) );
404  //now filter based on what we want
405  if ( hbond.don_hatm_is_backbone() && hbond.acc_atm_is_backbone() ) {
406  if ( pose_copy.chain( hbond.don_res() ) != pose_copy.chain( hbond.acc_res() ) ) {
407  if ( pose_copy.secstruct( hbond.don_res() ) == 'E' && pose_copy.secstruct( hbond.acc_res() ) =='E' ) {
408  bb_score += ( hbond.weight() * hbond.energy() );
409  ++n_hbonds;
410  }
411  }
412  }
413  }
414  TR << "Design has: "<< n_hbonds << " bb-bb hbonds with total evergy: " << bb_score << std::endl;
415 
416  //reset some things to prevent bad scoring outside of this
417  energymethodoptions.hbond_options().decompose_bb_hb_into_pair_energies(false);
418  scorefxn->set_energy_method_options( energymethodoptions );
419 
420  return bb_score;
421 }//end calc_bb_E
422 
423 /////////////////////////////////////////////////
424 // Actual mover apply
425 /////////////////////////////////////////////////
427 
428  // //for pymol viewing
429  // if( pymolreport_ ){
430  // protocols::moves::PyMolObserverOP pymol_ob = protocols::moves::AddPyMolObserver(pose, false, 0.1);
431  // }
432 
433  TR << "Homodimer Design start."<<std::endl;
434  //get job info
435  protocols::jd2::JobOP const job_me( JobDistributor::get_instance()->current_job() );
436  // std::string job_name (JobDistributor::get_instance()->job_outputter()->output_name( job_me ) );
437 
438  monomer_nres_ = pose.total_residue();
439 
440  //setup the symmetric pose and cloak it from option[ symmetry::perturb_rigid_body_dofs ]
441  //if need be.
442  cloak_and_setup( pose );
443 
444  //Factory & contraint setup, do based on the structure should be
445  register_calculators();
446  task_constraint_setup(pose);
447 
448  //debugging checks
449  //JobDistributor::get_instance()->job_outputter()->other_pose( job_me, pose, "setup_");
450 
451  //mutate interface residues to ALA if needed
452  if ( ala_interface_ ) {
453  TR << "Building Alanine at interface" <<std::endl;
454  ala_interface(pose);
455  }
456 
457 
458  ////////////////////////////////////////////////
459  //APPLY MOVERS
460  ////////////////////////////////////////////////
461 
462  //debugging
463  //kinematics::FoldTree ft (pose.fold_tree());
464  //TR << "Fold Tree for pose: \n" << ft << std::endl;
465 
466  //Docking first unless skipped
467  if ( !skip_hd_docking_ ) {
468  //using namespace core::scoring;
469  symmetric_docking::SymDockProtocolOP dock_mover( new symmetric_docking::SymDockProtocol );
470  dock_mover->apply(pose);
471  scoring::ScoreFunctionOP dock_score_apple = scoring::ScoreFunctionFactory::create_score_function( "docking", "docking_min" );
472  core::scoring::symmetry::SymmetricScoreFunctionOP sym_dock_score = core::scoring::symmetry::symmetrize_scorefunction( *dock_score_apple );
473  TR << "Docking SCORE final: " << (*sym_dock_score)(pose) << std::endl;
474  TR << "Default SCORE after docking: " << (*scorefxn_)(pose) << std::endl;
475  //debugging checks
476  //JobDistributor::get_instance()->job_outputter()->other_pose( job_me, pose, "postdock_");
477 
478  //Symmetric dock messes something up when it does centroid mode, repack whole protein if need be
479  //if( !option[ OptionKeys::docking::docking_local_refine ]() ){
480  TaskFactoryOP tf_nataa( new TaskFactory() );
481  tf_nataa->push_back( TaskOperationCOP( new InitializeFromCommandline() ) );
482  tf_nataa->push_back( TaskOperationCOP( new operation::IncludeCurrent ) );
483  //want to just repack the wt pose, NO design
484  RestrictResidueToRepackingOP repack_op( new RestrictResidueToRepacking() );
485  for ( Size ii = 1; ii<= pose.n_residue(); ++ii ) {
486  repack_op->include_residue( ii );
487  }
488  //fill task factory with these restrictions
489  tf_nataa->push_back( repack_op );
490  PackerTaskOP task_nataa = tf_nataa->create_task_and_apply_taskoperations( pose );
491  protocols::simple_moves::symmetry::SymPackRotamersMoverOP sym_pack_nataa( new protocols::simple_moves::symmetry::SymPackRotamersMover(scorefxn_, task_nataa) );
492  sym_pack_nataa->apply( pose );
493  TR << "Default SCORE after all NATAA repack: " << (*scorefxn_)(pose) << std::endl;
494  //JobDistributor::get_instance()->job_outputter()->other_pose( job_me, pose, "nataarepack_");
495  // }
496  }
497 
498  //retrieve if needed
499  if ( ala_interface_ ) {
500  //TR<< "Packing interface before recovering native residue" <<std::endl;
501  //sym_repack_minimize(pose);
502  TR<< "Replacing native sidechains." << std::endl;
503  get_sidechains_mover_->apply(pose);
504  }
505 
506 
507  //now repack/minimize
508  sym_repack_minimize(pose);
509  //debugging checks
510  //JobDistributor::get_instance()->job_outputter()->other_pose( job_me, pose, "postpackmin_");
511 
512  //final minimization step
513  kinematics::MoveMapOP mm( new kinematics::MoveMap );
514  mm->set_bb( true ); mm->set_chi( true ); mm->set_jump( true );
515  protocols::simple_moves::symmetry::SymMinMoverOP sym_minmover_final( new protocols::simple_moves::symmetry::SymMinMover( mm, scorefxn_, option[ OptionKeys::run::min_type ].value(), 0.01, true /*use_nblist*/ ) );
516  sym_minmover_final->apply(pose);
517  TR << "Final minimization SCORE:" << (* scorefxn_ )(pose) << std::endl;
518 
519  //output RMSD
521  Real rms(0.0);
522  pose::Pose native_pose; //native pose should be symmetry mate dimer!
523  core::import_pose::pose_from_pdb( native_pose, basic::options::option[ in::file::native ]());
524  // allow superposition because RB min is allowed
525  rms = scoring::CA_rmsd( native_pose, pose /*, 1, monomer_nres_ */ ) ;
526  job_me->add_string_real_pair("rms_sym", rms );
527  }
528 
529  //find ddg
530  protocols::simple_moves::ddGOP ddG_mover( new protocols::simple_moves::ddG( scorefxn_, 1 /*jump*/ /* , true */ ) ); //ddG autodetects symmetry now
531  ddG_mover->calculate(pose);
532  core::Real ddgvalue = ddG_mover->sum_ddG();
533  //some dirty filtering
534  if ( ddgvalue >= 0 ) {
535  set_last_move_status(protocols::moves::FAIL_RETRY);
536  } else {
537  job_me->add_string_real_pair("dGbind", ddgvalue);
538  }
539 
540 
541  //find bb-bb hbond E
542  if ( find_bb_binding_E_ ) {
543  Real bb_score (calc_bb_E( pose,scorefxn_));
544  job_me->add_string_real_pair("beta_int_E", bb_score );
545  //some dirty filtering
546  // if (bb_score >= 0)
547  //set_last_move_status(protocols::moves::FAIL_RETRY);
548  //else
549 
550  }
551  //score to be safe
552  (* scorefxn_ )(pose);
553 
554 }//end mover apply
555 
556 ////////////////////////////////////////////////
557 // Main
558 ////////////////////////////////////////////////
559 int
560 main( int argc, char * argv [] )
561 {
562  try {
563  option.add( make_ala_interface, "Make interface residues ALA." ).def(false);
564  option.add( pack_min_runs, "Number of runs of repack/minimize" ).def(1);
565  option.add( find_bb_hbond_E, "Find the energy of bb-bb interactions").def(false);
566  option.add( skip_hd_docking, "skips docking step and just does design").def(false);
567  //option.add( pymolreport, "Report to pymol observer").def(false);
568  option.add( disallow_res, "String of residues not allowed unless native").def("");
569 
570  // init
571  devel::init(argc, argv);
572 
573  protocols::jd2::JobDistributor::get_instance()->go( protocols::moves::MoverOP( new HDdesignMover ) );
574 
575  std::cout << "Done! -------------------------------"<< std::endl;
576  } catch ( utility::excn::EXCN_Base const & e ) {
577  std::cout << "caught exception " << e.msg() << std::endl;
578  return -1;
579  }
580 } //end main
std::string disallow_res_
utility::pointer::shared_ptr< Constraint > ConstraintOP
#define THREAD_LOCAL
basic::options::BooleanOptionKey const skip_hd_docking("skip_hd_docking")
virtual std::string const msg() const
Definition: EXCN_Base.hh:70
Automatic hidden index key for integer options.
TaskFactoryOP tf_design_
T const & value() const
Definition: MetricValue.hh:60
utility::keys::KeyLookup< KeyType >::const_iterator const_iterator
Key collection iterators.
vector0: std::vector with assert-checked bounds
virtual MoverOP clone() const
void init(int argc, char *argv[])
Command line init() version.
Definition: init.cc:23
basic::options::StringOptionKey const disallow_res("disallow_res")
BooleanOptionKey const user("options:user")
Definition: OptionKeys.hh:40
core::pose::Pose Pose
Definition: supercharge.cc:101
utility::keys::lookup::end< KeyType > const end
Automatic hidden index key for string options.
static THREAD_LOCAL basic::Tracer TR("apps.public.beta_strand_homodimer_design.homodimer_design")
void cloak_and_setup(core::pose::Pose &pose)
std::string InterfaceNeighborDefinition_
InterfaceNeighborDefinition calculator name string.
common derived classes for thrown exceptions
tuple scorefxn
Definition: PyMOL_demo.py:63
member1 value
Definition: Tag.cc:296
Tracer & Error(TracerPriority priority=t_error)
Predefined Error tracer.
Definition: Tracer.hh:395
virtual std::string get_name() const
protocols::protein_interface_design::movers::SaveAndRetrieveSidechainsOP get_sidechains_mover_
basic::options::BooleanOptionKey const make_ala_interface("make_ala_interface")
virtual ~HDdesignMover()
void sym_repack_minimize(core::pose::Pose &pose)
Tracer IO system.
Automatic hidden index key for boolean options.
rule< Scanner, options_closure::context_t > options
Definition: Tag.cc:377
basic::options::BooleanOptionKey const find_bb_hbond_E("find_bb_hbond_E")
Tracer & Warning(TracerPriority priority=t_warning)
Predefined Warning tracer.
Definition: Tracer.hh:398
string min_type
Definition: loops_kic.py:76
utility::options::OptionCollection option
OptionCollection global.
Definition: option.cc:45
tuple rms
Definition: loops_kic.py:130
core::scoring::ScoreFunctionOP scorefxn_a
list native
Definition: ContactMap.py:108
double Real
Definition: types.hh:39
basic::options::IntegerOptionKey const pack_min_runs("pack_min_runs")
protocols::protein_interface_design::movers::BuildAlaPoseOP build_ala_mover_
core::Real calc_bb_E(core::pose::Pose &pose, core::scoring::symmetry::SymmetricScoreFunctionOP scorefxn)
void register_calculators()
ocstream cout(std::cout)
Wrapper around std::cout.
Definition: ocstream.hh:287
vector1: std::vector with 1-based indexing
Class for handling user debug/warnings/errors. Use instance of this class instead of 'std::cout' for ...
Definition: Tracer.hh:134
void ala_interface(core::pose::Pose &pose)
pack::task::PackerTaskOP task_design_
virtual void apply(core::pose::Pose &pose)
Program options global and initialization function.
platform::Size Size
Definition: random.fwd.hh:30
int main(int argc, char *argv[])
virtual MoverOP fresh_instance() const
core::scoring::symmetry::SymmetricScoreFunctionOP scorefxn_
rule< Scanner, option_closure::context_t > option
Definition: Tag.cc:378
void task_constraint_setup(core::pose::Pose &pose)