Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AddSidechainConstraintsToHotspots.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 
11 /// @file protocols/protein_interface_design/movers/AddSidechainConstraintsToHotspots.cc
12 /// @brief
13 /// @author Sarel Fleishman (sarelf@u.washington.edu)
14 
15 // Unit headers
18 
19 // Project headers
20 #include <core/pose/Pose.hh>
22 #include <core/pose/selection.hh>
23 #include <utility/tag/Tag.hh>
27 #include <boost/foreach.hpp>
28 #define foreach BOOST_FOREACH
29 #include <basic/Tracer.hh>
30 // AUTO-REMOVED #include <protocols/moves/DataMap.hh>
33 
34 #include <utility/vector0.hh>
35 #include <utility/vector1.hh>
36 
37 
38 namespace protocols {
39 namespace protein_interface_design {
40 namespace movers {
41 
42 using core::pose::Pose;
43 using namespace protocols::moves;
44 
45 static basic::Tracer TR( "protocols.protein_interface_design.movers.AddSidechainConstraintsToHotspots" );
46 static basic::Tracer TR_cst( "protocols.protein_interface_design.movers.AddSidechainConstraintsToHotspots_csts" );
47 
50 {
52 }
53 
57 }
58 
61 {
62  return "AddSidechainConstraintsToHotspots";
63 }
64 
65 
67  protocols::moves::Mover( AddSidechainConstraintsToHotspotsCreator::mover_name() ),
68  chain_( 2 ),
69  coord_sdev_( 1.0 )
70 { }
71 
73 
74 void
76 {
77  core::Size const begin( pose.conformation().chain_begin( chain() ) );
78  core::Size const end( pose.conformation().chain_end( chain() ) );
79 
80  int const num_cutpoints( pose.fold_tree().num_cutpoint() );
81  if( num_cutpoints <= 2 && residues().size() == 0 ){
82  TR<<"Not enough cutpoints in pose and no residues defined by user. Doing nothing"<<std::endl;
83  return;
84  }
85  for( int i=2; i<=pose.fold_tree().num_cutpoint(); ++i ){
86  core::Size const cutpoint = pose.fold_tree().cutpoint( i );
87  core::Size const cutpoint_i_1 = pose.fold_tree().cutpoint( i - 1 );
88  if( cutpoint - 1 != cutpoint_i_1 ) continue;//only mark residues that are cut on both ends
89  if( cutpoint <= end && cutpoint >= begin )
90  add_residue( i );
91  }
92  foreach( core::Size const residue, residues() )
93  {
94  using namespace core::scoring::constraints;
95 
96  HarmonicFuncOP dummy_cst;
97  ConstraintCOPs constraint;
98  constraint = add_coordinate_constraints( pose, pose.conformation().residue( residue ), chain(), residue, coord_sdev(), dummy_cst );
99  foreach( ConstraintCOP cst, constraint ){
100  cst->show_def( TR_cst, pose );
101  }
102  }
103  TR.flush();
104 }
105 
109 }
110 
111 void
113  DataMap &,
115  Movers_map const &,
116  Pose const & pose )
117 {
118  chain( tag->getOption< core::Size >( "chain", 2 ) );
119  coord_sdev( tag->getOption< core::Real >( "coord_sdev", 1.0 ) );
120  utility::vector1< core::Size > v1 = core::pose::get_resnum_list( tag, "resnums", pose );
121  foreach( core::Size const r, v1 ){ add_residue( r ); }
122 }
123 
126  return chain_;
127 }
128 
129 void
131  chain_ = c;
132 }
133 
136  return coord_sdev_;
137 }
138 
139 void
141  coord_sdev_ = c;
142 }
143 
144 void
146  residues_.insert( res );
147 }
148 
149 std::set< core::Size > const &
151  return residues_;
152 }
153 
154 } //movers
155 } //protein_interface_design
156 } //protocols
157