Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RefineBetaBarrel.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
6 // (c) under license. The Rosetta software is developed by the contributing
7 // (c) members of the Rosetta Commons. For more information, see
8 // (c) http://www.rosettacommons.org. Questions about this can be addressed to
9 // (c) University of Washington UW TechTransfer, email:license@u.washington.edu
10 
11 /// @file protocols/antibody2/RefineBetaBarrel.cc
12 /// @brief Build a homology model of an antibody2
13 /// @detailed
14 ///
15 ///
16 /// @author Jianqing Xu (xubest@gmail.com)
17 
18 
19 #include <core/pose/PDBInfo.hh>
32 #include <protocols/docking/util.hh>
33 #include <basic/options/keys/docking.OptionKeys.gen.hh>
34 #include <basic/Tracer.hh>
36 #include <utility/vector1.hh>
39 #include <core/pose/util.hh>
40 
41 static basic::Tracer TR("protocols.antibody2.RefineBetaBarrel");
42 
43 using namespace core;
44 namespace protocols {
45 namespace antibody2 {
46 
47 
48 // default constructor
49 RefineBetaBarrel::RefineBetaBarrel() : Mover() {}
51 
52 
54  user_defined_ = false;
55  ab_info_ = antibody_info;
56 
57  init();
58 }
59 
61  core::scoring::ScoreFunctionCOP dock_scorefxn,
62  core::scoring::ScoreFunctionCOP pack_scorefxn) : Mover() {
63  user_defined_ = true;
64  ab_info_ = antibody_info;
65  dock_scorefxn_ = new core::scoring::ScoreFunction(*dock_scorefxn);
66  pack_scorefxn_ = new core::scoring::ScoreFunction(*pack_scorefxn);
67 
68  init();
69 }
70 
71 
73 
74  if(!user_defined_){
76  dock_scorefxn_->set_weight( core::scoring::chainbreak, 1.0 );
79  }
80 
81  repulsive_ramp_ = true;
82  sc_min_ = false;
83  rt_min_ = false;
84  LH_dock_jump_.push_back(1);
85 
86 }
87 
88 
89 
90 
92  TR<<" start finalize_setup function ..."<<std::endl;
93 
94  // add scores to map
95  ( *dock_scorefxn_ )( pose );
96 
97  // ************ MoveMap *************
99  *cdr_dock_map_=ab_info_->get_MoveMap_for_LoopsandDock(pose, *ab_info_->get_AllCDRs_in_loopsop(), false, true, 10.0);
100 
101 
102 
103 
104  // ************ TaskFactory ************
105  //set up sidechain movers for rigid body jump and loop & neighbors
106  using namespace core::pack::task;
107  using namespace core::pack::task::operation;
108  // selecting movable c-terminal residues
109  utility::vector1< bool> sc_is_flexible( pose.total_residue(), false );
110  select_loop_residues( pose, *(ab_info_->get_AllCDRs_in_loopsop()), true/*include_neighbors*/, sc_is_flexible);
111 
112  ObjexxFCL::FArray1D_bool loop_residues( pose.total_residue(), false );
113  for( Size i = 1; i <= pose.total_residue(); i++ ) {
114  loop_residues(i) = sc_is_flexible[i];
115  } // check mapping
116 
117  using namespace protocols::toolbox::task_operations;
118  if(!tf_){
119  tf_= setup_packer_task(pose);
120  tf_->push_back( new RestrictToInterface( LH_dock_jump_, loop_residues ) );
121  }
122 
123  core::pack::task::PackerTaskOP my_task2(tf_->create_task_and_apply_taskoperations(pose));
124  //TR<<*my_task2<<std::endl; //exit(-1);
125 
126 
127 
128  //************ FoldTree ************
129  pose.fold_tree( * ab_info_->get_FoldTree_AllCDRs_LHDock(pose) );
130  TR<<pose.fold_tree()<<std::endl;
131 
132 
133  //************ Variants ************
134  // JQX:
135  // 1. setting up the fold_tree doesn't automatically
136  // update the variants in residue_type
137  // 2. the variants you saw from the PackTask are not the
138  // same as the variants in residue_type
139  // 3. access the variants by a). pose.residue_type(i).variant_types()[1]
140  // b). pose.residue(i).type().variant_types()[1]
141 
142  loops::remove_cutpoint_variants( pose, true ); //remove first
143  loops::add_cutpoint_variants( pose ); // add back, based on the cutpoints defined by fold_tree
144 
145 /*
146  for (Size i=1; i<=pose.total_residue();i++) {
147  if (pose.residue(i).type().variant_types().size()>0){
148  TR<<"residue "<<i<<" "<< pose.residue(i).type().variant_types()[1]<<std::endl;
149  }
150  else{ TR<<"residue "<<i<<std::endl; }
151  }
152  exit(-1);
153 */
154  TR<<" finish finalize_setup function !!!"<<std::endl;
155 
156 }
157 
158 
159 
160 
162 
163  finalize_setup(pose);
164 
165  //JQX:
166  // the repulsive_ramp_ docking mover is very general now based on Jeff's request!
167  // it will be moved to DockingProtocol soon
168  // one must specify fold_tree and variants before using this mover
169  if(repulsive_ramp_) {
171  lh_repulsive_ramp_ -> set_move_map(cdr_dock_map_);
175  lh_repulsive_ramp_->apply(pose);
176  TR<<" finish repulsive ramping !"<<std::endl;
177  }
178 
179 
182  dock_mcm_protocol_ -> set_move_map(cdr_dock_map_);
185  dock_mcm_protocol_ -> apply(pose);
186 
187  TR<<" finish L_H Docking !"<<std::endl;
188  TR<<"FINISH BETA BARREL REFINEMENT STEP !! "<<std::endl;
189 }
190 
191 
192 
194  return "RefineBetaBarrel";
195 }
196 
198  tf_ = new pack::task::TaskFactory(*tf);
199 }
200 
202  dock_scorefxn_ = new core::scoring::ScoreFunction(*dock_scorefxn);
203 }
204 
206  pack_scorefxn_ = new core::scoring::ScoreFunction(*pack_scorefxn);
207 }
208 
209 
210 
211 
212 }// namespace antibody2
213 }// namespace protocols
214