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
output
LimitHitsPerRotamerFilter.cc
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/output/LimitHitsPerRotamerFilter.hh
12
/// @brief
13
/// @author Alex Zanghellini (zanghell@u.washington.edu)
14
/// @author Andrew Leaver-Fay (aleaverfay@gmail.com), porting to mini
15
16
17
// Unit headers
18
#include <
protocols/match/output/LimitHitsPerRotamerFilter.hh
>
19
20
// Package headers
21
#include <
protocols/match/output/MatchFilter.hh
>
22
#include <
protocols/match/Hit.hh
>
23
24
// Utility headers
25
#include <utility/exit.hh>
26
#include <utility/OrderedTuple.hh>
27
// AUTO-REMOVED #include <utility/vector1.hh>
28
29
// C++ headers
30
#include <map>
31
32
namespace
protocols {
33
namespace
match
{
34
namespace
output {
35
36
LimitHitsPerRotamerFilter::LimitHitsPerRotamerFilter
()
37
:
StateAccumulatingMatchFilter
(
"LimitHitsPerRotamerFilter"
)
38
{}
39
LimitHitsPerRotamerFilter::LimitHitsPerRotamerFilter
(
Size
n_geometric_constraints ) :
40
StateAccumulatingMatchFilter
(
"LimitHitsPerRotamerFilter"
),
41
n_geometric_constraints_( n_geometric_constraints )
42
{}
43
44
void
45
LimitHitsPerRotamerFilter::set_n_geometric_constraints
(
Size
n_csts )
46
{
47
n_geometric_constraints_
= n_csts;
48
49
}
50
51
void
52
LimitHitsPerRotamerFilter::set_limit_for_rotamer_combo
(
Size
limit )
53
{
54
limit_per_rotamer_combo_
= limit;
55
}
56
57
LimitHitsPerRotamerFilter::~LimitHitsPerRotamerFilter
() {}
58
59
/// @brief Returns true if the given match passes this filter
60
bool
61
LimitHitsPerRotamerFilter::passes_filter
(
62
match
const
& m
63
)
const
64
{
65
runtime_assert( m.size() ==
n_geometric_constraints_
);
66
67
utility::vector1< Size >
rot_vector(
n_geometric_constraints_
* 2, 0 );
68
for
(
Size
ii = 1; ii <=
n_geometric_constraints_
; ++ii ) {
69
rot_vector[ ii ] = m[ ii ].scaffold_build_id();
70
rot_vector[
n_geometric_constraints_
+ ii ] = m[ ii ].upstream_conf_id();
71
}
72
73
RotamerComboCountMap::const_iterator iter =
count_per_rotamer_combo_
.find( rot_vector );
74
if
( iter ==
count_per_rotamer_combo_
.end() ) {
75
return
true
;
76
}
else
{
77
return
iter->second <
limit_per_rotamer_combo_
;
78
}
79
}
80
81
/// @brief Note that a particular match has passed all the filters and will be output.
82
void
83
LimitHitsPerRotamerFilter::note_match_accepted
(
84
match
const
& m
85
)
86
{
87
runtime_assert( m.size() ==
n_geometric_constraints_
);
88
89
utility::vector1< Size >
rot_vector(
n_geometric_constraints_
* 2, 0 );
90
for
(
Size
ii = 1; ii <=
n_geometric_constraints_
; ++ii ) {
91
rot_vector[ ii ] = m[ ii ].scaffold_build_id();
92
rot_vector[
n_geometric_constraints_
+ ii ] = m[ ii ].upstream_conf_id();
93
}
94
95
RotamerComboCountMap::iterator iter =
count_per_rotamer_combo_
.find( rot_vector );
96
if
( iter ==
count_per_rotamer_combo_
.end() ) {
97
count_per_rotamer_combo_
[ rot_vector ] = 1;
98
}
else
{
99
++iter->second;
100
}
101
}
102
103
/// @brief Erase all tracking data on which matches have already been output.
104
void
105
LimitHitsPerRotamerFilter::reset
()
106
{
107
count_per_rotamer_combo_
.clear();
108
}
109
110
}
111
}
112
}
Generated on Sat Jun 1 2013 11:59:40 for Rosetta 3.5 by
1.8.4