Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PerturbChiSidechainMover.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/simple_moves/sidechain_moves/SidechainMoverBase.cc
11 /// @brief implementation of PerturbChiSidechainMover class and functions
12 /// @author Oliver Lange ( oliver.lange@tum.de )
13 
14 
17 
18 // Procols Headers
20 
21 // Core Headers
26 #include <core/id/DOF_ID_Range.hh>
27 #include <core/id/TorsionID.hh>
31 #include <core/pose/Pose.hh>
36 #include <core/types.hh>
37 #include <basic/Tracer.hh>
38 #include <basic/basic.hh>
39 #include <basic/prof.hh>
40 
41 // Numeric Headers
42 #include <numeric/angle.functions.hh>
43 #include <numeric/constants.hh>
44 #include <numeric/conversions.hh>
45 #include <numeric/random/random.hh>
46 
47 // Utility
48 #include <utility/string_util.hh>
49 #include <utility/tag/Tag.hh>
50 #include <utility/exit.hh>
51 
52 // C++ Headers
53 #include <sstream>
54 #include <fstream>
55 #include <utility/fixedsizearray1.hh>
56 using namespace core;
57 using namespace core::pose;
58 
59 static numeric::random::RandomGenerator RG(18615125);
60 static basic::Tracer TR("protocols.simple_moves.sidechain_moves.PerturbChiSidechainMover");
61 
62 namespace protocols {
63 namespace simple_moves {
64 namespace sidechain_moves {
65 
66 using namespace chemical;
67 using namespace conformation;
68 
69 
71 PerturbChiSidechainMoverCreator::keyname() const {
72  return PerturbChiSidechainMoverCreator::mover_name();
73 }
74 
76 PerturbChiSidechainMoverCreator::create_mover() const {
77  return new PerturbChiSidechainMover;
78 }
79 
81 PerturbChiSidechainMoverCreator::mover_name() {
82  return "PerturbChiSidechain";
83 }
84 
85 
86 
87 PerturbChiSidechainMover::PerturbChiSidechainMover() {
88  protocols::moves::Mover::type( "PerturbChiSidechain" );
89  set_defaults();
90 }
91 
92 PerturbChiSidechainMover::PerturbChiSidechainMover(
93  pack::dunbrack::RotamerLibrary const & rotamer_library
94 ) : Parent( rotamer_library ) {
95  set_defaults();
96 }
97 
99  PerturbChiSidechainMover const & mover
100 ) : Parent ( mover ) {
101  set_defaults();
102 }
103 
107 }
108 
109 void
111  magnitude_ = 10;
112  gaussian_ = false;
113 }
114 
115 void
117  utility::tag::TagPtr const tag,
118  protocols::moves::DataMap & /*data*/,
119  protocols::filters::Filters_map const & /*filters*/,
120  protocols::moves::Movers_map const & /*movers*/,
121  pose::Pose const & /*pose*/
122 ) {
123  magnitude_ = tag->getOption<Real>( "magnitude", magnitude_ );
124  gaussian_ = tag->getOption<bool>( "gaussian", gaussian_ );
125 }
126 
129  return "PerturbChiSidechainMover";
130 }
131 
132 void
134  conformation::Residue const&,
135  ChiVector const& old_chi,
136  ChiVector& new_chi
137 ) {
138  new_chi.resize( old_chi.size() );
139  for ( Size i = 1; i <= old_chi.size(); i++) {
140  if ( !gaussian_ ) {
141  Real rand = RG.uniform();
142  new_chi[ i ] = basic::periodic_range( (( 2.0*rand-1.0 )*magnitude_ + old_chi[ i ]) , 360.0 );
143  } else {
144  new_chi[ i ] = basic::periodic_range( old_chi[i] + RG.gaussian()*magnitude_, 360.0 );
145  }
146  }
147 }
148 
149 } // sidechain_moves
150 } // simple_moves
151 } // protocols