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
ThreadSequenceOperation.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/ThreadSequenceOperation.cc
11
/// @brief
12
/// @author Sarelf Fleishman sarelf@uw.edu
13
14
// Unit Headers
15
#include <
protocols/toolbox/task_operations/ThreadSequenceOperation.hh
>
16
#include <
protocols/toolbox/task_operations/ThreadSequenceOperationCreator.hh
>
17
18
// Project Headers
19
#include <
core/pose/Pose.hh
>
20
21
// AUTO-REMOVED #include <core/pack/task/PackerTask.hh>
22
#include <
core/pack/task/operation/TaskOperations.hh
>
23
24
// Utility Headers
25
#include <
core/types.hh
>
26
#include <basic/Tracer.hh>
27
#include <utility/vector1.hh>
28
#include <utility/tag/Tag.hh>
29
// AUTO-REMOVED #include <core/pack/task/operation/ResLvlTaskOperations.hh>
30
31
#include <utility/vector0.hh>
32
33
34
using
basic::Error;
35
using
basic::Warning;
36
static
basic::Tracer
TR
(
"protocols.toolbox.TaskOperations.ThreadSequenceOperation"
);
37
38
namespace
protocols {
39
namespace
toolbox {
40
namespace
task_operations {
41
42
using namespace
core::pack::task::operation;
43
using namespace
std;
44
45
ThreadSequenceOperation::ThreadSequenceOperation
() :
parent
()
46
{
47
target_sequence
(
""
);
start_res
( 1 );
48
}
49
50
ThreadSequenceOperation::ThreadSequenceOperation
(
std::string
const
seq ) :
parent
()
51
{
52
target_sequence
( seq );
53
}
54
55
ThreadSequenceOperation::~ThreadSequenceOperation
() {}
56
57
core::pack::task::operation::TaskOperationOP
58
ThreadSequenceOperationCreator::create_task_operation
()
const
59
{
60
return
new
ThreadSequenceOperation
;
61
}
62
63
core::pack::task::operation::TaskOperationOP
ThreadSequenceOperation::clone
()
const
64
{
65
return
new
ThreadSequenceOperation
( *
this
);
66
}
67
68
void
69
ThreadSequenceOperation::apply
(
core::pose::Pose
const
& pose,
core::pack::task::PackerTask
& task )
const
70
{
71
using
core::pack::task::operation::RestrictAbsentCanonicalAAS
;
72
using namespace
core::chemical;
73
74
runtime_assert(
target_sequence
().length() +
start_res
() -1 <= pose.
total_residue
() );
75
core::pack::task::operation::RestrictResidueToRepacking
rtr;
76
bool
activated_rtr(
false
);
77
for
(
core::Size
resi( 1 ); resi <= pose.
total_residue
(); ++resi ){
78
if
( resi >=
start_res
() && resi <=
start_res
() +
target_sequence_
.length() - 1 ){
79
if
(
target_sequence_
[ resi -
start_res
() ] ==
'x'
)
continue
;
// allows for 'wildcard' residues that can be allowed to design to anything within the threaded sequence
80
if
(
target_sequence_
[ resi -
start_res
() ] ==
' '
){
/// only repack this residue
81
rtr.include_residue( resi );
82
activated_rtr =
true
;
83
continue
;
84
}
85
RestrictAbsentCanonicalAAS
racaas;
86
utility::vector1< bool >
keep_aas(
num_canonical_aas
,
false
);
87
keep_aas[
aa_from_oneletter_code
(
target_sequence_
[ resi-
start_res
() ] ) ] =
true
;
88
racaas.
keep_aas
( keep_aas );
89
racaas.
include_residue
( resi );
90
racaas.
apply
( pose, task );
91
}
92
else
if
( !
allow_design_around
() )
93
rtr.include_residue( resi );
94
}
95
if
( !
allow_design_around
() || activated_rtr )
96
rtr.apply( pose, task );
97
}
98
99
void
100
ThreadSequenceOperation::target_sequence
(
std::string
const
seq )
101
{
102
target_sequence_
= seq;
103
}
104
105
std::string
106
ThreadSequenceOperation::target_sequence
()
const
107
{
108
return
(
target_sequence_
);
109
}
110
111
core::Size
112
ThreadSequenceOperation::start_res
()
const
{
113
return
start_res_
;
114
}
115
116
void
117
ThreadSequenceOperation::start_res
(
core::Size
const
s ){
118
start_res_
= s;
119
}
120
121
void
122
ThreadSequenceOperation::parse_tag
(
TagPtr
tag )
123
{
124
target_sequence
( tag->getOption<
std::string
>(
"target_sequence"
) );
125
start_res
( tag->getOption<
core::Size
>(
"start_res"
, 1 ) );
126
allow_design_around
( tag->getOption<
bool
>(
"allow_design_around"
,
true
) );
127
TR
<<
"Threading with sequence: "
<<
target_sequence
()<<
" starting at residue #"
<<
start_res
()<<
" allow design around "
<<
allow_design_around
()<<std::endl;
128
}
129
130
}
//namespace protocols
131
}
//namespace toolbox
132
}
//namespace task_operations
Generated on Sat Jun 1 2013 12:24:19 for Rosetta 3.5 by
1.8.4