Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PreventResiduesFromRepackingOperation.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/PreventResiduesFromRepackingOperation.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 #include <boost/foreach.hpp>
25 #define foreach BOOST_FOREACH
26 
27 // Utility Headers
28 #include <core/types.hh>
29 #include <basic/Tracer.hh>
30 #include <utility/exit.hh>
31 // AUTO-REMOVED #include <core/conformation/Conformation.hh>
32 #include <utility/tag/Tag.hh>
33 
34 // C++ Headers
35 // AUTO-REMOVED #include <set>
36 
37 #include <utility/string_util.hh>
38 #include <utility/vector0.hh>
39 #include <utility/vector1.hh>
40 
41 //Auto Headers
43 #include <core/kinematics/Jump.hh>
44 
45 
46 
47 using basic::Error;
48 using basic::Warning;
49 static basic::Tracer TR( "protocols.toolbox.TaskOperations.PreventResiduesFromRepackingOperation" );
50 
51 namespace protocols {
52 namespace toolbox {
53 namespace task_operations {
54 
55 using namespace core::pack::task::operation;
56 
58 
60  : parent(), residues_( residues )
61 {
62 }
63 
65 
68 {
70 }
71 
73 {
74  return new PreventResiduesFromRepackingOperation( *this );
75 }
76 
77 void
79 {
80  runtime_assert( residues_.size() != 0 );
81 
83  for( core::Size i = 1; i<=residues_.size(); ++i )
84  pp.include_residue( residues_[i] );
85 
86  pp.apply( pose, task );
87 }
88 
89 
92 {
93  return residues_;
94 }
95 
96 void
98 {
99  runtime_assert( residues_vec.size() != 0 );
100  residues_.clear();
101  foreach( core::Size const item, residues_vec )
102  residues_.push_back( item );
103 }
104 
105 
106 void
108 {
109  unparsed_residues_ = tag->getOption< std::string >( "residues" ) ;
110  if( unparsed_residues_ != "" ){
111 
112  utility::vector1< std::string > const res_keys( utility::string_split( unparsed_residues_ , ',' ) );
113  utility::vector1< core::Size > residues_vector;
114  residues_.clear();
115 
116  foreach( std::string const key, res_keys ){
117  Size const res( utility::string2int( key ) );
118  TR.Debug<<"not designing residue: "<< key <<std::endl;
119  residues_.push_back( res );
120  }
121  }
122  }
123  } //namespace protocols
124  } //namespace toolbox
125 } //namespace task_operations