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
NonSequentialNeighborsFilter.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/NonSequentialNeighborsFilter.cc
11
/// @brief
12
/// @author Gabi Pszolla & Sarel Fleishman
13
14
15
//Unit Headers
16
#include <
protocols/simple_filters/NonSequentialNeighborsFilter.hh
>
17
#include <
protocols/simple_filters/NonSequentialNeighborsFilterCreator.hh
>
18
#include <utility/tag/Tag.hh>
19
#include <
core/conformation/Conformation.hh
>
20
#include <numeric/xyzVector.hh>
21
//Project Headers
22
#include <basic/Tracer.hh>
23
#include <
protocols/rigid/RigidBodyMover.hh
>
24
#include <
core/pose/Pose.hh
>
25
namespace
protocols{
26
namespace
simple_filters {
27
28
static
basic::Tracer
TR
(
"protocols.simple_filters.NonSequentialNeighborsFilter"
);
29
30
protocols::filters::FilterOP
31
NonSequentialNeighborsFilterCreator::create_filter
()
const
{
return
new
NonSequentialNeighborsFilter
; }
32
33
std::string
34
NonSequentialNeighborsFilterCreator::keyname
()
const
{
return
"NonSequentialNeighbors"
; }
35
36
//default ctor
37
NonSequentialNeighborsFilter::NonSequentialNeighborsFilter
() :
38
protocols::filters::
Filter
(
"NonSequentialNeighbors"
),
39
distance_threshold_( 8.0 ),
40
neighbor_cutoff_( 10 ),
41
bound_( false ),
42
resnum_( 0 ),
43
jump_( 1 )
44
{
45
}
46
47
NonSequentialNeighborsFilter::~NonSequentialNeighborsFilter
() {}
48
49
void
50
NonSequentialNeighborsFilter::parse_my_tag
(
utility::tag::TagPtr
const
tag,
moves::DataMap
&,
filters::Filters_map
const
&,
moves::Movers_map
const
&,
core::pose::Pose
const
& )
51
{
52
distance_threshold
( tag->getOption<
core::Real
>(
"distance_threshold"
, 8.0 ) );
53
neighbor_cutoff
( tag->getOption<
core::Size
>(
"neighbor_cutoff"
, 10 ));
54
bound
( tag->getOption<
bool
>(
"bound"
,
false
) );
55
resnum
( tag->getOption<
core::Size
>(
"resnum"
, 0 ) );
56
jump
( tag->getOption<
core::Size
>(
"jump"
, 1 ) );
57
58
TR
<<
"jump: "
<<
jump
()<<
" distance_threshold: "
<<
distance_threshold
()<<
" neighbor_cutoff: "
<<
neighbor_cutoff
()<<
" bound: "
<<
bound
()<<
" resnum: "
<<
resnum
()<<std::endl;
59
}
60
61
bool
62
NonSequentialNeighborsFilter::apply
(
core::pose::Pose
const
& pose )
const
{
63
compute
( pose );
64
return
(
true
);
65
}
66
67
void
68
NonSequentialNeighborsFilter::report
( std::ostream &,
core::pose::Pose
const
& pose )
const
{
69
compute
( pose );
70
}
71
72
core::Real
73
NonSequentialNeighborsFilter::report_sm
(
core::pose::Pose
const
& pose )
const
{
74
return
(
compute
( pose ) );
75
}
76
77
core::Size
78
NonSequentialNeighborsFilter::residue_neighbors
(
core::pose::Pose
const
& pose,
core::Size
const
resi )
const
{
79
core::Size
count_neighbors = 0;
80
core::Size
const
target_chain( pose.
chain
( resi ) );
81
for
(
core::Size
resj = pose.
conformation
().
chain_begin
( target_chain ); resj <= pose.
conformation
().
chain_end
( target_chain ); ++resj ){
82
if
( resj >= resi -
neighbor_cutoff
() && resj <= resi +
neighbor_cutoff
() )
83
continue
;
84
core::Real
const
distance
( pose.
residue
( resi ).
xyz
( pose.
residue
( resi ).
nbr_atom
() ).
distance
( pose.
residue
( resj ).
xyz
( pose.
residue
( resj ).
nbr_atom
() ) ) );
85
if
(
distance
<=
distance_threshold
() )
86
count_neighbors++;
87
}
88
return
( count_neighbors );
89
}
90
91
core::Real
92
NonSequentialNeighborsFilter::compute
(
93
core::pose::Pose
const
& pose
94
)
const
{
95
core::pose::Pose
copy_pose( pose );
96
97
if
( !
bound
() ){
98
protocols::rigid::RigidBodyTransMover
rbtm( copy_pose,
jump
() );
99
rbtm.
step_size
( 10000.0 );
100
rbtm.
apply
( copy_pose );
101
TR
.Debug<<
"Unbound complex"
<<std::endl;
102
}
103
if
(
resnum
() == 0 ){
// working on entire protein
104
for
(
core::Size
resi = 1; resi <= pose.
total_residue
(); ++resi ){
105
core::Size
const
count_neighbors(
residue_neighbors
( copy_pose, resi ) );
106
TR
.Debug<<
"neighbors of residue "
<<resi<<
": "
<<count_neighbors<<std::endl;
107
}
// for resi
108
return
1.0;
// dummy return
109
}
// fi resnum==0
110
core::Size
const
count_neighbors(
residue_neighbors
( copy_pose,
resnum
() ) );
111
TR
.Debug<<
"neighbors of residue "
<<
resnum
()<<
": "
<<count_neighbors<<std::endl;
112
return
( count_neighbors );
113
}
114
115
}
116
}
Generated on Sat Jun 1 2013 12:13:42 for Rosetta 3.5 by
1.8.4