Rosetta 3.5
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
protocols
match
downstream
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
22
#include <
protocols/match/downstream/SecondaryMatcherToDownstreamResidue.fwd.hh
>
23
24
// Package headers
25
#include <
protocols/match/Matcher.hh
>
26
// AUTO-REMOVED #include <protocols/match/Hit.hh>
27
#include <
protocols/match/downstream/DownstreamAlgorithm.hh
>
28
#include <
protocols/match/downstream/SecMatchResiduePairEvaluator.fwd.hh
>
29
// AUTO-REMOVED #include <protocols/match/upstream/UpstreamBuilder.hh>
30
#include <
protocols/match/downstream/SecondaryMatcherToUpstreamResidue.fwd.hh
>
31
32
// Project headers
33
#include <
core/types.hh
>
34
#include <
core/chemical/ResidueType.fwd.hh
>
35
#include <
core/conformation/Residue.fwd.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.
53
class
SecondaryMatcherToDownstreamResidue
:
public
DownstreamAlgorithm
54
{
55
public
:
56
typedef
DownstreamAlgorithm
parent
;
57
typedef
std::pair< SecMatchResiduePairEvaluatorCOP, Size >
Evaluator_MCFI_ID_Pair
;
58
typedef
std::list< Evaluator_MCFI_ID_Pair >
EvaluatorSet
;
59
60
public
:
61
SecondaryMatcherToDownstreamResidue
(
core::pose::PoseCOP
upstream_pose,
Size
geom_cst_id
);
62
63
virtual
~SecondaryMatcherToDownstreamResidue
();
64
65
virtual
66
DownstreamAlgorithmOP
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 >
96
build_hits_at_all_positions
(
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
110
respond_to_peripheral_hitlist_change
(
Matcher
& matcher );
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
139
HitPtrListCOP
140
hits_to_include_with_partial_match
(
match_dspos1
const
& )
const
;
141
142
virtual
143
Size
144
n_possible_hits_per_upstream_conformation
()
const
;
145
146
void
147
set_downstream_restype
(
core::chemical::ResidueTypeCOP
downstream_restype );
148
149
void
150
set_focused_geomcst_id
(
Size
focused_geomcst_id );
151
152
void
153
add_evaluator
(
154
SecMatchResiduePairEvaluatorCOP
evaluator,
155
Size
mcfi_id
156
);
157
158
void
159
set_catalytic_atoms
(
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
181
prepare_for_hit_generation
(
182
Matcher
& matcher
183
);
184
185
void
186
prepare_for_hit_generation_for_geomcst
(
187
Matcher
& matcher,
188
Size
target_geomcst_id
189
);
190
191
bool
192
prepare_for_hit_generation_at_target_build_point
(
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
204
set_ds_coords_needed
(
205
utility::vector1< core::id::AtomID >
ds_coords
206
){
207
downstream_atom_coordinates_needed_
= ds_coords;
208
}
209
210
bool
211
ds_atom_present
(
212
Size
index
213
)
const
;
214
215
utility::vector1< utility::vector1< utility::vector1< std::pair< core::Size, core::Real >
> > >
216
get_min_sep_d2_from_upstream_atoms
()
const
;
217
218
private
:
219
220
core::chemical::ResidueTypeCOP
downstream_restype_
;
221
core::pose::PoseCOP
upstream_pose_
;
222
EvaluatorSet
respair_evaluators_
;
223
// std::map < std::string, DownstreamBuilderCOP > dsbuilders_;
224
225
Size
focused_geomcst_id_
;
226
Matcher::HitListConstIterator
hits_for_focused_geomcst_and_build_point_begin_
;
227
Matcher::HitListConstIterator
hits_for_focused_geomcst_and_build_point_end_
;
228
Matcher::HitListConstIterator
hits_for_focused_geomcst_end_
;
229
230
mutable
TargetRotamerCoordsOP
target_downstream_coords_
;
231
utility::vector1< core::id::AtomID >
downstream_atom_coordinates_needed_
;
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
236
utility::vector1< core::Size >
catalytic_atoms_
;
237
238
//utility::vector1< core::id::AtomID > downstream_atoms_for_clash_checking_ ;
239
Size
occspace_rev_id_at_last_update_
;
240
};
241
242
}
243
}
244
}
245
246
#endif
Generated on Sat Jun 1 2013 11:59:30 for Rosetta 3.5 by
1.8.4