Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RestrictResiduesToRepackingOperation.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 under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file protocols/toolbox/task_operations/RestrictResiduesToRepackingOperation.cc
11 /// @brief
12 /// @author Eva-Maria Strauch (evas01@uw.edu)
13 
14 // Unit Headers
17 
18 // Project Headers
19 // AUTO-REMOVED #include <core/pose/Pose.hh>
20 
21 // AUTO-REMOVED #include <core/pack/task/PackerTask.hh>
23 
24 
25 // Utility Headers
26 #include <core/types.hh>
27 #include <basic/Tracer.hh>
28 #include <utility/exit.hh>
29 // AUTO-REMOVED #include <core/conformation/Conformation.hh>
30 #include <utility/tag/Tag.hh>
31 
32 #include <boost/foreach.hpp>
33 #define foreach BOOST_FOREACH
34 
35 // C++ Headers
36 // AUTO-REMOVED #include <set>
37 
38 #include <utility/string_util.hh>
39 #include <utility/vector0.hh>
40 #include <utility/vector1.hh>
41 
42 //Auto Headers
44 #include <core/id/types.hh>
45 #include <core/kinematics/Jump.hh>
46 #include <boost/functional/hash.hpp>
47 
48 
49 
50 using basic::Error;
51 using basic::Warning;
52 static basic::Tracer TR( "protocols.toolbox.TaskOperations.RestrictResiduesToRepackingOperation" );
53 
54 namespace protocols {
55  namespace toolbox {
56  namespace task_operations {
57 
58  using namespace core::pack::task::operation;
59 
60 
62 
64  : parent(), residues_( residues )
65  {
66  }
67 
69 
72  {
74  }
75 
77  {
78  return new RestrictResiduesToRepackingOperation( *this );
79  }
80 
81 
82  void
84  {
85  runtime_assert( residues_.size() != 0 );
86 
88  for( core::Size i = 1; i<=residues_.size(); ++i ){
89  TR.Debug << "TASKOPERATION: restrict to repacking: " << residues_[i] << std::endl;
90  rrtr.include_residue( residues_[i] );
91  }
92  rrtr.apply( pose, task );
93  }
94 
95 
98  {
99  return residues_;
100  }
101 
102  void
104  {
105  runtime_assert( residues_vec.size() != 0 );
106  residues_.clear();
107  foreach( core::Size const item, residues_vec )
108  residues_.push_back( item );
109  }
110 
111  void
113  {
114  unparsed_residues_ = tag->getOption< std::string >( "residues" ) ;
115  if( unparsed_residues_ != "" ){
116 
117  utility::vector1< std::string > const res_keys( utility::string_split( unparsed_residues_ , ',' ) );
118  utility::vector1< core::Size > residues_vector;
119  residues_.clear();
120 
121  foreach( std::string const key, res_keys ){
122  Size const res( utility::string2int( key ) );
123  TR.Debug<<"not designing residue: "<< key <<std::endl;
124  residues_.push_back( res );
125  }
126  }
127  }
128 
129  } //namespace protocols
130  } //namespace toolbox
131 } //namespace task_operations