Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CutChainMover.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 ForceDisulfidesMover.cc
11 ///
12 /// @brief
13 /// @author Sarel Fleishman
14 
15 // unit headers
18 #include <boost/foreach.hpp>
19 #define foreach BOOST_FOREACH
20 
21 // type headers
22 #include <core/types.hh>
23 #include <core/id/types.hh>
24 
25 // project headers
26 #include <protocols/moves/Mover.hh>
27 #include <core/pose/util.hh>
29 #include <core/pose/Pose.hh>
30 #include <core/pose/selection.hh>
31 
32 // package headers
33 #include <core/pose/PDBInfo.hh>
38 
39 // Project headers
43 
44 #include <core/id/TorsionID.hh>
45 #include <core/id/types.hh>
46 #include <core/scoring/Energies.hh>
47 
48 // utility header
49 #include <basic/Tracer.hh>
50 #include <utility/vector1.hh>
51 #include <utility/exit.hh>
52 #include <utility/tag/Tag.hh>
53 #include <utility/string_util.hh>
61 
62 namespace protocols {
63 namespace simple_moves {
64 
65 static basic::Tracer TR("protocols.simple_moves.CutChainMover");
66 
69 {
71 }
72 
75  return new CutChainMover;
76 }
77 
80 {
81  return "CutChain";
82 }
83 
84 //Default Constructor
86  protocols::moves::Mover("CutChain"),
87  bond_length_(4.0), //define covalent bond length cut-off
88  chain_id_(1)//define default main chain
89 {
90 }
91 
92 
94 
97 {
98  return new CutChainMover( *this );
99 }
100 
103 {
104  return new CutChainMover();
105 }
106 
107 //getters
110  return "CutChain";
111 }
112 
115  return bond_length_;
116 }
117 
120  return chain_id_;
121 }
122 
123 //setters
124 void
126  bond_length_ = length;
127 }
128 void
130  chain_id_ = ID;
131 }
132 void
134 {
135  bond_length( tag->getOption< core::Real >( "bond_length", 4.0 ) );
136  chain_id( tag->getOption< core::Size >( "chain_id", 1 ) );
137  TR<<" bond_length: "<<bond_length();
138  TR<<"Chain id: "<<chain_id();
139  TR<<std::endl;
140 }
141 
143 {
144  create_subpose(pose);
145  foldTree(pose);
146 
147 }
148 
151 {
152  core::Size cut_pos = -1;
153  for( core::Size resj = pose.conformation().chain_begin( chain_id_ ); resj <= pose.conformation().chain_end( chain_id_ )-1; ++resj ){
154  core::Real const distance = pose.residue( resj+1 ).xyz( "N" ).distance(pose.residue( resj ).xyz( "C" ));
155 // TR<<"distance is: "<<distance<<std::endl;
156 // TR<<"residue name is : "<<pose.residue(resj).name1()<<std::endl;
157  if( distance > bond_length()){
158  cut_pos = resj;
159  TR<<"Found cut at: "<<resj<<std::endl;
160  break;
161  }
162  }
163  return( cut_pos );//cut_pos is the amino acid position BEFORE the cut
164 }
165 
166 void
168 {
169  core::pose::Pose copy_pose( pose );
170  pose.clear();
171 
172  //add to pose only residues from main chain
173  for (core::Size resj = copy_pose.conformation().chain_begin( chain_id_); resj <= copy_pose.conformation().chain_end( chain_id_); ++resj) {
174  core::conformation::Residue const & rsd( copy_pose.residue( resj) );
175  pose.append_residue_by_bond( rsd );
176  }
177 
178 }
179 
180 void
182 core::Size const s1 = chain_cut(pose);
184  ft.clear();
185  ft.add_edge( 1, s1, -1 );
186  ft.add_edge( s1, s1+1, 1 );
187  ft.add_edge( s1+1, pose.conformation().chain_end( chain_id()), -1 );
188 TR<<"old foldtree: "<<pose.fold_tree()<<std::endl;
189 pose.fold_tree(ft);
190 TR<<"new_foldtree: "<<pose.fold_tree()<<std::endl;
192 }
193 
194 
195 } // simple_moves
196 } // protocols