Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SetTorsion.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 sw=2 noet:
3 //
4 // This file is part of the Rosetta software suite and is made available under license.
5 // The Rosetta software is developed by the contributing members of the Rosetta Commons consortium.
6 // (C) 199x-2009 Rosetta Commons participating institutions and developers.
7 // For more information, see http://www.rosettacommons.org/.
8 
9 // Unit headers
12 
13 // Project Headers
14 #include <core/types.hh>
15 #include <core/pose/Pose.hh>
16 
17 // AUTO-REMOVED #include <core/conformation/util.hh>
18 // AUTO-REMOVED #include <core/conformation/Conformation.hh>
20 // AUTO-REMOVED #include <core/chemical/ResidueTypeSet.hh>
21 #include <core/chemical/AA.hh>
22 // AUTO-REMOVED #include <core/conformation/ResidueFactory.hh>
23 //parsing
24 #include <utility/tag/Tag.hh>
25 // AUTO-REMOVED #include <protocols/moves/DataMap.hh>
26 #include <protocols/moves/Mover.fwd.hh> //Movers_map
27 #include <protocols/filters/Filter.fwd.hh> //Filters_map
29 #include <core/pose/selection.hh>
30 #include <basic/Tracer.hh>
31 #include <core/kinematics/Jump.hh>
32 #include <utility/vector0.hh>
33 #include <utility/vector1.hh>
34 
35 
36 // Utility Headers
37 
38 // Unit Headers
39 
40 // C++ headers
41 
42 namespace protocols {
43 namespace simple_moves {
44 
45 using namespace core;
46 using namespace core::chemical;
47 using namespace std;
48 
49 using core::pose::Pose;
51 
52 static basic::Tracer TR( "protocols.simple_moves.SetTorsion" );
53 
56 {
58 }
59 
62  return new SetTorsion;
63 }
64 
67 {
68  return "SetTorsion";
69 }
70 
72 
73 ///@brief default ctor
75  parent(),
76  angle_( 0 ),
77  resnum_( 0 ),
78  torsion_name_( "" )
79 {}
80 
81 void SetTorsion::apply( Pose & pose ) {
82  runtime_assert( resnum() > 0 );
83  runtime_assert( resnum() <= pose.total_residue() );
84  runtime_assert( torsion_name() == "omega" || torsion_name() == "phi" || torsion_name() == "psi" );
85 
86  if( torsion_name() == "phi" )
87  pose.set_phi( resnum(), angle() );
88  else if( torsion_name() == "psi" )
89  pose.set_psi( resnum(), angle() );
90  else if( torsion_name() == "omega" )
91  pose.set_omega( resnum(), angle() );
92 
93  TR<<"Set "<<resnum()<<"'s "<<torsion_name()<<" to "<<angle()<<std::endl;
95 }
96 
100 }
101 
106  Pose const & pose)
107 {
108  angle( tag->getOption< core::Real >( "angle" ) );
109  resnum( core::pose::parse_resnum( tag->getOption< std::string >( "resnum" ), pose ) );
110  torsion_name( tag->getOption< std::string >( "torsion_name" ) );
111  TR<<"Set torsion "<<torsion_name_<<" at residue "<< resnum_ << " to "<<angle_<<std::endl;
112 }
113 
114 
115 } // moves
116 } // protocols