Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SymPackRotamersMover.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
10 /// @brief
11 /// @author Ingemar Andre
12 
13 // Unit headers
16 
17 // Project headers
24 #include <core/pose/Pose.hh>
30 
32 // AUTO-REMOVED #include <core/conformation/symmetry/util.hh>
33 
34 // AUTO-REMOVED #include <protocols/moves/DataMap.hh>
35 // AUTO-REMOVED #include <protocols/rosetta_scripts/util.hh>
36 #include <utility/tag/Tag.hh>
37 
38 #include <basic/Tracer.hh>
39 using basic::T;
40 using basic::Error;
41 using basic::Warning;
42 
43 static basic::Tracer TR("protocols.simple_moves.symmetry.SymPackRotamersMover");
44 
45 // Utility Headers
46 #include <utility/exit.hh>
47 #include <utility/vector0.hh>
48 
49 #include <utility/vector1.hh>
50 
51 
52 namespace protocols {
53 namespace simple_moves {
54 namespace symmetry {
55 
58 
59 using namespace core;
60  using namespace pack;
61  using namespace task;
62  using namespace operation;
63  using namespace scoring;
64 
65 // creator
69 }
70 
73  return new SymPackRotamersMover;
74 }
75 
78  return "SymPackRotamersMover";
79 }
80 
81 //////////////////////////
82 /// PackRotamersMover
83 
85  : protocols::simple_moves::PackRotamersMover(),
86  sym_rotamer_sets_( new rotamer_set::symmetry::SymmetricRotamerSets() ),
87  symmetric_ig_(0)
88 {}
89 
90  // constructors with arguments
92  ScoreFunctionCOP scorefxn,
94  Size nloop
95 ) : protocols::simple_moves::PackRotamersMover( scorefxn, task, nloop ),
96  sym_rotamer_sets_( new rotamer_set::symmetry::SymmetricRotamerSets() ),
97  symmetric_ig_(0)
98 {}
99 
101 
103  : protocols::simple_moves::PackRotamersMover( other )
104 {
105  sym_rotamer_sets_ = new rotamer_set::symmetry::SymmetricRotamerSets();
106 
107 }
108 
109 /*void
110 SymPackRotamersMover::apply( pose::Pose & pose )
111 {
112  // jec update_residue_neighbors() required to update EnergyGraph (ensures graph_state == GOOD) when calling Interface.cc
113  pose.update_residue_neighbors();
114  // guarantee of valid ScoreFunction and PackerTask postponed until now
115 
116 // else assert( task_is_valid( pose ) );
117 
118  // get rotamers, energies
119  this->setup( pose );
120 
121  this->run( pose );
122 
123 }*/
124 
127  return "SymPackRotamersMover";
128 }
129 
131 {
132 
133  // jec update_residue_neighbors() required to update EnergyGraph (ensures graph_state == GOOD) when calling Interface.cc
135  // guarantee of valid ScoreFunction and PackerTask postponed until now
136  if ( score_function() == 0 ) {
137  Warning() << "undefined ScoreFunction -- creating a default one" << std::endl;
139  score_function( scfx );
140  }
141 
142  // if present, task_factory_ always overrides/regenerates task_
143  if ( task() != 0 ) {
144  symmetric_task_ = (task())->clone();
145  }
146  if ( task_factory() != 0 ) {
147  symmetric_task_ = task_factory()->create_task_and_apply_taskoperations( pose );
148  } else if ( task() == 0 ) {
149  Warning() << "undefined PackerTask -- creating a default one" << std::endl;
151  }
152  // in case PackerTask was not generated locally, verify compatibility with pose
153  //else runtime_assert( task_is_valid( pose ) );
155 
157 
159 }
160 
162 {
164 }
165 
166 void
168  pose::Pose & pose,
169  task::PackerTaskOP task
170 )
171 {
172  assert( pose::symmetry::is_symmetric( pose ) );
173  if( task->symmetrize_by_union() || task->symmetrize_by_intersection() ) return; // new machinery
174 
175  SymmetricConformation & SymmConf (
176  dynamic_cast<SymmetricConformation &> ( pose.conformation()) );
178 
179  utility::vector1<bool> allow_repacked( pose.total_residue(), false );
180  for (Size res=1; res <= pose.total_residue(); ++res ) {
181  if ( pose.residue(res).aa() != core::chemical::aa_vrt && symm_info->fa_is_independent(res) ) {
182  allow_repacked.at(res) = true;
183  }
184  }
185  task->restrict_to_residues( allow_repacked );
186 }
187 
190 
191 ///@brief parse XML (specifically in the context of the parser/scripting scheme)
192 void
194  TagPtr const tag,
196  Filters_map const &fm,
198  Pose const &pose )
199 {
200  PackRotamersMover::parse_my_tag( tag,data,fm,mm,pose );
201 }
202 
203 void SymPackRotamersMover::parse_def( utility::lua::LuaObject const & def,
204  utility::lua::LuaObject const & score_fxns,
205  utility::lua::LuaObject const & tasks,
207  PackRotamersMover::parse_def( def, score_fxns, tasks, cache);
208 }
209 
210 }
211 } // moves
212 } // protocols