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
protein_interface_design
filters
TorsionFilter.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 sw=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
/// @author Sarel Fleishman (sarelf@uw.edu)
11
#include <
protocols/protein_interface_design/filters/TorsionFilter.hh
>
12
#include <
protocols/protein_interface_design/filters/TorsionFilterCreator.hh
>
13
#include <sstream>
14
#include <
core/conformation/Residue.hh
>
15
#include <
core/pose/PDBInfo.hh
>
16
#include <
core/pose/Pose.hh
>
17
#include <utility/tag/Tag.hh>
18
#include <
protocols/filters/Filter.hh
>
19
// AUTO-REMOVED #include <protocols/moves/DataMap.hh>
20
#include <basic/Tracer.hh>
21
#include <
protocols/rosetta_scripts/util.hh
>
22
#include <
core/pose/selection.hh
>
23
#include <boost/foreach.hpp>
24
#define foreach BOOST_FOREACH
25
//Auto Headers
26
#include <utility/vector0.hh>
27
#include <utility/vector1.hh>
28
#include <
core/pack/task/TaskFactory.hh
>
29
30
31
namespace
protocols {
32
namespace
protein_interface_design{
33
namespace
filters {
34
35
static
basic::Tracer
TR
(
"protocols.protein_interface_design.filters.Torsion"
);
36
static
basic::Tracer
TR_database
(
"protocols.protein_interface_design.filters.Torsion_database"
);
37
38
///@brief default ctor
39
Torsion::Torsion
() :
40
parent
(
"Torsion"
),
41
lower_( false ),
42
upper_( true ),
43
resnum_( 0 ),
44
torsion_(
""
),
45
task_factory_( NULL ),
46
task_factory_set_( false )
47
{}
48
49
bool
50
Torsion::apply
(
core::pose::Pose
const
& pose )
const
51
{
52
if
(
task_factory_set
() ){
53
utility::vector1< core::Size >
designable(
protocols::rosetta_scripts::residue_packer_states
( pose,
task_factory
(),
true
/*designable*/
,
false
/*packable*/
) );
54
std::sort( designable.begin(), designable.end() );
55
core::Size
const
start
( designable[ 1 ] );
56
core::Size
const
stop
( designable[ designable.size() ] );
57
for
(
core::Size
i = start; i<=
stop
; ++i )
58
TR_database<<pose.
phi
( i )<<
" "
<<pose.
psi
( i )<<
" "
<<pose.
omega
( i )<<
" "
<<pose.
residue
( i ).
name3
()<<
" "
;
59
TR_database<<std::endl;
60
return
true
;
61
}
62
else
if
(
resnum
() == 0 ){
// just print all torsions
63
std::stringstream s(
""
);
64
for
(
core::Size
i = 1; i <= pose.
total_residue
(); ++i ){
65
if
( i % 5 == 0 ) s << pose.
residue
( i ).
name1
()<<pose.
pdb_info
()->number( i )<<pose.
pdb_info
()->chain( i )<<
'\t'
;
66
TR<<
"Residue "
<<pose.
residue
( i ).
name1
()<<pose.
pdb_info
()->number( i )<<pose.
pdb_info
()->chain( i )<<
'\t'
;
67
if
(
torsion
() ==
"phi"
||
torsion
() ==
""
){
68
TR<<
" phi "
<<pose.
phi
( i )<<
'\t'
;
69
s<<pose.
phi
( i )<<
' '
;
70
}
71
if
(
torsion
() ==
"psi"
||
torsion
() ==
""
){
72
TR<<
" psi "
<<pose.
psi
( i )<<
'\t'
;
73
s<<pose.
psi
( i )<<
' '
;
74
}
75
if
(
torsion
() ==
"omega"
||
torsion
() ==
""
){
76
TR<<
" omega "
<<pose.
omega
( i )<<std::endl;
77
s<<pose.
omega
( i )<<
' '
;
78
}
79
}
80
TR<<s.str()<<std::endl;
81
return
true
;
82
}
83
else
{
84
TR<<
"Residue "
<<pose.
residue
(
resnum
() ).
name1
()<<pose.
pdb_info
()->number(
resnum
() )<<pose.
pdb_info
()->chain(
resnum
() )<<
'\t'
;
85
if
(
torsion
() ==
"phi"
||
torsion
() ==
""
){
86
core::Real
const
phi
( pose.
phi
(
resnum
() ) );
87
TR<<
" phi "
<<
phi
<<std::endl;
88
if
(
torsion
() ==
"phi"
)
89
return
(
phi
>=
lower
() &&
phi
<=
upper
() );
90
}
91
if
(
torsion
() ==
"psi"
||
torsion
() ==
""
){
92
core::Real
const
psi
( pose.
psi
(
resnum
() ) );
93
TR<<
" psi "
<<pose.
psi
(
resnum
() )<<std::endl;
94
if
(
torsion
() ==
"psi"
)
95
return
(
psi
>=
lower
() &&
psi
<=
upper
() );
96
}
97
}
98
99
return
false
;
100
}
101
102
core::Real
103
Torsion::compute
(
core::pose::Pose
const
& p )
const
{
104
if
(
resnum
() > 0 ){
105
if
(
torsion
() ==
"phi"
)
return
p.
phi
(
resnum
() );
106
if
(
torsion
() ==
"psi"
)
return
p.
psi
(
resnum
() );
107
if
(
torsion
() ==
"omega"
)
return
p.
omega
(
resnum
() );
108
}
109
return
0.;
// You gotta return something!
110
}
111
112
core::Real
113
Torsion::report_sm
(
core::pose::Pose
const
& pose )
const
114
{
115
return
(
compute
( pose ) );
116
}
117
118
void
119
Torsion::report
( std::ostream & out,
core::pose::Pose
const
& pose )
const
120
{
121
out<<
"Torsion returns "
<<
compute
( pose )<<std::endl;
122
}
123
124
void
125
Torsion::parse_my_tag
(
utility::tag::TagPtr
const
tag,
126
protocols::moves::DataMap
& data,
127
protocols::filters::Filters_map
const
&,
128
protocols::moves::Movers_map
const
&,
129
core::pose::Pose
const
& pose )
130
{
131
task_factory_set
(
false
);
132
if
( tag->hasOption(
"task_operations"
) )
133
task_factory_set
(
true
);
134
runtime_assert(
task_factory_set_
!= tag->hasOption(
"resnum"
) );
135
lower
( tag->getOption<
core::Real
>(
"lower"
, 0 ) );
136
task_factory
(
protocols::rosetta_scripts::parse_task_operations
( tag, data ) );
137
upper
( tag->getOption<
core::Real
>(
"upper"
, 0 ) );
138
torsion
( tag->getOption<
std::string
>(
"torsion"
,
""
) );
139
if
( tag->hasOption(
"resnum"
))
140
resnum
(
core::pose::parse_resnum
( tag->getOption<
std::string
>(
"resnum"
), pose ) );
141
else
resnum
( 0 );
142
TR<<
"resnum: "
<<
resnum
()<<
" lower "
<<
lower
()<<
" upper: "
<<
upper
()<<std::endl;
143
}
144
145
protocols::filters::FilterOP
146
Torsion::fresh_instance
()
const
{
147
return
new
Torsion
();
148
}
149
150
Torsion::~Torsion
(){}
151
152
protocols::filters::FilterOP
153
Torsion::clone
()
const
{
154
return
new
Torsion
( *
this
);
155
}
156
157
protocols::filters::FilterOP
158
TorsionCreator::create_filter
()
const
{
return
new
Torsion
; }
159
160
std::string
161
TorsionCreator::keyname
()
const
{
return
"Torsion"
; }
162
163
core::pack::task::TaskFactoryOP
164
Torsion::task_factory
()
const
{
return
task_factory_
; }
165
166
void
167
Torsion::task_factory
(
core::pack::task::TaskFactoryOP
tf ){
168
task_factory_
= tf;
169
}
170
171
}
// filters
172
}
// protein_interface_design
173
}
// protocols
Generated on Sat Jun 1 2013 12:04:06 for Rosetta 3.5 by
1.8.4