Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SetupForSymmetryMover.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
18 
19 // AUTO-REMOVED #include <protocols/moves/DataMap.hh>
20 // AUTO-REMOVED #include <protocols/rosetta_scripts/util.hh>
21 #include <utility/tag/Tag.hh>
22 #include <utility/excn/Exceptions.hh>
23 
24 // Package headers
25 #include <core/pose/Pose.hh>
26 #include <core/pose/PDBInfo.hh>
28 
29 #include <basic/resource_manager/ResourceManager.hh>
30 #include <basic/resource_manager/util.hh>
31 
32 // AUTO-REMOVED #include <core/conformation/symmetry/util.hh>
33 
35 
36 
37 // ObjexxFCL Headers
38 
39 // C++ Headers
40 #include <string>
41 
42 // Utility Headers
43 #include <basic/Tracer.hh>
44 #include <basic/options/option.hh>
45 #include <basic/options/keys/symmetry.OptionKeys.gen.hh>
46 
47 #include <utility/vector0.hh>
48 #include <utility/vector1.hh>
49 
50 
51 namespace protocols {
52 namespace simple_moves{
53 namespace symmetry{
54 
55 static basic::Tracer TR("protocols.simple_moves.symmetry.SetupForSymmetryMover");
56 
57 // creators
61 }
62 
65  return new SetupForSymmetryMover;
66 }
67 
70  return "SetupForSymmetry";
71 }
72 
76 }
77 
80  return new ExtractAsymmetricUnitMover;
81 }
82 
85  return "ExtractAsymmetricUnit";
86 }
87 
88 ////////////////////
89 
93 }
94 
97  return new ExtractAsymmetricPoseMover;
98 }
99 
102  return "ExtractAsymmetricPose";
103 }
104 
105 ////////////////////
106 
107 
109  protocols::moves::Mover("SetupForSymmetryMover"),
110  slide_(false),
111  symmdef_()
112 {
113 }
114 
116  protocols::moves::Mover("SetupForSymmetryMover"),
117  slide_(false),
118  symmdef_()
119 {
121  symmdef_->read_symmetry_data_from_file(symmdef_file);
122 }
123 
125 
126 void
128 {
129  using namespace basic::options;
130 
131  // If we are alredy symmetric do nothing
132  if ( core::pose::symmetry::is_symmetric( pose ) ) return;
133 
134  if(!symmdef_()){
135  if(option[ OptionKeys::symmetry::symmetry_definition].user()){
137  symmdef_->read_symmetry_data_from_file(
138  option[OptionKeys::symmetry::symmetry_definition]);
139 
140  } else {
141  throw utility::excn::EXCN_BadInput(
142  "The -symmetry:symmetry_definition command line option "
143  "was not specified.");
144  }
145  }
146 
147 
149  assert( core::pose::symmetry::is_symmetric( pose ) );
150 
151  //fpd explicitly update disulfide lr energy container
152  if ( pose.is_fullatom() ) {
154  disulf_score.set_weight( core::scoring::dslf_ss_dst, 1.0 );
155  disulf_score.setup_for_scoring( pose );
156  }
157 
158  // (Optionally) set rigid-body dofs from file
159  // SymDockingInitialPerturbation's behavior is controlled by flags and does nothing by default
160  protocols::moves::MoverOP symdock =
162  symdock->apply( pose );
163 }
164 
166  utility::tag::TagPtr const tag,
167  moves::DataMap & /*data*/,
168  filters::Filters_map const & /*filters*/,
169  moves::Movers_map const & /*movers*/,
170  core::pose::Pose const & /*pose*/ ) {
171 
172  using namespace basic::options;
173  using namespace basic::resource_manager;
174 
175  if(tag->hasOption("definition") && tag->hasOption("resource_description")){
176  throw utility::excn::EXCN_BadInput(
177  "SetupForSymmetry takes either a 'definition' OR "
178  "a 'resource_description' tag but not both.");
179  }
180 
181  if(tag->hasOption("definition")){
183  symmdef_->read_symmetry_data_from_file(
184  tag->getOption<std::string>("definition"));
185  option[OptionKeys::symmetry::symmetry_definition].value( "dummy" );
186 
187  } else if(tag->hasOption("resource_description")){
188  symmdef_ = get_resource< core::conformation::symmetry::SymmData >(
189  tag->getOption<std::string>("resource_description"));
190  option[OptionKeys::symmetry::symmetry_definition].value( "dummy" );
191 
192  } else if(option[ OptionKeys::symmetry::symmetry_definition].user()){
194  symmdef_->read_symmetry_data_from_file(
195  option[OptionKeys::symmetry::symmetry_definition]);
196 
197  } else {
198  throw utility::excn::EXCN_BadInput(
199  "To use SetupForSymmetryMover with rosetta scripts please supply either a 'definition' tag, a 'resource_decription' tag or specify -symmetry:symmetry_definition the command line.");
200  }
201 }
202 
206 }
207 
208 ////////////////////
209 
211  : protocols::moves::Mover("ExtractAsymmetricUnitMover") { }
212 
214 
215 void
217 {
218  // If we are not symmetric do nothing
219  if ( !core::pose::symmetry::is_symmetric( pose ) ) return;
220 
221  core::pose::Pose pose_asu;
223  pose = pose_asu;
224 }
225 
227  utility::tag::TagPtr const /*tag*/,
228  moves::DataMap & /*data*/,
229  filters::Filters_map const & /*filters*/,
230  moves::Movers_map const & /*movers*/,
231  core::pose::Pose const & /*pose*/ ) { }
232 
236 }
237 
238 /////////////////
239 
241  : protocols::moves::Mover("ExtractAsymmetricPoseMover") { }
242 
244 
245 
246 void
248 {
249  // If we are not symmetric do nothing
250  if ( !core::pose::symmetry::is_symmetric( pose ) ) return;
251 
253 }
254 
256  utility::tag::TagPtr const /*tag*/,
257  moves::DataMap & /*data*/,
258  filters::Filters_map const & /*filters*/,
259  moves::Movers_map const & /*movers*/,
260  core::pose::Pose const & /*pose*/ ) { }
261 
265 }
266 
267 
268 } //symmetry
269 } // simple_moves
270 } // protocols