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
toolbox
task_operations
RestrictToLoopsAndNeighbors.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/toolbox/task_operations/RestrictToLoopsAndNeighbors.cc
11
/// @brief
12
/// @author Brian D. Weitzner (brian.weitzner@gmail.com)
13
14
// Unit headers
15
#include <
protocols/toolbox/task_operations/RestrictToLoopsAndNeighbors.hh
>
16
#include <
protocols/toolbox/task_operations/RestrictToLoopsAndNeighborsCreator.hh
>
17
18
// Package headers
19
#include <
protocols/loops/Loops.hh
>
20
#include <
protocols/loops/Loops.tmpl.hh
>
21
#include <
protocols/loops/loops_main.hh
>
22
23
// Project headers
24
#include <
core/pack/task/operation/TaskOperations.hh
>
25
#include <
core/pose/Pose.hh
>
26
#include <
core/pose/PDBInfo.hh
>
27
#include <
core/pose/symmetry/util.hh
>
28
29
// Utility headers
30
#include <utility/exit.hh>
31
32
33
34
namespace
protocols {
35
namespace
toolbox {
36
namespace
task_operations {
37
38
using
core::pose::Pose
;
39
using
core::pack::task::PackerTask
;
40
using
core::pack::task::operation::TaskOperationOP
;
41
using
utility::tag::TagPtr
;
42
43
///////////////////////////////////////////////////////////////////////////////////////////////////////
44
////////////////////////////////////////////// BOILER PLATE CODE //////////////////////////////////////
45
///////////////////////////////////////////////////////////////////////////////////////////////////////
46
47
///@brief default constructor
48
RestrictToLoopsAndNeighbors::RestrictToLoopsAndNeighbors
() :
parent
()
49
{
50
init
();
51
}
52
53
///@brief copy constructor
54
RestrictToLoopsAndNeighbors::RestrictToLoopsAndNeighbors
(
RestrictToLoopsAndNeighbors
const
& rhs ) :
parent
(rhs)
55
{
56
init_for_equal_operator_and_copy_constructor
( *
this
, rhs );
57
}
58
59
///@brief assignment operator
60
RestrictToLoopsAndNeighbors
&
RestrictToLoopsAndNeighbors::operator=
(
RestrictToLoopsAndNeighbors
const
& rhs ){
61
//abort self-assignment
62
if
(
this
== &rhs )
return
*
this
;
63
parent::operator=( rhs );
64
init_for_equal_operator_and_copy_constructor
( *
this
, rhs );
65
return
*
this
;
66
}
67
68
//destructor
69
RestrictToLoopsAndNeighbors::~RestrictToLoopsAndNeighbors
() {}
70
71
//@brief clone operator, calls the copy constructor
72
TaskOperationOP
73
RestrictToLoopsAndNeighbors::clone
()
const
74
{
75
return
new
RestrictToLoopsAndNeighbors
( *
this
);
76
}
77
78
///////////////////////////////////////////////////////////////////////////////////////////////////////
79
/////////////////////////////////////// END OF BOILER PLATE CODE //////////////////////////////////////
80
///////////////////////////////////////////////////////////////////////////////////////////////////////
81
82
83
void
RestrictToLoopsAndNeighbors::apply
(
Pose
const
& pose,
PackerTask
& task )
const
84
{
85
86
if
( !
loops
() )
return
;
87
88
core::pack::task::operation::PreventRepacking
turn_off_packing;
89
core::pack::task::operation::RestrictResidueToRepacking
turn_off_design;
90
91
// Get an up-to-date list of the residues that can be packed
92
utility::vector1<bool>
is_packable( pose.
total_residue
(), false );
93
select_loop_residues
( pose, *
loops
(),
include_neighbors
(), is_packable,
cutoff_distance
() );
94
95
core::pose::symmetry::make_residue_mask_symmetric
( pose, is_packable );
// does nothing if pose is not symm
96
97
// If we're designing, allow design at loop positions
98
utility::vector1< bool >
is_designable( pose.
total_residue
(), false );
99
if
(
design_loop
() ) {
100
loops
()->transfer_to_residue_vector( is_designable,
true
);
101
}
102
103
for
(
Size
residue_number = 1; residue_number <= pose.
total_residue
(); ++residue_number )
104
{
105
if
( is_packable[ residue_number ] && ! is_designable[ residue_number ] )
106
{
107
turn_off_design.
include_residue
( residue_number );
108
}
109
else
if
( ! is_packable[ residue_number ] )
110
{
111
turn_off_packing.
include_residue
( residue_number );
112
}
113
}
114
115
turn_off_design.
apply
( pose, task );
116
turn_off_packing.
apply
( pose, task );
117
}
118
119
void
RestrictToLoopsAndNeighbors::init
()
120
{
121
set_design_loop
(
false
);
122
set_include_neighbors
(
true
);
123
set_cutoff_distance
( 10.0 );
124
set_loops
( NULL );
125
}
126
127
void
RestrictToLoopsAndNeighbors::init_for_equal_operator_and_copy_constructor
(
RestrictToLoopsAndNeighbors
& lhs,
RestrictToLoopsAndNeighbors
const
& rhs)
128
{
129
// copy all data members from rhs to lhs
130
lhs.
design_loop_
= rhs.
design_loop_
;
131
lhs.
include_neighbors_
= rhs.
include_neighbors_
;
132
lhs.
cutoff_distance_
= rhs.
cutoff_distance_
;
133
lhs.
loops_
= rhs.
loops_
;
134
}
135
136
bool
RestrictToLoopsAndNeighbors::design_loop
()
const
137
{
138
return
design_loop_
;
139
}
140
141
void
RestrictToLoopsAndNeighbors::set_design_loop
(
bool
design_loop )
142
{
143
design_loop_
=
design_loop
;
144
}
145
146
bool
RestrictToLoopsAndNeighbors::include_neighbors
()
const
147
{
148
return
include_neighbors_
;
149
}
150
151
void
RestrictToLoopsAndNeighbors::set_include_neighbors
(
bool
include_neighbors )
152
{
153
include_neighbors_
=
include_neighbors
;
154
}
155
156
core::Real
RestrictToLoopsAndNeighbors::cutoff_distance
()
const
157
{
158
return
cutoff_distance_
;
159
}
160
161
void
RestrictToLoopsAndNeighbors::set_cutoff_distance
(
core::Real
cutoff_distance )
162
{
163
if
( cutoff_distance >= 0.0 && cutoff_distance <= 10.0 )
164
{
165
cutoff_distance_
=
cutoff_distance
;
166
}
167
}
168
169
loops::LoopsCOP
RestrictToLoopsAndNeighbors::loops
()
const
170
{
171
return
loops_
;
172
}
173
174
void
RestrictToLoopsAndNeighbors::set_loops
(
loops::LoopsCOP
loops )
175
{
176
loops_
=
loops
;
177
}
178
179
TaskOperationOP
RestrictToLoopsAndNeighborsCreator::create_task_operation
()
const
180
{
181
return
new
RestrictToLoopsAndNeighbors
;
182
}
183
184
}
//namespace task_operations
185
}
//namespace toolbox
186
}
//namespace protocols
Generated on Sat Jun 1 2013 12:24:03 for Rosetta 3.5 by
1.8.4