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
nonlocal
SheetTranslate.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/moves/SheetTranslate.cc
11
/// @author Christopher Miles (cmiles@uw.edu)
12
13
// Unit headers
14
#include <
protocols/nonlocal/SheetTranslate.hh
>
15
16
// C/C++ headers
17
#include <iostream>
18
#include <string>
19
20
// Utility header
21
#include <basic/Tracer.hh>
22
#include <numeric/xyzVector.hh>
23
24
// Project headers
25
#include <
core/conformation/Conformation.hh
>
26
#include <
core/id/NamedAtomID.hh
>
27
#include <
core/kinematics/FoldTree.hh
>
28
#include <
core/kinematics/Jump.hh
>
29
#include <
core/kinematics/Stub.hh
>
30
#include <
core/pose/Pose.hh
>
31
#include <
protocols/loops/Loop.hh
>
32
#include <
protocols/loops/Loops.hh
>
33
#include <
protocols/nonlocal/StarTreeBuilder.hh
>
34
35
// Package headers
36
#include <
protocols/moves/Mover.hh
>
37
38
//Auto Headers
39
#include <utility/vector1.hh>
40
namespace
protocols {
41
namespace
nonlocal {
42
43
static
basic::Tracer
TR
(
"protocols.nonlocal.SheetTranslate"
);
44
45
SheetTranslate::SheetTranslate
() {
46
initialize
(
protocols::loops::Loop
(), 0.0);
47
}
48
49
SheetTranslate::SheetTranslate
(
const
protocols::loops::Loop
&
sheet
,
double
distance_ang) {
50
initialize
(sheet, distance_ang);
51
}
52
53
void
SheetTranslate::initialize
(
const
protocols::loops::Loop
&
sheet
,
double
distance
) {
54
sheet_
=
sheet
;
55
distance_
=
distance
;
56
}
57
58
void
SheetTranslate::apply
(
core::pose::Pose
& pose) {
59
using
core::id::NamedAtomID
;
60
using
core::kinematics::FoldTree
;
61
using
core::kinematics::Jump
;
62
using
core::kinematics::Stub
;
63
using
numeric::xyzVector
;
64
using
protocols::loops::Loops
;
65
using
protocols::nonlocal::StarTreeBuilder
;
66
67
if
(!
is_valid
()) {
68
TR
.Warning <<
"SheetTranslate::apply() invoked with invalid or incomplete information."
<< std::endl;
69
TR
.Warning <<
" sheet_ => "
<<
get_sheet
() << std::endl;
70
TR
.Warning <<
" distance_ => "
<<
get_distance
() << std::endl;
71
return
;
72
}
73
74
// Retain a copy of the input fold tree, since we're responsible for restoring it
75
FoldTree input_tree = pose.
fold_tree
();
76
77
// Configure new kinematics
78
Loops
chunks;
79
decompose_structure
(pose.
total_residue
(), &chunks);
80
81
StarTreeBuilder
builder;
82
builder.
set_up
(chunks, &pose);
83
TR
.Debug << pose.
fold_tree
() << std::endl;
84
85
// Define the axis of translation as the vector between the first and last residues of the sheet
86
xyzVector<double>
axis = pose.
xyz
(NamedAtomID(
"CA"
,
sheet_
.
stop
())) - pose.
xyz
(NamedAtomID(
"CA"
,
sheet_
.
start
()));
87
88
// Translation along the axis
89
unsigned
jump_num =
jump_containing_sheet
(chunks);
90
Jump jump = pose.
jump
(jump_num);
91
jump.
translation_along_axis
(pose.
conformation
().
upstream_jump_stub
(jump_num), axis,
get_distance
());
92
pose.
set_jump
(jump_num, jump);
93
94
// Restore input fold tree
95
builder.tear_down(&pose);
96
pose.
fold_tree
(input_tree);
97
}
98
99
unsigned
SheetTranslate::jump_containing_sheet
(
const
protocols::loops::Loops
& chunks)
const
{
100
for
(
unsigned
i = 1; i <= chunks.
num_loop
(); ++i) {
101
if
(chunks[i].
start
() ==
sheet_
.
start
())
102
return
i;
103
}
104
return
0;
// invalid
105
}
106
107
void
SheetTranslate::decompose_structure
(
unsigned
num_residues,
protocols::loops::Loops
* chunks)
const
{
108
using
protocols::loops::Loop
;
109
assert(chunks);
110
assert(num_residues > 0);
111
112
const
unsigned
start
=
get_sheet
().
start
();
113
const
unsigned
stop
=
get_sheet
().
stop
();
114
115
// Residues 1 to (sheet - 1)
116
if
(start > 1) {
117
chunks->
add_loop
(
Loop
(1, start - 1));
118
}
119
120
// Sheet
121
chunks->
add_loop
(
Loop
(start, stop));
122
123
// Residues (sheet + 1) to end
124
if
(stop < num_residues) {
125
chunks->
add_loop
(
Loop
(stop + 1, num_residues));
126
}
127
128
chunks->
sequential_order
();
129
}
130
131
bool
SheetTranslate::is_valid
()
const
{
132
return
sheet_
.
start
() > 0 &&
sheet_
.
start
() <
sheet_
.
stop
();
133
}
134
135
const
protocols::loops::Loop
&
SheetTranslate::get_sheet
()
const
{
136
return
sheet_
;
137
}
138
139
void
SheetTranslate::set_sheet
(
const
protocols::loops::Loop
&
sheet
) {
140
sheet_
=
sheet
;
141
}
142
143
double
SheetTranslate::get_distance
()
const
{
144
return
distance_
;
145
}
146
147
void
SheetTranslate::set_distance
(
double
distance_ang) {
148
distance_
= distance_ang;
149
}
150
151
std::string
SheetTranslate::get_name
()
const
{
152
return
"SheetTranslate"
;
153
}
154
155
moves::MoverOP
SheetTranslate::fresh_instance
()
const
{
156
return
new
SheetTranslate
();
157
}
158
159
moves::MoverOP
SheetTranslate::clone
()
const
{
160
return
new
SheetTranslate
(*
this
);
161
}
162
163
}
// namespace moves
164
}
// namespace protocols
Generated on Sat Jun 1 2013 12:01:44 for Rosetta 3.5 by
1.8.4