Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InverseRotamersRCG.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/forge/constraints/InverseRotamersRCG.cc
11 ///
12 /// @brief
13 /// @author Florian Richter, floric@u.washington.edu, april 2010
14 /// @modified Tom Linsky, tlinsky@uw.edu
15 
16 //unit headers
19 
20 //protocol headers
22 
23 //project headers
25 #include <core/pose/Pose.hh>
30 
31 //utility headers
32 #include <basic/Tracer.hh>
33 #include <utility/tag/Tag.hh>
34 #include <utility/vector1.hh>
35 
36 
37 static basic::Tracer tr( "protocols.forge.constraints.InverseRotamersRCG" );
38 
39 namespace protocols{
40 namespace forge{
41 namespace constraints{
42 
45 {
46  return new InverseRotamersRCG();
47 }
48 
51 {
53 }
54 
57 {
58  return "InverseRotamersCstGenerator";
59 }
60 
62  : RemodelConstraintGenerator(),
63  constraint_func_( NULL ),
64  func_sd_( 0.4 )
65 {}
66 
68  : RemodelConstraintGenerator( rval ),
69  constraint_func_( rval.constraint_func_ ),
70  func_sd_( rval.func_sd_ )
71 {}
72 
74  core::Size const lstart,
75  core::Size const lstop,
76  std::list< core::conformation::ResidueCOP > const & inverse_rotamers )
77  : RemodelConstraintGenerator(),
78  constraint_func_(NULL),
79  func_sd_(0.4)
80 {
81  init( lstart, lstop, inverse_rotamers );
82 }
83 
85 
86 void
89  protocols::filters::Filters_map const & filters,
90  protocols::moves::Movers_map const & movers,
91  core::pose::Pose const & pose )
92 {
93  RemodelConstraintGenerator::parse_my_tag( tag, data, filters, movers, pose );
94  //nothing here right now
95 }
96 
99 {
101 }
102 
103 
106 {
107  return new InverseRotamersRCG();
108 }
109 
112 {
113  return new InverseRotamersRCG( *this );
114 }
115 
116 void
118  core::pose::Pose const & pose )
119 {
120  //tr << "Generating remodel constraints" << std::endl;
121  //using namespace core::scoring::constraints;
122  //safeguard against bad user input
123  if( inverse_rotamers_.size() == 0 ){
124  std::cerr << "WARNING: InverseRotamersRCG is asked to produce constraints but was not given any inverse rotamers. Something's probably wrong somewhere." << std::endl;
125  return;
126  }
127 
128  //if no constraint func has been set, we'll create a default one
129  if( !constraint_func_ ){
131  }
133  for( core::Size i(1); i <= intervals_.size(); ++i ){
134  //eventually remap intervals according to vlb seqmap
135  if( this->seqmap() ){
136  intervals_[i].left = (*(this->seqmap() ))[ intervals_[i].left ];
137  intervals_[i].right = (*(this->seqmap() ))[ intervals_[i].right ];
138  }
139  for( core::Size remres( intervals_[i].left ); remres <= intervals_[i].right; ++remres ){
140  seqpos.push_back( remres );
141  }
142  }
143  //tr << "adding the constraint to RCG" << std::endl;
145  //tr << "clearing inverse rotamers" << std::endl;
146 
147  //we can probably delete the inverse rotamers now, to save some memory
148  this->clear_inverse_rotamers();
149  //tr << "done generating remodel constraints!" << std::endl;
150 }
151 
152 void
154  core::scoring::constraints::FuncOP constraint_func ){
155  constraint_func_ = constraint_func;
156 }
157 
158 void
160 {
161  inverse_rotamers_.clear();
162 }
163 
164 void
166  core::Size const lstop,
167  std::list< core::conformation::ResidueCOP > const & inverse_rotamers )
168 {
169  intervals_.clear();
170  inverse_rotamers_.clear();
171  intervals_.push_back( forge::build::Interval( lstart, lstop ) );
172  for( std::list< core::conformation::ResidueCOP >::const_iterator rot_it( inverse_rotamers.begin() ), rot_end( inverse_rotamers.end() );
173  rot_it != rot_end; ++rot_it ){
174  inverse_rotamers_.push_back( *rot_it );
175  }
176 }
177 
178 
179 } //namespace remodel
180 } //namespace forge
181 } //namespace protocols