Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StepWiseRNA_FloatingBase_Sampler_Util.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 StepWiseRNA_FloatingBase_Sampler_Util.hh
11 /// @brief
12 /// @detailed
13 ///
14 /// @author Parin Sripakdeevong
15 
16 
17 #ifndef INCLUDED_protocols_swa_rna_StepWiseRNA_FloatingBase_Sampler_Util_HH
18 #define INCLUDED_protocols_swa_rna_StepWiseRNA_FloatingBase_Sampler_Util_HH
19 
20 #include <core/pose/Pose.fwd.hh>
21 #include <core/types.hh>
22 #include <utility/vector1.hh>
23 #include <numeric/xyzMatrix.hh>
24 #include <numeric/xyzVector.hh>
25 #include <string>
26 #include <map>
27 #include <core/chemical/AA.hh>
30 #include <numeric/angle.functions.hh> // Need this to prevent the compiling error: 'principal_angle_degrees' is not a member of 'numeric' Oct 14, 2009
34 #include <set>
35 #include <ObjexxFCL/string.functions.hh>
40 
43 #include <protocols/swa/rna/StepWiseRNA_JobParameters.hh> //June 02, 2011
44 #include <core/pose/Pose.hh> //June 02, 2011
45 #include <core/scoring/rna/RNA_Util.hh> //June 02, 2011
46 
47 //#define centroid_bin_size 0.5
48 //#define euler_angle_bin_size 5
49 #define centroid_bin_size 1.0
50 #define euler_angle_bin_size 20
51 #define euler_z_bin_size 0.05
52 
53 
55 
56 namespace protocols {
57 namespace swa {
58 namespace rna {
59 
64 };
65 
66 //Should make sure that alpha and gamma lies in the [-Pi:Pi] range.
67 struct Euler_angles{
68  core::Real z; //z=cos(beta)
70  core::Real beta; //theta
72 };
73 
74 
75 struct Base_bin{
76 
81  int euler_z;
83 
84 };
85 
86 
87 struct
89 
90  //The expression comp(a,b), where comp is an object of this comparison class and a and b are key values, shall return true if a is to be placed at an earlier position than b in a strict weak ordering operation
91 
92  bool
93  operator() (Base_bin const & first , Base_bin const & second) const {
94 
95  if(first.centroid_x != second.centroid_x) return (first.centroid_x<second.centroid_x); //x
96  if(first.centroid_y != second.centroid_y) return (first.centroid_y<second.centroid_y); //y
97  if(first.centroid_z != second.centroid_z) return (first.centroid_z<second.centroid_z) ; //z
98  if(first.euler_alpha != second.euler_alpha) return (first.euler_alpha < second.euler_alpha);
99  if(first.euler_gamma != second.euler_gamma) return (first.euler_gamma < second.euler_gamma);
100  if(first.euler_z != second.euler_z) return (first.euler_z < second.euler_z);
101 
102  return false; //Equality case.
103  }
104 
105 };
106 
107 struct
109 
110  //The expression comp(a,b), where comp is an object of this comparison class and a and b are key values, shall return true if a is to be placed at an earlier position than b in a strict weak ordering operation
111 
112 
113  bool
114  operator() (std::pair<int, int> const & pair_one , std::pair<int, int> const & pair_two) const {
115 
116  if(pair_one.first != pair_two.first) return (pair_one.first<pair_two.first);
117  if(pair_one.second != pair_two.second) return (pair_one.second<pair_two.second);
118 
119  return false; //Equality case.
120  }
121 
122 };
123 
124 struct
126  bool
127  operator() (core::Real const & first, core::Real const & second) const {
128  return first< second;
129  }
130 };
131 
132 
133 
134 //typedef utility::pointer::owning_ptr< FloatingBaseChainClosureJobParameter > FloatingBaseChainClosureJobParameterOP;
135 //typedef utility::pointer::owning_ptr< FloatingBaseChainClosureJobParameter const > FloatingBaseChainClosureJobParameterCOP;
136 
137 
138 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
139 
140 //This is the version currently used for floating base sampling....slightly different from the old version of Base_centroid_screening which appear to StepWiseRNA_Sampling
141 //Should probably integrate this with Rhiju's class Jan 28, 2010. ***ALERT***RHIJU pointed out that the screening condition is slight different in his new class.
142 
143 bool
144 Is_base_stack(core::kinematics::Stub const & moving_res_base,
145  utility::vector1 < core::kinematics::Stub > const & other_residues_base_list,
146  core::Real const base_axis_CUTOFF,
147  core::Real const base_planarity_CUTOFF);
148 
149 bool
150 Is_base_pair(core::kinematics::Stub const & moving_res_base,
151  utility::vector1 < core::kinematics::Stub > const & other_residues_base_list,
152  core::Real const base_axis_CUTOFF,
153  core::Real const base_planarity_CUTOFF);
154 
155 bool
156 Is_strong_base_stack(core::kinematics::Stub const & moving_res_base, utility::vector1 < core::kinematics::Stub > const & other_residues_base_list);
157 
158 // Undefined, commenting out to fix PyRosetta build bool Is_medium_stack_base_and_medium_stack_base(core::kinematics::Stub const & moving_res_base, utility::vector1 < core::kinematics::Stub > const & other_residues_base_list);
159 
160 bool
161 Base_centroid_screening(core::kinematics::Stub const & moving_res_base, utility::vector1 < core::kinematics::Stub > const & other_residues_base_list, core::Size const num_nucleotides, SillyCountStruct & count_data, bool const allow_base_pair_only_screen);
162 
163 
164 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
165 
166 
167 
168 Base_bin
169 Get_euler_stub_bin(numeric::xyzVector<core::Real> const & centroid, Euler_angles const & euler_angles);
170 
172 Get_ribose_stub(core::conformation::Residue const & rsd, bool const Is_prepend, bool const verbose=true);
173 
174 
175 int
176 DOF_bin_value(std::map<Base_bin , int , compare_base_bin>::const_iterator const & base_bin_it, std::string const & DOF);
177 
179 DOF_bin_size(std::string const & DOF);
180 
181 void
182 Analyze_base_bin_map(std::map<Base_bin , int , compare_base_bin> const & base_bin_map, std::string const foldername);
183 
184 void
185 Analyze_base_bin_map(std::map<Base_bin , int , compare_base_bin> const & base_bin_map, std::string const & DOF_one, std::string const & DOF_two, std::string const foldername);
186 
187 
188 // Undefined, commenting out to fix PyRosetta build void Analyze_base_bin_map_old(std::map<Base_bin , int , compare_base_bin> const & base_bin_map, bool const Is_dinucleotide);
189 
190 void
192 
193 void
194 set_to_origin(core::pose::Pose & pose, core::Size const seq_num, bool verbose=false);
195 
196 Euler_angles
197 Get_euler_angles( numeric::xyzMatrix< core::Real > const & coordinate_matrix);
198 
199 void
200 convert_euler_to_coordinate_matrix(Euler_angles const & E, numeric::xyzMatrix< core::Real > & coordinate_matrix);
201 
202 void
203 get_specific_atom_coordinate(std::string const & atom_name,
205  core::conformation::Residue const & rsd_at_origin,
206  core::kinematics::Stub const & moving_res_base_stub);
207 
210 
211 //////////////////////////////////////////Ribose sugar , close_break closures function////////////////////////////
212 
214 setup_residue_at_origin_list(core::pose::Pose const & pose, core::Size const & moving_res, bool const extra_anti_chi_rotamer, bool const extra_syn_chi_rotamer,std::string const pose_name);
215 
216 bool
217 check_floating_base_chain_closable(core::Size const & reference_res,
218  core::pose::Pose const & pose,
219  utility::vector1 <core::conformation::ResidueOP> const & rsd_at_origin_list,
220  core::kinematics::Stub const & moving_res_base_stub,
221  bool const Is_prepend,
222  core::Size const gap_size);
223 
224 bool
225 check_floating_base_chain_closable(core::Size const & reference_res,
227  utility::vector1 <core::conformation::ResidueOP> const & rsd_at_origin_list,
228  core::kinematics::Stub const & moving_res_base_stub,
229  bool const Is_prepend,
230  core::Size const gap_size);
231 
232 
233 void
235  core::Size const & seq_num,
236  core::conformation::Residue const & rsd_at_origin,
237  core::kinematics::Stub const & moving_res_base_stub);
238 
239 
240 
241 
242 
243 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
244 }
245 }
246 }
247 
248 #endif
249 
250