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_moves
SequenceProfileMover.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_moves/SequenceProfileMover.cc
11
/// @brief moverization of code that was embedded in the parser
12
/// @author Brian Weitzner brian.weitzner@gmail.com, Steven Lewis smlewi@gmail.com
13
/// @date Rebased to next year.
14
15
// Unit Headers
16
#include <
protocols/simple_moves/SequenceProfileMover.hh
>
17
#include <
protocols/simple_moves/SequenceProfileMoverCreator.hh
>
18
19
20
// Project headers
21
#include <
core/types.hh
>
22
#include <
core/pose/Pose.hh
>
23
24
#include <
protocols/filters/Filter.hh
>
25
#include <
protocols/filters/FilterFactory.hh
>
26
#include <
protocols/filters/BasicFilters.hh
>
27
#include <utility/tag/Tag.hh>
28
#include <
core/scoring/ScoreType.hh
>
29
#include <
core/scoring/ScoreFunction.hh
>
30
#include <
core/scoring/ScoreFunctionFactory.hh
>
31
32
#include <
protocols/jd2/JobDistributor.hh
>
33
#include <
protocols/jd2/Job.hh
>
34
#include <
core/scoring/constraints/SequenceProfileConstraint.hh
>
35
#include <
core/sequence/SequenceProfile.hh
>
36
#include <utility/file/FileName.hh>
37
38
#include <
protocols/moves/DataMap.hh
>
39
40
#include <basic/Tracer.hh>
41
#include <string>
42
43
static
basic::Tracer
TR
(
"protocols.simple_moves.SequenceProfileMover"
);
44
45
namespace
protocols {
46
namespace
simple_moves {
47
48
SequenceProfileMover::SequenceProfileMover
() :
49
protocols::moves::
Mover
(
"SequenceProfileMover"
)
50
{
51
}
52
53
SequenceProfileMover::~SequenceProfileMover
() {}
54
55
void
56
SequenceProfileMover::apply
(
core::pose::Pose
& pose )
57
{
58
using namespace
core::sequence;
59
60
SequenceProfileOP
profile =
new
SequenceProfile
;
61
profile->
read_from_checkpoint
(
cst_file_name_
);
62
for
(
core::Size
seqpos( 1 ),
end
( pose.
total_residue
() ); seqpos <=
end
; ++seqpos )
63
pose.
add_constraint
(
new
core::scoring::constraints::SequenceProfileConstraint
( pose, seqpos, profile ) );
64
65
TR
<<
"Added sequence profile constraints specified in file "
<<
cst_file_name_
<<
"."
<< std::endl;
66
}
67
68
std::string
69
SequenceProfileMover::get_name
()
const
{
70
return
SequenceProfileMoverCreator::mover_name
();
71
}
72
73
protocols::moves::MoverOP
74
SequenceProfileMover::clone
()
const
{
75
return
protocols::moves::MoverOP
(
new
SequenceProfileMover
( *
this
) );
76
}
77
78
protocols::moves::MoverOP
79
SequenceProfileMover::fresh_instance
()
const
{
80
return
protocols::moves::MoverOP
(
new
SequenceProfileMover
);
81
}
82
83
void
84
SequenceProfileMover::parse_my_tag
(
TagPtr
const
tag,
moves::DataMap
& data,
protocols::filters::Filters_map
const
&,
moves::Movers_map
const
&,
core::pose::Pose
const
& )
85
{
86
using namespace
core::scoring;
87
88
//handle cst_file_name
89
protocols::jd2::JobOP
job(
protocols::jd2::JobDistributor::get_instance
()->
current_job
() );
90
std::string
const
input_file_name( job->input_tag() );
91
core::Size
const
wheres_period( input_file_name.find_first_of(
"."
) );
92
std::string
const
dflt_cst_file_name( input_file_name.substr(0, wheres_period ) +
".cst"
);
93
set_cst_file_name
( tag->getOption<
std::string
>(
"file_name"
, dflt_cst_file_name ) );
94
95
//handle profile_wgt
96
set_profile_wgt
( tag->getOption<
core::Real
>(
"weight"
, 0.25 ) );
97
98
if
(
profile_wgt_
) {
99
using namespace
utility::pointer;
100
for
( std::map< std::string, ReferenceCountOP >::const_iterator it=data[
"scorefxns"
].begin(); it!=data[
"scorefxns"
].
end
(); ++it ){
101
ScoreFunctionOP
scorefxn( *data.
get
<
ScoreFunction
* >(
"scorefxns"
, it->first ) );
102
scorefxn->set_weight(
res_type_constraint
,
profile_wgt_
);
103
TR
<<
"setting "
<< it->first <<
" res_type_constraint to "
<<
profile_wgt_
<<
"\n"
;
104
}
105
}
106
TR
<<
"Changed all scorefxns to have profile weights of "
<<
profile_wgt_
<< std::endl;
107
}
//end parse_my_tag
108
109
std::string
110
SequenceProfileMoverCreator::keyname
()
const
111
{
112
return
SequenceProfileMoverCreator::mover_name
();
113
}
114
115
protocols::moves::MoverOP
116
SequenceProfileMoverCreator::create_mover
()
const
{
117
return
new
SequenceProfileMover
;
118
}
119
120
std::string
121
SequenceProfileMoverCreator::mover_name
()
122
{
123
return
"profile"
;
124
}
125
126
127
}
// simple_moves
128
}
// protocols
129
Generated on Sat Jun 1 2013 12:16:50 for Rosetta 3.5 by
1.8.4