Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SymMinMover.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 // This file is part of the Rosetta software suite and is made available under license.
5 // The Rosetta software is developed by the contributing members of the Rosetta Commons consortium.
6 // (C) 199x-2009 Rosetta Commons participating institutions and developers.
7 // For more information, see http://www.rosettacommons.org/.
8 
9 /// @file MinMover.cc
10 /// @brief
11 /// @author ashworth
12 
13 // Unit headers
16 
17 // Package headers
18 
24 #include <core/scoring/ScoreFunctionFactory.hh> // getScoreFunction
25 #include <core/pose/Pose.fwd.hh>
26 #include <basic/prof.hh>
27 
28 // AUTO-REMOVED #include <utility/string_util.hh>
29 
31 // AUTO-REMOVED #include <core/conformation/symmetry/util.hh>
32 
33 // AUTO-REMOVED #include <protocols/moves/DataMap.hh>
34 // AUTO-REMOVED #include <protocols/rosetta_scripts/util.hh>
35 #include <utility/tag/Tag.hh>
36 
37 #include <basic/Tracer.hh>
38 
39 #include <utility/vector0.hh>
40 #include <utility/vector1.hh>
41 
42 // APL TEMP
45 #include <core/pose/Pose.hh>
46 
47 using basic::T;
48 using basic::Error;
49 using basic::Warning;
50 
51 static basic::Tracer TR("protocols.simple_moves.symmetry.SymMinMover");
52 
53 
54 namespace protocols {
55 namespace simple_moves {
56 namespace symmetry {
57 
58 using namespace core;
59 using namespace kinematics;
60 using namespace optimization;
61 using namespace scoring;
62 
63 // creator
67 }
68 
71  return new SymMinMover;
72 }
73 
76  return "SymMinMover";
77 }
78 
79 //////////////////////////
80 // default constructor
81 // proper lightweight default constructor
83  : protocols::simple_moves::MinMover() {}
84 
86  : protocols::simple_moves::MinMover(name) {}
87 
89 
90 // constructor with arguments
92  MoveMapOP movemap_in,
93  ScoreFunctionCOP scorefxn_in,
94  std::string const & min_type_in,
95  Real tolerance_in,
96  bool use_nb_list_in,
97  bool deriv_check_in /* = false */,
98  bool deriv_check_verbose_in /* = false */
99 ) :
100  protocols::simple_moves::MinMover(
101  movemap_in, scorefxn_in, min_type_in,
102  tolerance_in, use_nb_list_in,
103  deriv_check_in, deriv_check_verbose_in ) {}
104 
105 
106 
107 void
109 {
110  // lazy default initialization
111  core::kinematics::MoveMapOP symmetric_movemap;
112  if ( ! movemap() ) symmetric_movemap = new MoveMap;
113  else symmetric_movemap = movemap()->clone();
114 
115  apply_dof_tasks_to_movemap(pose, *symmetric_movemap);
116 
117  core::pose::symmetry::make_symmetric_movemap( pose, *symmetric_movemap ); // we do this here since this is the first time we meet the symmetric pose
118 
119  //{ // scope APL debug:
120  // std::cout << "SymMinMover free DOFs" << std::endl;
121  // core::conformation::symmetry::SymmetricConformation const & symm_conf (
122  // dynamic_cast< core::conformation::symmetry::SymmetricConformation const & > ( pose.conformation()) );
123  // core::conformation::symmetry::SymmetryInfoCOP symm_info( symm_conf.Symmetry_Info() );
124  // for (int jump_nbr = 1; jump_nbr <= (int)pose.num_jump(); ++jump_nbr) {
125  // if ( symmetric_movemap->get_jump( jump_nbr ) ) {
126  // std::cout << "SymMinMover jump " << jump_nbr << " is free" << std::endl;
127  // }
128  // }
129  //}
130 
131 
132  if ( ! score_function() ) score_function( getScoreFunction() ); // get a default (INITIALIZED!) ScoreFunction
133 
134  PROF_START( basic::MINMOVER_APPLY );
135  if (!cartesian( )) {
136  //TR << "Before minimization" << std::endl;
137  //score_function()->show( TR, pose );
138  //TR << std::endl;
140  (*score_function())(pose);
141  minimizer.run( pose, *symmetric_movemap, *score_function(), *min_options() );
142  //TR << "After minimization" << std::endl;
143  //score_function()->show( TR, pose );
144  //TR << std::endl;
145  } else {
147  (*score_function())(pose);
148  minimizer.run( pose, *symmetric_movemap, *score_function(), *min_options() );
149  }
150  PROF_STOP( basic::MINMOVER_APPLY );
151 }
152 
156 }
157 
160 
162  TagPtr const tag,
164  Filters_map const & filters,
165  protocols::moves::Movers_map const & movers,
166  Pose const & pose )
167 {
168  MinMover::parse_my_tag( tag, data, filters, movers, pose );
169 
170  // symm-specific options
171 }
172 
173 
174 } // symmetry
175 } // moves
176 } // protocols