Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TaskAwareCsts.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/protein_interface_design/movers/TaskAwareCsts.cc
11 /// @brief
12 /// @author Sarel Fleishman (sarelf@u.washington.edu)
13 
14 // Unit headers
17 #include <boost/foreach.hpp>
18 #define foreach BOOST_FOREACH
19 // Package headers
20 #include <core/pose/Pose.hh>
24 #include <basic/Tracer.hh>
26 #include <utility/tag/Tag.hh>
27 #include <utility/vector1.hh>
29 #include <protocols/moves/Mover.hh>
31 //Auto Headers
33 #include <numeric/xyzVector.hh>
37 #include <core/id/AtomID.hh>
38 
39 namespace protocols {
40 namespace protein_interface_design {
41 namespace movers {
42 
43 static basic::Tracer TR( "protocols.protein_interface_design.movers.TaskAwareCsts" );
46 {
48 }
49 
52  return new TaskAwareCsts;
53 }
54 
57 {
58  return "TaskAwareCsts";
59 }
60 
62  Mover( TaskAwareCstsCreator::mover_name() ),
63  task_factory_( NULL ),
64  cst_type_( "coordinate" )
65 {
66 }
67 
68 
70 
71 void
73 {
74  using namespace protocols::rosetta_scripts;
75  using namespace core::scoring::constraints;
76  using core::id::AtomID;
77 
78  ConstraintCOPs cst;
79  utility::vector1< core::Size > const designable( residue_packer_states( pose, task_factory(), true/*designable*/, false/*packable*/ ) );
80  runtime_assert( designable.size() );
81  AtomID const anchor_atom( AtomID( pose.residue( designable[ 1 ] ).atom_index( "CA" ), designable[ 1 ] ) ); // anchor to first designable CA
82  HarmonicFuncOP coord_cst_func( new HarmonicFunc( 0.0, 1.0/*sd*/ ) ); // hardwired for now
83  TR<<"Adding constraints to pose at positions: ";
84  foreach( core::Size const resid, designable ){
85  core::conformation::Residue const rsd_i( pose.residue( resid ) );
86  if( cst_type_ == "coordinate" ){
87  cst.push_back( new CoordinateConstraint( AtomID( rsd_i.atom_index( "CA" ), resid ), anchor_atom, rsd_i.xyz( "CA" ), coord_cst_func ) );
88  TR<<resid<<',';
89  }
90  }
91  TR<<std::endl;
92  pose.add_constraints( cst );
93 }
94 
98 }
99 
100 void
102 {
103  using namespace protocols::rosetta_scripts;
104  task_factory( parse_task_operations( tag, data ) );
105  cst_type( tag->getOption< std::string >( "cst_type", "coordinate" ) );
106 }
107 
110  return( protocols::moves::MoverOP( new TaskAwareCsts( *this ) ));
111 }
112 
115 
116 void
118 
119 } //movers
120 } //protein_interface_design
121 } //protocols