Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SecondaryMatcherToDownstreamResidue.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/match/downstream/SecondaryMatcherToDownstreamResidue.hh
12 /// @brief Class declaration for secondary matcher that generates upstream-only hits
13 /// matching the geometry of one upstream residue with another upstream residue
14 /// generated in a previous round.
15 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com)
16 /// @author Florian Richter (flosopher@gmail.com)
17 
18 #ifndef INCLUDED_protocols_match_downstream_SecondaryMatcherToDownstreamResidue_hh
19 #define INCLUDED_protocols_match_downstream_SecondaryMatcherToDownstreamResidue_hh
20 
21 // Unit headers
23 
24 // Package headers
26 // AUTO-REMOVED #include <protocols/match/Hit.hh>
29 // AUTO-REMOVED #include <protocols/match/upstream/UpstreamBuilder.hh>
31 
32 // Project headers
33 #include <core/types.hh>
36 // AUTO-REMOVED #include <core/id/AtomID.hh>
37 
38 // Utility headers
39 #include <utility/pointer/ReferenceCount.hh>
40 #include <utility/vector1.hh>
41 // C++ headers
42 #include <list>
43 
44 #include <core/id/AtomID.hh>
45 
46 
47 namespace protocols {
48 namespace match {
49 namespace downstream {
50 
51 /// @brief A class for an algorithm. Given a conformation of the downstream partner,
52 /// the algorithm is responsible for producing a set of hits.
54 {
55 public:
57  typedef std::pair< SecMatchResiduePairEvaluatorCOP, Size > Evaluator_MCFI_ID_Pair;
58  typedef std::list< Evaluator_MCFI_ID_Pair > EvaluatorSet;
59 
60 public:
62 
64 
65  virtual
67  clone() const;
68 
69  /// @brief Main driver function for hit generation. This DownstreamAlgorithm
70  /// structures it's iteration over the hits from previous rounds as follows:
71  /// for i = 1:this->geom_cst_id() - 1
72  /// if ( ! matcher->representative_downstream_algorithm( i )->generates_primary_hits() ) continue;
73  /// for j = 1:n_build_points_for_geomcst( i )
74  /// recover_downstream_coordinates_from_previous_round( hit_subset_j );
75  /// initialize TaretRotamerCoords data for all downstream algorithms with the same geom_cst_id
76  /// #omp parallel for /// All class access below this point is const and parallelizable
77  /// for k = 1:n_build_positions
78  /// /// call this function to start l loop: matcher.upstream_builder[ geom_cst_id() ]->build( k )
79  /// for l = 1:n_rotamers_k
80  /// /// call to start m loop: downstream_algorithm->build( k, l, rotamer_l ) )
81  /// for m = 1:n_hits_in_block_j
82  /// if ( respair_evaluator_->evaluate_residues( rotamer_l, rotamer_m )
83  /// hit_list.append( Hit( k, l, i, 1, hit[ m ].second() ));
84  /// return hit_list
85  /// There are two important consequences to this hit-generation layout.
86  /// 1. The coordinates for rotamer_l are computed sum( i, n_build_points_for_geomcst( i )) times.
87  /// 2. The number of downstream target coordinates that live in memory at the same time is bound by some constant (10K).
88  /// This is a clear trade-off between performance and memory
89  /// NOTE: the most time consuming portion will likely be the m loop, and not the repeated construction
90  /// of coordinates in the j loop. Reguardless of how many times we rebuild coordinates for rotamer j, the expense
91  /// will primarily lie in the same place: the call to evaluate_residues( rotamer_l, rotamer_m ).
92  /// NOTE: if there are ways to iterate across the j loop differently, it likely possible to prune m/l combinations early
93  /// and thereby improve running time.
94  virtual
95  std::list< Hit >
97  Matcher & matcher
98  );
99 
100 
101  /// @brief mimic the classic matcher's reset of the Occupied space hash.
102  virtual
103  void
104  respond_to_primary_hitlist_change( Matcher & matcher, Size round_just_completed );
105 
106  /// @brief Remove my hits if they fall into a volume of the occupied space hash
107  /// that is no longer occupied.
108  virtual
109  void
111 
112 
113  /// @brief Iterate across the conformations of the downstream residue coming from hits
114  /// generated in previous rounds, and add hits for each upstream residue that
115  /// (Also, see comments for the
116  /// build_at_all_positions method.)
117  virtual
118  std::list< Hit >
119  build(
120  Size const scaffold_build_point_id,
121  Size const upstream_conf_id,
122  core::conformation::Residue const & upstream_residue
123  ) const;
124 
125  /// @brief returns false; this secondary matcher describes the location
126  /// of the downstream partner even though it does not generate that location
127  /// itself. Matches may be found by hashing the 6D coordinate of the
128  /// downstream partner.
129  virtual
130  bool
131  upstream_only() const;
132 
133  /// @brief This method returns 'false' since this matcher does not describe
134  /// the coordinates of the downstream partner at all.
135  virtual
136  bool
137  generates_primary_hits() const;
138 
141 
142  virtual
143  Size
145 
146  void
148 
149  void
150  set_focused_geomcst_id( Size focused_geomcst_id );
151 
152  void
155  Size mcfi_id
156  );
157 
158  void
160  utility::vector1< core::Size > catalytic_atoms
161  ){
162  catalytic_atoms_ = catalytic_atoms;
163  }
164 
165 // void
166 // set_dsbuilders(
167 // std::map<std::string, DownstreamBuilderCOP> dsbuilders
168 // );
169 
170  //assign minimum separation distance to downstream-upstrean pair
171  //min_sep_d2_from_upstream_atoms_[ downstream ][ upstream ].second distance
172  //min_sep_d2_from_upstream_atoms_[ downstream ][ upstream ].first
173 // void
174 // initialize_upstream_residue(
175 // core::chemical::ResidueTypeCOP us_res /*upstream residue*/
176 // );
177 
178 private:
179 
180  void
182  Matcher & matcher
183  );
184 
185  void
187  Matcher & matcher,
188  Size target_geomcst_id
189  );
190 
191  bool
193  Matcher & matcher,
194  Size target_geomcst_id,
195  upstream::ScaffoldBuildPoint const & target_build_point
196  );
197 
198  /// @brief Allow another SecondaryMatcherToDownstreamResidue to set my
199  /// TargetRotamerCoords object so that we can share this data.
200  void
201  set_target_rotamer_coords( TargetRotamerCoordsOP target_geomcst_coords );
202 
203  void
206  ){
208  }
209 
210  bool
212  Size index
213  ) const;
214 
217 
218 private:
219 
223 // std::map < std::string, DownstreamBuilderCOP > dsbuilders_;
224 
229 
232  //catalytic_atoms_[2] and catalytic_atoms_[1] upstream two atoms
233  //(built from distance and angle) from the constraint
234  //catalytic_atoms_[3] and catalytic_atoms_[4] downstream two atoms
235  //(built from distance and angle) from the constraint
237 
238  //utility::vector1< core::id::AtomID > downstream_atoms_for_clash_checking_ ;
240 };
241 
242 }
243 }
244 }
245 
246 #endif