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
filters
BasicFilters.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 src/protocols/filters/BasicFilters.hh
11
/// @brief header file for very simple Filter classes
12
/// @detailed
13
/// @author Florian Richter, floric@u.washington.edu (feb 09 ), Sarel Fleishman sarelf@u.washington.edu, Rocco Moretti (rmoretti@u.washington.edu)
14
15
#ifndef INCLUDED_protocols_filters_BasicFilters_hh
16
#define INCLUDED_protocols_filters_BasicFilters_hh
17
18
// Unit Headers
19
#include <
protocols/filters/BasicFilters.fwd.hh
>
20
21
// Package headers
22
#include <
protocols/filters/Filter.hh
>
23
#include <
protocols/moves/Mover.fwd.hh
>
24
#include <
protocols/moves/DataMap.fwd.hh
>
25
#include <
protocols/moves/ResId.hh
>
26
27
// Project Headers
28
#include <
core/types.hh
>
29
#include <
core/pose/Pose.fwd.hh
>
30
31
// Utility headers
32
#include <utility/pointer/ReferenceCount.hh>
33
#include <utility/vector1.hh>
34
#include <utility/tag/Tag.fwd.hh>
35
36
//// C++ headers
37
#include <string>
38
39
namespace
protocols {
40
namespace
filters {
41
42
class
TrueFilter
:
public
Filter
{
43
public
:
44
TrueFilter
() :
Filter
(
"TrueFilter"
) {}
45
bool
apply
(
core::pose::Pose
const
& )
const
{
return
true
; }
46
FilterOP
clone
()
const
{
return
new
TrueFilter
; }
47
FilterOP
fresh_instance
()
const
{
return
new
TrueFilter
; }
48
};
49
50
class
FalseFilter
:
public
Filter
{
51
public
:
52
FalseFilter
() :
Filter
(
"FalseFilter"
) {}
53
bool
apply
(
core::pose::Pose
const
& )
const
{
return
false
; }
54
FilterOP
clone
()
const
{
return
new
FalseFilter
; }
55
FilterOP
fresh_instance
()
const
{
return
new
FalseFilter
; }
56
};
57
58
class
StochasticFilter
:
public
Filter
{
59
60
public
:
61
StochasticFilter
();
62
virtual
~StochasticFilter
();
63
StochasticFilter
(
core::Real
const
confidence );
64
bool
apply
(
core::pose::Pose
const
& pose )
const
;
65
FilterOP
clone
()
const
;
66
FilterOP
fresh_instance
()
const
;
67
void
report
( std::ostream &,
core::pose::Pose
const
& )
const
{}
68
69
void
parse_my_tag
(
70
utility::tag::TagPtr
const
tag,
71
moves::DataMap
&,
72
Filters_map
const
&,
73
moves::Movers_map
const
&,
74
core::pose::Pose
const
& );
75
76
private
:
77
core::Real
confidence_
;
78
};
79
80
/// @brief Used to define a compound logical statement involving other filters with
81
/// AND, OR and XOR
82
class
CompoundFilter
:
public
Filter
,
public
protocols::moves::ResId
83
{
84
public
:
85
typedef
std::vector< std::pair< FilterOP, boolean_operations > >
CompoundStatement
;
86
typedef
CompoundStatement::iterator
iterator
;
87
typedef
CompoundStatement::const_iterator
const_iterator
;
88
89
public
:
90
CompoundFilter
();
91
virtual
~CompoundFilter
();
92
CompoundFilter
(
CompoundStatement
const
& );
93
bool
apply
(
core::pose::Pose
const
& )
const
;
94
FilterOP
clone
()
const
;
95
FilterOP
fresh_instance
()
const
;
96
void
report
( std::ostream &,
core::pose::Pose
const
& )
const
;
97
core::Real
report_sm
(
core::pose::Pose
const
& )
const
;
98
bool
compute
(
core::pose::Pose
const
& )
const
;
99
void
clear
();
100
iterator
begin
();
101
const_iterator
begin
()
const
;
102
iterator
end
();
103
const_iterator
end
()
const
;
104
virtual
void
set_resid
(
core::Size
const
resid );
105
void
invert
(
bool
const
inv );
106
107
void
parse_my_tag
(
108
utility::tag::TagPtr
const
,
109
moves::DataMap
&,
110
Filters_map
const
&,
111
moves::Movers_map
const
&,
112
core::pose::Pose
const
& );
113
114
private
:
115
core::Real
threashold_
;
116
CompoundStatement
compound_statement_
;
117
bool
invert_
;
118
};
119
120
/// @brief Used to combine multiple seperate filters into a single filter value
121
class
CombinedFilter
:
public
Filter
122
{
123
public
:
124
typedef
std::pair< FilterOP, core::Real >
FilterWeightPair
;
125
typedef
utility::vector1< FilterWeightPair >
FilterList
;
126
127
CombinedFilter
();
128
virtual
~CombinedFilter
();
129
bool
apply
(
core::pose::Pose
const
& )
const
;
130
FilterOP
clone
()
const
;
131
FilterOP
fresh_instance
()
const
;
132
void
report
( std::ostream &,
core::pose::Pose
const
& )
const
;
133
core::Real
report_sm
(
core::pose::Pose
const
& )
const
;
134
core::Real
compute
(
core::pose::Pose
const
& )
const
;
135
136
void
parse_my_tag
(
137
utility::tag::TagPtr
const
,
138
moves::DataMap
&,
139
Filters_map
const
&,
140
moves::Movers_map
const
&,
141
core::pose::Pose
const
& );
142
143
private
:
144
core::Real
threshold_
;
145
FilterList
filterlist_
;
146
};
147
148
149
/// @brief Apply a sub-mover prior to calculating a filter value
150
class
MoveBeforeFilter
:
public
Filter
151
{
152
public
:
153
MoveBeforeFilter
();
154
MoveBeforeFilter
(
moves::MoverOP
mover,
FilterCOP
filter);
155
virtual
~MoveBeforeFilter
();
156
bool
apply
(
core::pose::Pose
const
& )
const
;
157
FilterOP
clone
()
const
;
158
FilterOP
fresh_instance
()
const
;
159
void
report
( std::ostream &,
core::pose::Pose
const
& )
const
;
160
core::Real
report_sm
(
core::pose::Pose
const
& )
const
;
161
//No compute(), as it passes everything on to the sub-mover
162
163
void
parse_my_tag
(
164
utility::tag::TagPtr
const
,
165
moves::DataMap
&,
166
Filters_map
const
&,
167
moves::Movers_map
const
&,
168
core::pose::Pose
const
& );
169
170
private
:
171
FilterCOP
subfilter_
;
172
moves::MoverOP
submover_
;
173
};
174
175
/// @brief Evaluate to a value contingent on the evaluation of another filter.
176
class
IfThenFilter
:
public
Filter
177
{
178
public
:
179
IfThenFilter
();
180
//IfThenFilter(moves::MoverOP mover, FilterCOP filter);
181
virtual
~IfThenFilter
();
182
bool
apply
(
core::pose::Pose
const
& )
const
;
183
FilterOP
clone
()
const
;
184
FilterOP
fresh_instance
()
const
;
185
void
report
( std::ostream &,
core::pose::Pose
const
& )
const
;
186
core::Real
report_sm
(
core::pose::Pose
const
& )
const
;
187
core::Real
compute
(
core::pose::Pose
const
& )
const
;
188
189
void
threshold
(
core::Real
threshold
) {
threshold_
=
threshold
; }
190
/// @brief Set if threshold is an upper (false/default) or lower (true) limit
191
void
set_lower_threshold
(
bool
floor =
false
) {
floor_
= floor; }
192
193
/// @brief Add a condition to the test.
194
/// If testfilter evaluates true, then this filter evaluates to valuefilter.
195
/// If valuefilter is NULL, then return value instead.
196
/// Conditions are evaluated in the order they were added.
197
void
add_condition
(
FilterCOP
testfilter,
FilterCOP
valuefilter,
core::Real
value = 0,
bool
invert =
false
,
core::Real
weight = 1 );
198
199
/// @brief Add evaluation if no conditions trigger
200
/// If elsefilter is Null, use absolute value value instead.
201
void
set_else
(
FilterCOP
elsefilter,
core::Real
value = 0,
core::Real
elseweight = 1 );
202
203
void
parse_my_tag
(
204
utility::tag::TagPtr
const
,
205
moves::DataMap
&,
206
Filters_map
const
&,
207
moves::Movers_map
const
&,
208
core::pose::Pose
const
& );
209
210
private
:
211
utility::vector1< FilterCOP >
iffilters_
;
212
utility::vector1< FilterCOP >
thenfilters_
;
213
utility::vector1< core::Real >
values_
;
214
utility::vector1< core::Real >
weights_
;
215
///@brief If true, invert the sense of the iffilter test.
216
utility::vector1< bool >
invert_
;
217
218
FilterCOP
elsefilter_
;
219
core::Real
elsevalue_
;
220
core::Real
elseweight_
;
221
222
core::Real
threshold_
;
223
///@brief If true, threshold_ is a lower limit, rather than upper limit
224
bool
floor_
;
225
};
226
227
}
// filters
228
}
// protocols
229
230
#endif
Generated on Sat Jun 1 2013 11:49:44 for Rosetta 3.5 by
1.8.4