Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MatchConstraintFileInfo.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 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file protocols/toolbox/match_enzdes_util/MatchConstraintFileInfo.hh
12 ///
13 /// @brief
14 /// @author Florian Richter, floric@u.washington.edu, may 2009
15 
16 
17 #ifndef INCLUDED_protocols_toolbox_match_enzdes_util_MatchConstraintFileInfo_hh
18 #define INCLUDED_protocols_toolbox_match_enzdes_util_MatchConstraintFileInfo_hh
19 
20 // Unit headers
22 
23 // Package headers
26 
27 // Project headers
31 #include <core/pose/Pose.fwd.hh>
32 #include <core/types.hh>
33 
34 // Utility headers
35 #include <utility/pointer/ReferenceCount.hh>
36 #include <utility/io/izstream.fwd.hh>
37 // AUTO-REMOVED #include <utility/vector1.hh>
38 
39 // numeric headers
40 #include <numeric/HomogeneousTransform.fwd.hh>
41 
42 // C++ headers
43 #include <map>
44 #include <string>
45 #include <set>
46 #include <list>
47 
48 #include <utility/vector1.hh>
49 
50 
51 namespace protocols{
52 namespace toolbox{
53 namespace match_enzdes_util{
54 
55 /// @brief function to go through a list of restypes and
56 /// reduce them to chemically identical ones based on the same base_name
57 /// i.e. this function gets rid of the variant redundancy
58 void
60  std::set< core::chemical::ResidueTypeCOP > & restype_subset,
63 );
64 
65 
66 /// @brief class that stores information of one geometric parameter line of the .cst file
67 /// i.e. angleA or torsionB
69 {
70 
71 public:
72 
74  std::string tag );
75 
79  core::Real force_k,
81  );
82 
83  virtual ~GeomSampleInfo();
84 
85  /// @brief data reading routine
86  bool
87  read_data( std::istringstream & line_stream );
88 
89 
90  /// @brief creates an explicit sample vector from the input data
91  /// i.e. translates ideal value, tolerance, num_steps and periodicity
92  /// into a vector of values
94  create_sample_vector() const;
95 
97  tag() const {
98  return tag_; }
99 
100  core::Real
101  ideal_val() const {
102  return ideal_val_; }
103 
104  core::Real
105  tolerance() const {
106  return tolerance_; }
107 
108  core::Real
109  periodicity() const {
110  return periodicity_; }
111 
112  core::Real
113  force_const() const {
114  return force_const_; }
115 
116  core::Size
117  num_steps() const {
118  return num_steps_; }
119 
120  core::Real
121  step_size() const {
122  return step_size_; }
123 
125  function_tag() const {
126  return function_tag_; }
127 
128 
129 
130 private:
131 
133 
134  // ideal val and the periodicity
136 
138 
139  //step_size_ = tolerance / num_steps
141 };
142 
143 
145 {
146 
147 
148 public: //construct / destruct
149 
150  typedef numeric::HomogeneousTransform< core::Real > HTReal;
151 
155  );
156 
157  virtual ~MatchConstraintFileInfo();
158 
159 public: //atom and residue accessors
160 
161 
162  core::Size
163  index() const{
164  return index_;
165  }
166 
167  /// @brief all positions where a residue for this geometry
168  /// can be placed
170  allowed_seqpos() const {
171  return allowed_seqpos_; }
172 
173 
174  /// @brief what type of amino acids/ligands make this
175  /// constraint
177  allowed_res_name3s( core::Size which_cstres ) const {
178  return this->enz_cst_template_res( which_cstres )->allowed_res_types(); }
179 
180  core::Size
182  return enz_template_res_.size(); }
183 
184  /// @brief is this interaction a backbone interaction
185  bool
186  is_backbone( core::Size which_cstres ) const {
187  return this->enz_cst_template_res( which_cstres )->is_backbone(); }
188 
189 
190  /// @brief all chemically non-redundant restypes
191  /// of the given restypes
193  allowed_restypes( core::Size which_cstres ) const;
194 
195  /// @brief which one of the residues (1 or 2 ) in this block
196  /// is the upstream res. used for classic match algorithm
197  /// hardcoded 2 for now
198  core::Size
199  upstream_res() const {
200  return 2; }
201 
202  /// @brief which one of the residues (1 or 2 ) in this block
203  /// is the upstream res. used for classic match algorithm
204  /// hardcoded 1 for now
205  core::Size
206  downstream_res() const {
207  return 1; }
208 
209  /// @brief holds information read from ALGORITHM_INFO blocks
210  /// in the input file
211  std::map< std::string, utility::vector1< std::string > > const &
213  return algorithm_inputs_; }
214 
215  bool
216  is_covalent() const {
217  return is_covalent_; }
218 
220  dis_U1D1() const {
221  return dis_U1D1_; }
222 
224  ang_U1D2() const {
225  return ang_U1D2_; }
226 
228  ang_U2D1() const {
229  return ang_U2D1_; }
230 
232  tor_U1D3() const {
233  return tor_U1D3_; }
234 
236  tor_U3D1() const {
237  return tor_U3D1_; }
238 
240  tor_U2D2() const {
241  return tor_U2D2_; }
242 
243 
244  /// @brief all atoms of restype to be used as template_atom
245  /// in the matcher/constraints
248  core::Size which_cstres,
249  core::Size which_template_atom,
250  core::chemical::ResidueType const & restype ) const;
251 
253  enz_cst_template_res( core::Size template_res ) const;
254 
255  //Kui 110609 Native
256  bool native() const{
257  return native_;
258  }
259 
260 public: //geometric sample accessors
261 
262  /// @brief returns ExternalGeomSampler only if the user has specified all six degrees of freedom,
263  /// otherwise null pointer is returned
265  create_exgs() const;
266 
267 public: //mutators
268 
269  /// @brief data reading routine
270  bool
271  read_data( utility::io::izstream & data );
272 
273 
274  /// @brief processes the read data
275  /// right now this only generates the template atomnos for every restype
276  void
277  process_data();
278 
279 public: //convenience functions
280 
281  /// @brief function that takes all rotamers for the ResidueType(s)
282  /// that interact with the target residues and places them according
283  /// according to the geometry specified
284  std::list< core::conformation::ResidueCOP >
286  core::Size const target_template,
287  core::conformation::ResidueCOP target_conf ) const;
288 
289  std::list< core::conformation::ResidueCOP >
291  core::conformation::Residue const & target_conf,
292  core::chemical::ResidueTypeCOP invrot_restype,
293  utility::vector1< core::Size > const & target_ats,
294  utility::vector1< core::Size > const & invrot_ats,
295  bool const flip_exgs_upstream_downstream_samples,
296  bool const backbone_interaction
297  ) const;
298 
299  void
302  ) const;
303 
304 
305 protected:
306 
307  /// @brief reads and stores arbitrary algorithm specific input
308  bool
310  std::string tag,
311  utility::io::izstream & data
312  );
313 
314 //data
315 private:
316 
317  //the index of this mcfi in the mcfi list
319 
320  //allowed positions
322 
323  std::map< core::Size, EnzCstTemplateResOP > enz_template_res_;
324 
326 
327  // the GeomSampleInfos read from the file
329 
330  //container for arbritrary algorithm specific information
331  std::map< std::string, utility::vector1< std::string > > algorithm_inputs_;
332 
334 
335  //Kui Native 110809
336  bool native_;
337 };
338 
339 
340 /// @brief a simple container class to contain several MatchConstraintFileInfo
341 /// instances. this can also query the MatchConstraintFileInfos for common upstream
342 /// restypes and put all their geomsamples into one list
344 {
345 
346 public:
348  core::chemical::ResidueTypeSetCAP restype_set );
349 
351 
352 public: //accessors
353 
356  return upstream_restypes_; }
357 
360 
361  //utility::vector1< protocols::match::ExternalGeomSampler >
362  //exgs_for_upstream_restype( std::string upstream_name3 ) const;
363 
364  //also functions for downstream builders and launch points
365 
367  mcfi( core::Size which_mcfi ) const {
368  return mcfis_[ which_mcfi ]; }
369 
370  //MatchConstraintFileInfoCOP
371  //active_mcfi() const {
372  //return mcfis_[ active_mcfi_ ]; }
373 
374  core::Size
375  num_mcfis() const {
376  return mcfis_.size(); }
377 
378 
379 public: //mutators
380 
381  /// @brief data reading routine
382  bool
383  read_data( utility::io::izstream & data );
384 
385 public: //convenience functions
386 
387  /// @brief function that takes all rotamers for the ResidueType(s)
388  /// that interact with the target residues and places them according
389  /// according to the geometry specified
390  std::list< core::conformation::ResidueCOP >
392  core::Size const target_template,
393  core::conformation::ResidueCOP target_conf ) const;
394 
395 protected:
396 
397 
398  /// @brief goes through all the mcfis and figures out the upstream restypes
399  void
401 
402 private:
403 
404  //core::Size active_mcfi_;
405 
407 
409 
410  std::map< core::chemical::ResidueTypeCOP, utility::vector1< MatchConstraintFileInfoCOP > > mcfis_for_restype_;
411 
413 
414 };
415 
416 }
417 } //namespace enzdes
418 } //namespace protocols
419 
420 
421 
422 
423 #endif //