Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NtoC_RCG.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/NtoC_RCG.cc
11 ///
12 /// @brief
13 /// @author Nobuyasu Koga( nobuyasu@uw.edu ) , October 2009
14 /// @modified Tom Linsky (tlinsky@uw.edu), Nov 2012
15 
16 // Unit header
19 
20 // Package headers
21 #include <core/pose/Pose.hh>
22 // AUTO-REMOVED #include <core/conformation/Residue.hh>
29 
30 // Project headers
32 
33 // utility headers
34 #include <basic/Tracer.hh>
35 #include <utility/tag/Tag.hh>
36 #include <utility/vector1.hh>
37 
38 
39 static basic::Tracer TR( "protocols.forge.constraints.NtoC_RCG" );
40 
41 namespace protocols{
42 namespace forge{
43 namespace constraints{
44 
47 {
49 }
50 
53  return new NtoC_RCG();
54 }
55 
58 {
59  return "NtoCCstGenerator";
60 }
61 
62 /// @brief
64  RemodelConstraintGenerator(),
65  dist_( 11.0 ),
66  coef_( 1.0 )
67 {}
68 
70  : RemodelConstraintGenerator( rval ),
71  dist_( rval.dist_ ),
72  coef_( rval.coef_ )
73 {}
74 
75 /// @brief
76 NtoC_RCG::NtoC_RCG( Real const dist, Real const coef ):
77  RemodelConstraintGenerator(),
78  dist_( dist ),
79  coef_( coef )
80 {}
81 
82 /// @brief
84 
85 void
88  protocols::filters::Filters_map const & filters,
89  protocols::moves::Movers_map const & movers,
90  core::pose::Pose const & pose )
91 {
92  RemodelConstraintGenerator::parse_my_tag( tag, data, filters, movers, pose );
93  set_weight( tag->getOption< core::Real >( "weight", coef_ ) );
94  set_distance( tag->getOption< core::Real >( "dist", dist_ ) );
95 }
96 
99 {
101 }
102 
105 {
106  return new NtoC_RCG();
107 }
108 
111 {
112  return new NtoC_RCG( *this );
113 }
114 
115 /// @brief set weight
116 void
118 {
119  coef_ = coef;
120 }
121 
122 /// @brief set distance of constraint
123 void
125 {
126  dist_ = dist;
127 }
128 
129 
130 /// @brief
131 void
133 {
134  using namespace core::scoring::constraints;
135 
136  std::string tag( "constraint_between_N_&_C_terminal_Calpha" );
137  Real lb( 0.0 );
138  Real ub( dist_ );
139  Real sd( 1.0 );
140  ScalarWeightedFuncOP cstfunc = new ScalarWeightedFunc( coef_, new BoundFunc( lb, ub, sd, tag ) );
141 
144  TR << "first residue in NtoC generation is:" << first_residue << " and last is:" << last_residue << " out of total=" << pose.total_residue() << std::endl;
145  core::id::AtomID atom1( pose.residue_type( first_residue ).atom_index( "CA" ), first_residue );
146  core::id::AtomID atom2( pose.residue_type( last_residue ).atom_index( "CA" ), last_residue );
147  ConstraintOP const cst = new AtomPairConstraint( atom1, atom2, cstfunc );
148 
149  TR << "Constraints between N- and C- terminal: " << first_residue << "-" << last_residue << ", dist=" << dist_ << std::endl;
150 
151  this->add_constraint( cst );
152 } //generate constraints
153 
154 
155 } //namespace constraints
156 } //namespace forge
157 } //namespace protocols