Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RestrictInterGroupVectorOperation.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/RestrictInterGroupVectorOperation.cc
11 /// @brief
12 /// @author Ben Stranges stranges@unc.edu
13 
14 // Unit Headers
17 //#include <protocols/toolbox/task_operations/InterfaceTaskOperation.hh> //shouldn't need this
18 // Project Headers
19 #include <core/pose/Pose.hh>
21 //#include <core/kinematics/FoldTree.hh>
23 #include <core/pose/selection.hh>
24 // Utility Headers
25 #include <core/types.hh>
26 #include <utility/vector1_bool.hh>
27 #include <utility/vector1.hh>
28 
29 #include <basic/Tracer.hh>
30 #include <utility/string_util.hh>
31 #include <utility/tag/Tag.hh>
32 
33 // C++ Headers
34 // AUTO-REMOVED #include <set>
35 
36 #include <utility/vector0.hh>
37 
38 
39 using basic::Error;
40 using basic::Warning;
41 static basic::Tracer TR( "protocols.toolbox.TaskOperations.RestrictInterGroupVectorOperation" );
42 
43 namespace protocols {
44 namespace toolbox {
45 namespace task_operations {
46 
47 /// @brief default constructor
49  parent(),
50  //need something for groups
51  CB_dist_cutoff_( 11.0 ),
52  nearby_atom_cutoff_( 5.5 ),
53  vector_angle_cutoff_( 75.0 ),
54  vector_dist_cutoff_( 9.0 )
55 { }
56 
57  /// @brief full constructor
59  group_vector const & group,
60  core::Real CB_dist_cutoff,
61  core::Real nearby_atom_cutoff,
62  core::Real vector_angle_cutoff,
63  core::Real vector_dist_cutoff
64 ):
65  parent(),
66  pair_vector_(group),
67  CB_dist_cutoff_( CB_dist_cutoff ),
68  nearby_atom_cutoff_( nearby_atom_cutoff ),
69  vector_angle_cutoff_( vector_angle_cutoff ),
70  vector_dist_cutoff_( vector_dist_cutoff )
71 {}
72 
73  //@brief convienience contstuctor for one pair
75  group_pair const & one_group,
76  core::Real CB_dist_cutoff,
77  core::Real nearby_atom_cutoff,
78  core::Real vector_angle_cutoff,
79  core::Real vector_dist_cutoff
80 ):
81  parent(),
82  CB_dist_cutoff_( CB_dist_cutoff ),
83  nearby_atom_cutoff_( nearby_atom_cutoff ),
84  vector_angle_cutoff_( vector_angle_cutoff ),
85  vector_dist_cutoff_( vector_dist_cutoff )
86 {
87  pair_vector_.clear();
88  pair_vector_.push_back(one_group);
89 }
90 
91 
92 /// @brief destructor
94 
95 
98 {
100 }
101 
102 ///@details be warned if you use clone that you'll not get a new interface calculator
104 {
105  return new RestrictInterGroupVectorOperation( *this );
106 }
107 
108 ///@details setters
110  pair_vector_.push_back(pair);
111 }
114 }
117 }
120 }
123 }
124 
125 ///@details apply function, uses inherited functionality
126 void
128 {
129  //First check to make sure we can do something
130  if( pair_vector_.size() < 1 )
131  utility_exit_with_message( "No residues defined to look at interface between." );
132  //make a list of residues allowed
133  utility::vector1_bool repack_full(pose.total_residue(), false);
134  //itterate over each set of pairs, make a union
135  for( core::Size jj=1 ; jj<= pair_vector_.size(); ++jj ) {//{utility::vector1<group_pair>::const_iterator jj = pair_vector_.begin() ; jj != pair_vector_.end() ; ++jj ){
136  group_pair this_pair = pair_vector_[jj];
137  utility::vector1_bool repack =
139  pose,
140  this_pair.first,
141  this_pair.second,
146  );
147  //add repack true setting to repack_full
148  for(core::Size ii = 1; ii <= repack.size(); ++ii){
149  if(repack[ii])
150  repack_full[ii] = true;
151  }//end add repack to full_repack
152  }//itterate over vector of pairs
153  task.restrict_to_residues(repack_full);
154 
155 }//apply
156 
157 // ///@details parse_tag
158 // void
159 // RestrictInterGroupVectorOperation::parse_tag(utility::tag::TagPtr tag)
160 // {
161 // }//parse_tag
162 
163 
164 }//task_operations
165 }//toolbox
166 }//protocols