Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StealSideChainsMover.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 simple mover for stealing side chains from one pose and sticking them
11 /// on another pose.
12 /// @author James Thompson
13 
14 #include <core/types.hh>
15 #include <core/pose/Pose.hh>
18 
19 #include <protocols/moves/Mover.hh>
21 
22 #include <utility/vector1.hh>
23 
24 
25 namespace protocols {
26 namespace comparative_modeling {
27 
29  core::pose::Pose const & source,
31 ) :
32  source_( source ),
33  map_( map )
34 {}
35 
37  using core::Size;
38  using std::string;
39 
40  for ( Size ii = 1; ii <= map_.size1(); ++ii ) {
41  Size const source_ii( map_[ii] );
42  if ( source_ii == 0 ) continue;
43  if ( source_ii > source_.total_residue() ) continue;
44 
45  string const name3( pose.residue_type(ii).name3() );
46  string const name3_src( source_.residue_type(map_[ii]).name3());
47  if ( name3 != name3_src ) continue;
48 
50  source_.residue( map_[ii] ).clone()
51  );
52 
53  // seqpos, new_residue, orient_backbone
54  pose.replace_residue ( ii, *new_residue, true );
55  //pose.replace_residue ( ii, *new_residue, false );
56  }
57 } // apply
58 
61  return "StealSideChainsMover";
62 }
63 
64 
65 } // comparative_modeling
66 } // protocols