Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SpinMover.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/SpinMover
11 /// @author Eva-Maria Strauch ( evas01@u.washinigton.edu )
12 
13 //unit header
16 //project header
19 #include <core/pose/Pose.hh>
21 #include <core/kinematics/Stub.hh>
22 #include <core/kinematics/Jump.hh>
24 #include <numeric/xyzVector.hh>
25 #include <numeric/random/random.hh>
26 #include <string>
27 
28 //#include <core/pose/Pose.hh>
29 #include <basic/Tracer.hh>
30 #include <utility/vector0.hh>
31 #include <utility/vector1.hh>
32 #include <utility/tag/Tag.hh>
33 
34 
35 namespace protocols {
36 namespace protein_interface_design {
37 namespace movers {
38 
39 using namespace protocols::moves;
40 
41 static numeric::random::RandomGenerator RG(12454); // <- Magic number, do not change it!!!
42 static basic::Tracer TR( "protocols.protein_interface_design.movers.SpinMover" );
43 
45 {
47 }
48 
51  return new SpinMover;
52 }
53 
56  return "SpinMover";
57 }
58 
60  protocols::moves::Mover( SpinMoverCreator::mover_name() )
61  //protocols::moves::Mover ( "SpinMover" )
62 { }
63 
65  protocols::moves::Mover( SpinMoverCreator::mover_name() ),
66  // protocols::moves::Mover ( "SpinMover" ),
67  jump_num_(jump_num)
68 { }
69 
72 }
73 
74 void
76 {
77  core::kinematics::Jump const start_jump = pose.jump( jump_num_ );
78  core::kinematics::Jump curr_jump( start_jump );
79  TR<<"current jump: " <<curr_jump<<std::endl;
80 
81  TR<<"using fold-tree: "<< pose.fold_tree()<<std::endl;
82 
83  //first determine where the jump is
84  core::Size const upstream_res(pose.fold_tree().jump_edge(jump_num_).start());
85  core::Size const downstream_res(pose.fold_tree().jump_edge(jump_num_).stop());
86  std::string upstream_atom(pose.fold_tree().jump_edge(jump_num_).upstream_atom());
87  std::string downstream_atom(pose.fold_tree().jump_edge(jump_num_).downstream_atom());
88  if( upstream_atom == "" ) upstream_atom = "C";
89  if( downstream_atom == "" ) downstream_atom = "C";
90  TR<<"upstream residue: "<<upstream_res<<" and atom "<<upstream_atom<<std::endl;
91 
93  //calculate the rotation axis
94  //looking down the axis from the upstream to downstream atom, positive rotations are counterclockwise
95  core::Vector axis( pose.residue(upstream_res).atom(upstream_atom).xyz()//minus
96  - pose.residue(downstream_res).atom(downstream_atom).xyz() );
97 
98 
99  numeric::xyzVector<double> reference_center = pose.residue(downstream_res).atom(downstream_atom).xyz();
100  curr_jump.rotation_by_axis( downstream_stub, axis, reference_center, 360.0f*RG.uniform() /*degrees*/ );
101  TR<<"new jump: " << curr_jump<<std::endl;
102  TR<<"new fold-tree: "<< pose.fold_tree()<<std::endl;
103  pose.set_jump( jump_num_, curr_jump );
104  TR<<"new jump: " << curr_jump<<std::endl;
105  TR<<"new fold-tree: "<< pose.fold_tree()<<std::endl;
106 }
107 //mjo commenting out 'data' and 'pose' because they are unused and cause warnings
108 void
109 SpinMover::parse_my_tag( TagPtr const tag, DataMap & /*data*/, protocols::filters::Filters_map const &, Movers_map const &, core::pose::Pose const & /*pose*/ )
110 {
111  jump_num_ = tag->getOption<core::Size>( "jump_num", 1);
112  TR<<"SpinMover was instantiated "<<std::endl;
113 }
114 
115 
116 }//movers
117 }//protein_interface_design
118 }//protocols