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
simple_filters
ResidueDistanceFilter.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/simple_filters/ResidueDistanceFilter.cc
11
/// @brief
12
/// @author Sarel Fleishman (sarelf@u.washington.edu), Jacob Corn (jecorn@u.washington.edu)
13
14
#include <
protocols/simple_filters/ResidueDistanceFilter.hh
>
15
#include <
protocols/simple_filters/ResidueDistanceFilterCreator.hh
>
16
17
#include <utility/tag/Tag.hh>
18
#include <
protocols/moves/DataMap.hh
>
19
#include <
protocols/rosetta_scripts/util.hh
>
20
#include <
core/pose/selection.hh
>
21
#include <
core/conformation/Residue.hh
>
22
#include <
core/conformation/Conformation.hh
>
23
#include <
core/pose/Pose.hh
>
24
25
// Utility Headers
26
#include <basic/Tracer.hh>
27
28
29
namespace
protocols {
30
namespace
simple_filters {
31
32
static
basic::Tracer
residue_distance_filter_tracer
(
"protocols.simple_filters.ResidueDistanceFilter"
);
33
34
protocols::filters::FilterOP
35
ResidueDistanceFilterCreator::create_filter
()
const
{
return
new
ResidueDistanceFilter
; }
36
37
std::string
38
ResidueDistanceFilterCreator::keyname
()
const
{
return
"ResidueDistance"
; }
39
40
ResidueDistanceFilter::~ResidueDistanceFilter
(){}
41
42
void
43
ResidueDistanceFilter::parse_my_tag
(
utility::tag::TagPtr
const
tag,
moves::DataMap
&,
filters::Filters_map
const
&,
moves::Movers_map
const
&,
core::pose::Pose
const
& pose )
44
{
45
res1_
=
core::pose::get_resnum
( tag, pose,
"res1_"
);
46
res2_
=
core::pose::get_resnum
( tag, pose,
"res2_"
);
47
distance_threshold_
= tag->getOption<
core::Real
>(
"distance"
, 8.0 );
48
49
residue_distance_filter_tracer
<<
"ResidueDistanceFilter with distance threshold of "
<<
distance_threshold_
<<
" between residues "
<<
res1_
<<
" and "
<<
res2_
<<std::endl;
50
}
51
52
bool
53
ResidueDistanceFilter::apply
(
core::pose::Pose
const
& pose )
const
{
54
core::Real
const
distance
(
compute
( pose ) );
55
56
residue_distance_filter_tracer
<<
"Distance between residues "
<<pose.
residue
(
res1_
).
name3
()<<
res1_
<<
" and "
<<pose.
residue
(
res2_
).
name3
()<<
res2_
<<
" is "
<<distance<<std::endl;
57
return
( distance<=
distance_threshold_
);
58
}
59
60
void
61
ResidueDistanceFilter::report
( std::ostream & out,
core::pose::Pose
const
& pose )
const
{
62
core::Real
const
distance
(
compute
( pose ) );
63
64
out<<
"Distance between residues "
<<pose.
residue
(
res1_
).
name3
()<<
res1_
<<
" and "
<<pose.
residue
(
res2_
).
name3
()<<
res2_
<<
" is "
<<distance<<
'\n'
;
65
}
66
67
core::Real
68
ResidueDistanceFilter::report_sm
(
core::pose::Pose
const
& pose )
const
{
69
core::Real
const
distance
(
compute
( pose ) );
70
71
return
( distance );
72
}
73
core::Real
74
ResidueDistanceFilter::compute
(
core::pose::Pose
const
& pose )
const
{
75
core::conformation::Residue
const
res_res1( pose.
conformation
().
residue
(
res1_
) );
76
core::conformation::Residue
const
res_res2( pose.
conformation
().
residue
(
res2_
) );
77
core::Real
const
distance
( res_res1.xyz( res_res1.nbr_atom() ).
distance
( res_res2.xyz( res_res2.nbr_atom() ) ) );
78
return
(
distance
);
79
}
80
81
}
82
}
Generated on Sat Jun 1 2013 12:14:07 for Rosetta 3.5 by
1.8.4