Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JumpSample.hh
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 JumpSetup
11 /// @brief read jump-definition file setups fold tree an chainbreak variants
12 /// loop code didn't work because fold-tree to complicated ( overlapping loops )
13 /// @detailed
14 /// @author Oliver Lange
15 
16 
17 #ifndef INCLUDED_protocols_jumping_JumpSample_hh
18 #define INCLUDED_protocols_jumping_JumpSample_hh
19 
20 // Unit Headers
22 
23 // Package Headers
26 // AUTO-REMOVED #include <core/fragment/SecondaryStructure.hh>
27 
28 // Project Headers
29 #include <core/types.hh>
32 // AUTO-REMOVED #include <core/kinematics/MoveMap.hh>
33 
34 #include <core/pose/Pose.fwd.hh>
35 
37 // AUTO-REMOVED #include <core/fragment/FrameIterator.hh>
38 
39 // ObjexxFCL Headers
40 #include <ObjexxFCL/FArray1D.hh>
41 #include <ObjexxFCL/FArray2D.hh>
42 
43 // Utility headers
44 // AUTO-REMOVED #include <utility/vector1.hh>
45 #include <utility/pointer/ReferenceCount.hh>
46 
47 //// C++ headers
48 #include <cstdlib>
49 #include <string>
50 
53 #include <utility/vector1.hh>
54 
55 
56 
57 namespace protocols {
58 namespace jumping {
59 class Interval;
61 //@brief JumpSample with a random choice of cut-points according to allowed cut_reg in JumpSetup
62 //@details this class can handle all the intricacies of actually applying a choice of jumps and cuts to a pose
63 class JumpSample {
64 public:
66  : njump_( 0 ),
67  bValidTree_( false )
68  {};
69 
71  JumpSample ( JumpSetup const& );
72 
73  // generate fold-tree from jumps and cuts
74  JumpSample ( core::Size total_residue, core::Size njump, ObjexxFCL::FArray2D_int jumps, ObjexxFCL::FArray1D_int cuts, core::Size root = 1);
75 
76  // generate fold-tree from jumps, jump_atoms and cuts
77  JumpSample ( core::Size total_residue, core::Size njump, ObjexxFCL::FArray2D_int jumps, ObjexxFCL::FArray2D<std::string> jump_atoms, ObjexxFCL::FArray1D_int cuts, core::Size root = 1);
78 
79  // this one is not safe due to FArray, generate random fold-tree ( as used by SheetBuilder )
80  JumpSample ( core::Size total_residue, core::scoring::dssp::PairingsList const& jumps, ObjexxFCL::FArray1D_float const& cut_probability, core::Size root=1);
81 
82  // generate random fold-tree ( as used by SheetBuilder )
84 
85 
86  // wrap to a copy of an existing Fold-Tree
88 
89  // wrap an existing Fold-Tree
91 
92  bool
93  is_valid() const {
94  return bValidTree_;
95  }
96 
97  void
98  resize( core::Size njump );
99 
100  //void generate_tree( core::Size nres, core::kinematics::FoldTree &f ) const;
101 
102  void
104 
105  //@brief lengthen secondary structure elements around jump-points to be at least 5 residues ( -2..+2 ) long.
106  void
107  safe_secstruct( core::pose::Pose &pose ) const;
108 
109  //@brief transfer native jump RT to poes, Sideeffect: changes fold-tree of native_pose.
110  void
111  transfer_jumps( core::pose::Pose &pose, core::pose::Pose &native_pose ) const;
112 
113  //bool
114  // close_chainbreaks( core::pose::Pose &pose ) const;
115 
116  //@brief transfer native jump RT to FrameList
117  void
118  steal_jumps(
119  core::pose::Pose &native_pose,
120  core::fragment::FrameIterator const& begin,
122  ) const;
123 
124 
125 
126  //@brief generate list of frames ( one for each jump )
127  void
128  generate_jump_frames( core::fragment::FrameList&, core::kinematics::MoveMap const&, bool bWithTorsion = true ) const;
129 
130  void
132 
133  //@brief generate fragset with RTs from library
134  void
136  PairingLibrary const& pairings,
138  bool bWithTorsion,
140  ) const;
141 
142  //@brief switch on chainbreak scores for all cuts ( add chainbreak variant )
143  void
144  add_chainbreaks( core::pose::Pose &pose ) const;
145 
146  //@brief switch on chainbreaks-scores only if the separation in the foldtree is smaller than the threshold <max_dist>
147  void
149 
150  void
152 
153  void
155  core::pose::Pose &pose,
156  core::Size max_dist,
158  ) const;
159 
160  void
161  remove_chainbreaks( core::pose::Pose &pose ) const;
162 
163  void
165  set_fold_tree_in_pose( pose );
166  add_chainbreaks( pose );
167  }
168 
169  core::Size
170  downstream_res_nr( core::Size jump_nr ) const {
171  return fold_tree_->downstream_jump_residue( jump_nr );
172  }
173 
174  core::Size size() const
175  {
176  return njump_;
177  }
178 
179  ObjexxFCL::FArray2D_int const& jumps() const {
180  return jumps_;
181  }
182 
183  ObjexxFCL::FArray1D_int const& cuts() const {
184  return cuts_;
185  }
186 
187  ObjexxFCL::FArray2D< std::string > const& jump_atoms() const {
188  return jump_atoms_;
189  }
190 
191  bool has_orientation_and_pleating() const;
192 
193  /// @brief output operator
194  friend std::ostream & operator <<(std::ostream & os, JumpSample const & t);
195 
197  return *fold_tree_;
198  }
199 
201 
202  ///@brief dump file with little pymol script that shows jumps and cuts
203  void
204  dump_pymol( std::string fn ) const;
205 
207  get_pairing( core::Size res1, core::Size res2 ) const;
208 
209 private:
210  void
212 
213  void
214  generate_random_tree_from_jumps( ObjexxFCL::FArray1D_float const& prob, core::Size root=1 );
215 
216  void
218 
219  void jumps2pairings();
220 
221  void
223 
226 
227  // the latter two contain redundant information
229  ObjexxFCL::FArray2D_int jumps_;
230  ObjexxFCL::FArray2D< std::string > jump_atoms_;
231 
232  ObjexxFCL::FArray1D_int cuts_;
235 };
236 
237 } //jumping
238 } //protocols
239 
240 #endif