Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
18 
19 
20 // Project headers
21 #include <core/types.hh>
22 #include <core/pose/Pose.hh>
23 
27 #include <utility/tag/Tag.hh>
31 
33 #include <protocols/jd2/Job.hh>
36 #include <utility/file/FileName.hh>
37 
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 
49  protocols::moves::Mover( "SequenceProfileMover" )
50 {
51 }
52 
54 
55 void
57 {
58  using namespace core::sequence;
59 
60  SequenceProfileOP profile = new SequenceProfile;
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 
71 }
72 
75  return protocols::moves::MoverOP( new SequenceProfileMover( *this ) );
76 }
77 
81 }
82 
83 void
85 {
86  using namespace core::scoring;
87 
88  //handle cst_file_name
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 
111 {
113 }
114 
117  return new SequenceProfileMover;
118 }
119 
122 {
123  return "profile";
124 }
125 
126 
127 } // simple_moves
128 } // protocols
129