Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RigidBodySampler.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 SWA_Clusterer.hh
11 /// @brief
12 /// @detailed
13 ///
14 /// @author Rhiju Das
15 
16 
17 #ifndef INCLUDED_protocols_swa_RigidBodySampler_HH
18 #define INCLUDED_protocols_swa_RigidBodySampler_HH
19 
22 #include <core/pose/Pose.hh>
26 #include <utility/io/ozstream.fwd.hh>
27 #include <utility/pointer/ReferenceCount.hh>
28 #include <utility/vector1.hh>
29 #include <numeric/xyzVector.hh>
30 #include <numeric/xyzMatrix.hh>
31 #include <core/types.hh>
32 
33 #include <map>
34 
35 using namespace core;
37 
38 namespace protocols {
39 namespace swa {
40 
41  /////////////////////////////////////////////////////////////////////////////////////////////////
42  /////////////////////////////////////////////////////////////////////////////////////////////////
44  public:
45 
46  //constructor!
47  RigidBodySampler( utility::vector1< Size > const & fixed_res,
48  utility::vector1< Size > const & moving_res );
49 
50  //destructor -- necessary?
51  virtual ~RigidBodySampler();
52 
53  void
54  do_the_sampling( pose::Pose & pose );
55 
56  void
57  save_silent_struct( pose::Pose & pose, std::string const tag );
58 
59  void
60  output_results( utility::io::ozstream & out );
61 
62  void
63  output_histogram( utility::io::ozstream & out );
64 
65  void
66  output_silent_file( std::string const silent_file, bool const write_score_only = false );
67 
68 
69  void set_native_pose( pose::PoseOP native_pose ){ native_pose_ = native_pose; }
70 
71  void set_n_sample_alpha_full_range( Size const setting );
72  void set_n_sample_cosbeta_full_range( Size const setting );
73  void set_n_sample_gamma_full_range( Size const setting );
74 
75  void set_alpha_min( Real const setting ){ alpha_min_ = setting;}
76  void set_alpha_max( Real const setting ){ alpha_max_ = setting;}
77  void set_alpha_increment( Real const setting ){ alpha_increment_ = setting;}
78 
79  void set_cosbeta_min( Real const setting ){ cosbeta_min_ = setting;}
80  void set_cosbeta_max( Real const setting ){ cosbeta_max_ = setting;}
81  void set_cosbeta_increment( Real const setting ){ cosbeta_increment_ = setting;}
82 
83  void set_gamma_min( Real const setting ){ gamma_min_ = setting;}
84  void set_gamma_max( Real const setting ){ gamma_max_ = setting;}
85  void set_gamma_increment( Real const setting ){ gamma_increment_ = setting;}
86 
87  void set_translation_sample( Real const box_size, Real const xyz_increment );
88 
89  void set_x_min( Real const setting ){ x_min_ = setting;}
90  void set_x_max( Real const setting ){ x_max_ = setting;}
91  void set_x_increment( Real const setting ){ x_increment_ = setting;}
92 
93  void set_y_min( Real const setting ){ y_min_ = setting;}
94  void set_y_max( Real const setting ){ y_max_ = setting;}
95  void set_y_increment( Real const setting ){ y_increment_ = setting;}
96 
97  void set_z_min( Real const setting ){ z_min_ = setting;}
98  void set_z_max( Real const setting ){ z_max_ = setting;}
99  void set_z_increment( Real const setting ){ z_increment_ = setting;}
100 
101  void set_rmsd_cutoff( Real const setting ){ rmsd_cutoff_ = setting;}
102 
103  void force_coplanar();
104  void force_antiparallel();
105  void force_parallel();
106 
107  void set_score_cutoff( Real const setting ){ score_cutoff_ = setting;}
108  void set_score_function( core::scoring::ScoreFunctionOP setting ){ scorefxn_ = setting;}
109  core::scoring::ScoreFunctionOP score_function();
110 
111  void set_silent_file_data( core::io::silent::SilentFileDataOP sfd );
113 
114  void set_contact_cutoff( Real const setting );
115  void set_min_num_contacts( Size const setting );
116  void set_steric_dist_cutoff( Real const setting );
117  void set_min_hbonds( Size const value ){ min_hbonds_ = value;}
118  void set_fa_rep_cutoff( Real const value ){ fa_rep_cutoff_ = value;}
119  void set_o2star_trials( bool const setting );
120  void set_ignore_o2star_hbonds_in_filter( bool const setting ){ ignore_o2star_hbonds_in_filter_ = setting;}
121  void set_assign_WC_edges( bool const setting ){ assign_WC_edges_ = setting;}
122 
123 
124  void
125  assign_WC_edges_to_base_pair12( pose::Pose & pose, io::silent::SilentStruct & s );
126 
127  void
128  apply_input_samples( pose::Pose & pose,
129  std::string const rigid_body_sample_file );
130 
131  void
132  apply_rigid_body_settings( pose::Pose & pose, pose::Pose const & pose_start,
133  Real const alpha,
134  Real const beta,
135  Real const gamma,
136  Real const x,
137  Real const y,
138  Real const z );
139 
140  void
141  initialize_reference_axes_and_centroid( conformation::Residue const & rsd );
142 
143 
144  private:
145  void
146  initialize_counters();
147 
148  void
149  search_rotations_and_translations( pose::Pose & pose );
150 
151  void
152  search_translations( pose::Pose & pose,
153  pose::Pose const & pose_to_translate );
154 
155 
156  void
157  setup_heavy_atoms( pose::Pose const & pose,
158  utility::vector1< Vector > & pose_atoms,
159  utility::vector1< Size > const & subset_res );
160 
161  bool
162  check_contact( Vector const & translation,
163  utility::vector1< Vector > const & moving_atoms,
164  utility::vector1< Vector > const & partner_atoms
165  );
166 
167  bool
168  check_steric_overlap( Vector const & translation,
169  utility::vector1< Vector > const & moving_atoms,
170  utility::vector1< Vector > const & partner_atoms
171  );
172 
173  bool
174  check_o2star_needs_optimization( pose::Pose const & pose );
175 
176  bool
177  check_num_hbonds( pose::Pose & pose );
178 
179  bool
180  check_fa_rep( pose::Pose & pose );
181 
182  void
183  save_rigid_body_settings( Real const energy );
184 
185  void
186  figure_out_reference_energy( pose::Pose & pose );
187 
188  private:
189 
194 
196 
198  bool o2star_trials_, ignore_o2star_hbonds_in_filter_, assign_WC_edges_;
199 
200  Real alpha_, beta_, gamma_, delx_, dely_, delz_;
201 
202  Real alpha_min_, alpha_max_, alpha_increment_;
203  Real cosbeta_min_, cosbeta_max_, cosbeta_increment_;
204  Real gamma_min_, gamma_max_, gamma_increment_;
205  Real x_min_, x_max_, x_increment_;
206  Real y_min_, y_max_, y_increment_;
207  Real z_min_, z_max_, z_increment_;
208  Real score_cutoff_, best_energy_, reference_energy_;
209 
210  Size count_total_, count_good_, count_no_contact_, count_clash_;
213 
215 
216  Real CONTACT_CUTOFF_squared_, STERIC_DIST_CUTOFF_squared_;
218 
220 
222 
223  };
224 
225 } //swa
226 } // protocols
227 
228 #endif