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
fldsgn
filters
NcontactsFilter.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
//
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 protocols/filters/NcontactsFilter.cc
11
/// @brief filter structures by sheet topology
12
/// @detailed
13
/// @author Nobuyasu Koga ( nobuyasu@uw.edu )
14
15
// Unit Headers
16
#include <
protocols/fldsgn/filters/NcontactsFilter.hh
>
17
#include <
protocols/fldsgn/filters/NcontactsFilterCreator.hh
>
18
19
// Package Headers
20
#include <
protocols/fldsgn/NcontactsCalculator.hh
>
21
22
// Project Headers
23
#include <basic/MetricValue.hh>
24
#include <basic/Tracer.hh>
25
26
#include <
protocols/filters/Filter.hh
>
27
#include <utility/tag/Tag.hh>
28
29
//// C++ headers
30
// AUTO-REMOVED #include <cmath>
31
#include <map>
32
33
#include <utility/vector0.hh>
34
#include <utility/vector1.hh>
35
36
37
static
basic::Tracer
tr
(
"protocols.fldsgn.filters.NcontactsFilter"
);
38
39
namespace
protocols {
40
namespace
fldsgn {
41
namespace
filters {
42
43
/// @brief default constructor
44
NcontactsFilter::NcontactsFilter
():
45
Filter
(
"Ncontacts"
),
46
report_type_(
"sidechain_heavy_apolar_atm"
),
47
filter_value_( 0.0 )
48
{}
49
50
/// @brief default constructor
51
NcontactsFilter::NcontactsFilter
(
52
String
const
& report_type,
53
Real
const
filter_value ):
54
Filter
(
"Ncontacts"
),
55
report_type_( report_type ),
56
filter_value_( filter_value )
57
{}
58
59
/// @brief copy constructor
60
NcontactsFilter::NcontactsFilter
(
NcontactsFilter
const
& rval ):
61
//utility::pointer::ReferenceCount(),
62
Super
( rval ),
63
report_type_( rval.report_type_ ),
64
filter_value_( rval.filter_value_ )
65
{}
66
67
/// @brief destructor
68
NcontactsFilter::~NcontactsFilter
(){}
69
70
/// @brief
71
NcontactsFilter::Real
72
NcontactsFilter::report_sm
(
Pose
const
& pose )
const
73
{
74
return
compute
( pose );
75
}
76
77
/// @brief
78
void
79
NcontactsFilter::report
( std::ostream & out,
Pose
const
& pose )
const
80
{
81
out <<
"Ncontacts: "
<<
compute
( pose ) <<
"\n"
;
82
}
83
84
85
// @brief returns true if the given pose passes the filter, false otherwise.
86
// In this case, the test is whether the give pose is the topology we want.
87
bool
88
NcontactsFilter::apply
(
Pose
const
& pose )
const
89
{
90
Real
score
=
compute
( pose );
91
92
if
(
filter_value_
< score ){
93
return
true
;
94
}
else
{
95
return
false
;
96
}
97
}
// apply
98
99
/// @brief comute ncontacts
100
NcontactsFilter::Real
101
NcontactsFilter::compute
(
Pose
const
& pose )
const
102
{
103
104
basic::MetricValue< Real > ncontact;
105
106
NcontactsCalculator
calc_ncon;
107
calc_ncon.
get
(
report_type_
, ncontact, pose );
108
109
return
ncontact.value();
110
}
// compute
111
112
/// @brief parse xml
113
void
114
NcontactsFilter::parse_my_tag
(
115
TagPtr
const
tag,
116
DataMap
&,
117
Filters_map
const
&,
118
Movers_map
const
&,
119
Pose
const
& )
120
{
121
report_type_
= tag->getOption<
String
>(
"type"
,
"sidechain_heavy_apolar_atm"
);
122
filter_value_
= tag->getOption<
Real
>(
"value"
, 0.0 );
123
}
124
125
protocols::filters::FilterOP
126
NcontactsFilterCreator::create_filter
()
const
{
return
new
NcontactsFilter
; }
127
128
std::string
129
NcontactsFilterCreator::keyname
()
const
{
return
"Ncontacts"
; }
130
131
132
133
}
// filters
134
}
// fldsgn
135
}
// protocols
Generated on Sat Jun 1 2013 11:49:57 for Rosetta 3.5 by
1.8.4