Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DockAndRetrieveSidechains.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 
11 /// @file protocols/protein_interface_design/movers/DockAndRetrieveSidechains.cc
12 /// @brief
13 /// @author Sarel Fleishman (sarelf@u.washington.edu), Jacob Corn (jecorn@u.washington.edu)
14 
15 // Unit headers
18 
20 #include <utility/tag/Tag.hh>
30 // AUTO-REMOVED #include <core/pack/task/PackerTask.hh>
31 #include <utility/string_util.hh>
33 
35 #include <basic/Tracer.hh>
36 #include <utility/vector0.hh>
37 #include <utility/vector1.hh>
38 
39 
40 namespace protocols {
41 namespace protein_interface_design {
42 namespace movers {
43 
44 using namespace core;
45 using namespace std;
46 using namespace core::scoring;
47 using namespace protocols::moves;
48 
49 static basic::Tracer TR( "protocols.protein_interface_design.movers.DockAndRetrieveSidechains" );
50 
53 {
55 }
56 
59  return new DockAndRetrieveSidechains;
60 }
61 
64 {
65  return "Docking";
66 }
67 
69  protocols::moves::Mover( DockAndRetrieveSidechainsCreator::mover_name() )
70 {}
71 
73 
76  return( protocols::moves::MoverOP( new DockAndRetrieveSidechains( *this ) ) );
77 }
78 
79 void
81 {
82  // If the pose is not symmetric, then make it so
83  if ( symmetry_ ) {
85  setup_mover->apply( pose );
86  }
87 
88  core::pose::PoseCOP saved_pose = new core::pose::Pose( pose );
89  core::kinematics::FoldTree saved_ft( pose.fold_tree() );
90 
91  if ( symmetry_ ) {
92  sym_docking_mover_->set_native_pose( saved_pose );
93  sym_docking_mover_->set_input_pose( saved_pose );
94  sym_docking_mover_->apply( pose );
95  //set_last_move_status( sym_docking_mover_->get_last_move_status() ); might be needed
96  } else {
97  docking_mover_->set_native_pose( saved_pose );
98  docking_mover_->set_input_pose( saved_pose );
99  docking_mover_->apply( pose );
100  //Allow this mover to see the status of DockingProtocol because it can fail and that failure needs to be known by this mover.
101  set_last_move_status( docking_mover_->get_last_move_status() );
102  }
103 
104  if( low_res_protocol_only_ ) {
106  protocols::simple_moves::ReturnSidechainMover recover_sidechains( *saved_pose );
107  to_all_atom.apply( pose );
108  recover_sidechains.apply( pose );
110  }
111  if (conserve_foldtree_) pose.fold_tree( saved_ft );
112 
113 }
114 
115 
119 }
120 
121 void
123 {
124  std::string const score_low( tag->getOption<string>( "score_low", "score_docking_low" ) );
125  std::string const score_high( tag->getOption<string>( "score_high", "score12" ) );
126  low_res_protocol_only_ = !tag->getOption< bool >( "fullatom", 0 );
127  conserve_foldtree_ = tag->getOption< bool >( "conserve_foldtree", 0 );
128  bool const local_refine( tag->getOption<bool>( "local_refine", 0 ));
129  bool const view( tag->getOption<bool>( "view", 0 ) );
130  bool const design( tag->getOption<bool>( "design", 0 ) );
131  symmetry_ = tag->getOption<bool>( "symmetry", 0 );
132  //allow replacement of the default DockingTask with whatever you give it. Does not work with symmetry yet.
133  bool const ignore_default_docking_task( tag->getOption<bool>( "ignore_default_docking_task", 0 ) );
134 
135  if ( symmetry_ ) {
136  using namespace core::scoring::symmetry;
137  ScoreFunctionOP scorelo = new SymmetricScoreFunction( *data.get< ScoreFunction * >( "scorefxns", score_low ) );
138  ScoreFunctionOP scorehi = new SymmetricScoreFunction( *data.get< ScoreFunction * >( "scorefxns", score_high ));
139 
140  sym_docking_mover_ = new protocols::symmetric_docking::SymDockProtocol( !low_res_protocol_only_, local_refine, view, scorelo, scorehi );
141 
143  sym_docking_mover_->design( design );
144  TR << "symmetric docking mover with parameters low_res_protocol_only_ " << low_res_protocol_only_ << " local_refine " << local_refine
145  << " view "<< view << " lowres_scorefxn= " << score_low
146  << " highres_scorefxn= " << score_high << std::endl;
147  return;
148  }
149 
150  using namespace core::scoring;
151  ScoreFunctionOP scorelo = new ScoreFunction( *data.get< ScoreFunction * >( "scorefxns", score_low ) );
152  ScoreFunctionOP scorehi = new ScoreFunction( *data.get< ScoreFunction * >( "scorefxns", score_high ));
153 
154  utility::vector1<std::string> jumps_str = utility::string_split( tag->getOption<string>( "jumps", "1" ), ',' );
155  utility::vector1<core::Size> movable_jumps;
156  for( utility::vector1<std::string>::const_iterator it = jumps_str.begin(); it != jumps_str.end(); ++it ) {
157  //movable_jumps.push_back( std::strtoul( *it, NULL, 0 ));
158  movable_jumps.push_back( std::atoi( it->c_str() ));
159  }
160  //core::Size const rb_jump( tag->getOption< core::Size >( "rb_jump", 1 ) );
161  bool const optimize_foldtree = tag->getOption<bool>( "optimize_fold_tree", 1 );
162  docking_mover_ = new protocols::docking::DockingProtocol( movable_jumps, low_res_protocol_only_, local_refine, optimize_foldtree, scorelo, scorehi );
163 
164  docking_mover_->set_task_factory( protocols::rosetta_scripts::parse_task_operations( tag, data ) );
165  docking_mover_->set_ignore_default_docking_task( ignore_default_docking_task );
166  // //debugging
167  // core::pack::task::TaskFactoryOP tf_debug(protocols::rosetta_scripts::parse_task_operations( tag, data ) );
168  // std::cout << "DockAndRetrieveSidechains task : \n" << *(tf_debug->create_task_and_apply_taskoperations( pose ) ) << std::endl;
169 
170  docking_mover_->set_design( design );
171  TR<<"docking mover with parameters low_res_protocol_only_ "<< low_res_protocol_only_ <<" local_refine "<<local_refine<<" view "<<view<< " lowres_scorefxn= " << score_low <<
172  " highres_scorefxn= " << score_high<<" over rb_jumps ";
173  for( utility::vector1<core::Size>::const_iterator it = movable_jumps.begin(); it != movable_jumps.end(); ++it ) {
174  TR << *it << ",";
175  }
176  TR << " optimize fold tree="<<optimize_foldtree<<std::endl;
177 }
178 
179 
180 } //movers
181 } //protein_interface_design
182 } //protocols