Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DockMinMover.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;
2 // rm-trailing-spaces:t -*-
3 // vi: set ts=2 noet:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available
7 // under license.
8 // (c) The Rosetta software is developed by the contributing members of the
9 // Rosetta Commons.
10 // (c) For more information, see http://www.rosettacommons.org.
11 // Questions about this can be
12 // (c) addressed to University of Washington UW TechTransfer,
13 // email: license@u.washington.edu.
14 
15 /// @file docking_min_protocol
16 /// @brief
17 /// @author Robin A Thottungal (raugust1@jhu.edu)
18 
19 // Unit Headers
21 
22 // Project headers
25 
29 
30 #include <utility/vector1.hh>
31 
32 #include <basic/options/option.hh>
33 #include <basic/options/keys/docking.OptionKeys.gen.hh>
34 
35 
36 using namespace protocols::moves;
37 using namespace core;
38 
39 namespace protocols{
40 namespace docking{
41 
42 //@TODO create default values in empty constructor
43 DockMinMover::DockMinMover() : DockingHighRes()
44 {
45  //need to set this up with default values;
46  set_default();
47  mc_= new MonteCarlo( *scorefxn(), 0.8 );
50  minimize_trial_ = new TrialMover( min_mover, mc_ );
51 }
52 
54  DockJumps const movable_jumps,
56 ) : DockingHighRes(movable_jumps, scorefxn, scorefxn) {
57  //need to set this up with default values;
58  set_default();
59  mc_= new MonteCarlo( *scorefxn(), 0.8 );
62  minimize_trial_ = new TrialMover( min_mover, mc_ );
63 }
64 
65 
66 
67 //JQX: made a new constructor, which can take the mc_ object
69  DockJumps const movable_jumps,
72 ) : DockingHighRes(movable_jumps, scorefxn, scorefxn) {
73  //need to set this up with default values;
74  set_default();
75  mc_=mc;
78  minimize_trial_ = new TrialMover( min_mover, mc_ );
79 }
80 
81 
82 
83 
84 
86  DockJumps const movable_jumps,
89  std::string min_type,
90  core::Real min_tolerance,
91  bool nb_list,
93 ): DockingHighRes(movable_jumps, scorefxn, scorefxn) {
94  movemap_=movemap;
95  min_type_=min_type;
96  min_tolerance_=min_tolerance;
97  nb_list_=nb_list;
98  mc_=mc;
101  minimize_trial_ = new TrialMover( min_mover, mc_ );
102 }
103 
105 
107 
108  using namespace basic::options; //quick hack by rhiju
109  using namespace basic::options::OptionKeys::docking; // quick hack by rhiju -- later feed this in through dockingprotocol
110 
111  //sets up default movemap
113  movemap_->set_chi( false );
114  movemap_->set_bb( false );
115  for( DockJumps::const_iterator it = movable_jumps().begin(); it != movable_jumps().end(); ++it ) {
116  movemap_->set_jump( *it, true );
117  }
118 
119 
120  // perhaps call this dock_minimize_bb_res or something.
121  if ( option[ bb_min_res ].user() ){
122  utility::vector1< Size > const & min_res = option[ bb_min_res ]();
123  for ( Size n = 1; n <= min_res.size(); n++ ) movemap_->set_bb( min_res[n], true );
124  }
125  if ( option[ sc_min_res ].user() ){
126  utility::vector1< Size > const & min_res = option[ sc_min_res ]();
127  for ( Size n = 1; n <= min_res.size(); n++ ) movemap_->set_chi( min_res[n], true );
128  }
129 
130 
131  //sets up minimization parameters
132 // min_tolerance_ = 1.0; /////was 0.01, in r++ docking, it is actually 1.0!! with 0.02 as the "tight" tolerance
133 // JQX commented the line right above, the Legacy code use 0.01. Just want to match it
134  min_tolerance_ = 0.01; //JQX added this line
135  min_type_ = std::string( "dfpmin_armijo_nonmonotone" );
136  nb_list_ = true;
137 }
138 
140  // since mc_ object is created without a pose, this reset is required!
141  ( *scorefxn() )( pose );
142 // mc_->reset(pose); // JQX: I think it is not necessary
143  minimize_trial_->apply(pose);
144 }
145 
147  return "DockMinMover";
148 }
149 
150 }
151 }