Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SymmetricFragmentMover.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 /// @brief Inserts a Fragment into a Pose, similar to old Rosetta++ main_frag_trial algorithm.
11 /// @author Oliver Lange
12 
13 // Unit Headers
15 
16 // Package Headers
17 
18 // Project Headers
19 #include <core/fragment/Frame.hh>
20 // AUTO-REMOVED #include <basic/options/option.hh>
21 
22 // Utility headers
23 #include <numeric/random/random.hh>
24 // AUTO-REMOVED #include <basic/prof.hh>
25 #include <basic/Tracer.hh>
26 
28 #include <utility/vector1.hh>
29 
30 
31 // ObjexxFCL Headers
32 
33 // C++ headers
34 
35 namespace protocols {
36 namespace simple_moves {
37 
38 static numeric::random::RandomGenerator RG(43389); // <- Magic number, do not change it!
39 
40 using namespace core;
41 using namespace fragment;
42 using namespace basic;
43 
44 static basic::Tracer tr("protocols.simple_moves.FragmentMover");
45 
48  return "SymmetricFragmentMover";
49 }
50 
51 bool
53  core::fragment::Frame const& frame,
54  Size frag_num,
55  core::kinematics::MoveMap const& movemap,
56  core::pose::Pose &pose
57 ) const {
58  bool success = ClassicFragmentMover::apply_fragment( frame, frag_num, movemap, pose );
59  if ( success ) {
60  Size new_start( 0 );
61  if ( frame.start() >= image_start_ ) {
62  new_start = frame.start() - image_start_ + 1;
63  } else {
64  new_start = frame.start() + image_start_ - 1;
65  }
66  if ( frame.is_continuous() ) {
67  frame.fragment( frag_num ).apply( movemap, pose, new_start, new_start + frame.length() - 1 );
68  } else {
69  tr.Warning << "WARNING: symmetric mover did not copy fragment move for non-continous fragment, only applied on monomer" << std::endl;
70  }
71  }
72  return success;
73 }
74 
75 
76 } // simple_moves
77 } // protocols