Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OriginalScaffoldBuildPoint.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 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file protocols/match/OriginalScaffoldBuildPoint.cc
12 /// @brief Class implementations for the launch point geometry on the Scaffold.
13 /// @author Alex Zanghellini (zanghell@u.washington.edu)
14 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com), porting to mini
15 
16 // Unit headers
18 
19 // Package headers
22 
23 // Project headers
26 
27 // Numeric headers
28 #include <numeric/HomogeneousTransform.hh>
29 
30 #include <utility/vector1.hh>
31 
32 
33 namespace protocols {
34 namespace match {
35 namespace upstream {
36 
37 /// @details Initialize the coordinates to bogus yet numically palpable values.
38 /// If someone should accidentally try to construct a coordinate frame from
39 /// CA pointing toward CB reading from uninitialized variables,
40 /// they wouldn't hit a divide-by-zero error that might occur if CA and C
41 /// were both at the origin.
43  parent(),
44  phi_( 0.0 ),
45  psi_( 0.0 ),
46  N_pos_( 0.0 ),
47  CA_pos_( 0.0, 0.0, 1.5 ),
48  C_pos_( 0.0, 0.75, 2.25 ),
49  O_pos_( 0.0, 1.4, 1.8 ),
50  H_pos_( 0.0, 0.0, 0.0 ),
51  HA_pos_( 0.0, 0.0, 0.0 )
52 {}
53 
55  parent( index ),
56  phi_( 0.0 ),
57  psi_( 0.0 ),
58  N_pos_( 0.0 ),
59  CA_pos_( 0.0, 0.0, 1.5 ),
60  C_pos_( 0.0, 0.75, 2.25 ),
61  O_pos_( 0.0, 1.4, 1.8 ),
62  H_pos_( 0.0, 0.0, 0.0 ),
63  HA_pos_( 0.0, 0.0, 0.0 )
64 {}
65 
67 
68 /// Setters
69 void ProteinBackboneBuildPoint::phi( Real setting ) { phi_ = setting; }
70 void ProteinBackboneBuildPoint::psi( Real setting ) { psi_ = setting; }
71 
72 void ProteinBackboneBuildPoint::N_pos( Vector const & setting ) { N_pos_ = setting; }
73 void ProteinBackboneBuildPoint::CA_pos( Vector const & setting ){ CA_pos_ = setting; }
74 void ProteinBackboneBuildPoint::C_pos( Vector const & setting ) { C_pos_ = setting; }
75 void ProteinBackboneBuildPoint::O_pos( Vector const & setting ) { O_pos_ = setting; }
76 void ProteinBackboneBuildPoint::H_pos( Vector const & setting ) { H_pos_ = setting; }
77 void ProteinBackboneBuildPoint::HA_pos( Vector const & setting ){ HA_pos_ = setting; }
78 
79 
80 
82  parent( index ),
83  original_resid_( 0 )
84 {}
85 
87 
89  core::conformation::Residue const & res
90 ) :
91  parent(),
92  original_resid_( res.seqpos() )
93 {
95 }
96 
97 
98 
100  core::conformation::Residue const & res,
101  Size index
102 ) :
103  parent( index ),
104  original_resid_( res.seqpos() )
105 {
107 }
108 
109 void
111  core::conformation::Residue const & res
112 )
113 {
114  typedef numeric::HomogeneousTransform< core::Real > HTReal;
115 
117 
118 
119  assert( res.has( "N" ));
120  assert( res.has( "CA" ));
121  assert( res.has( "C" ));
122  assert( res.has( "O" ));
123 
124  assert( res.is_protein() );
125  phi( res.mainchain_torsion( 1 ));
126  psi( res.mainchain_torsion( 2 ));
127  N_pos( res.xyz( "N" ));
128  CA_pos( res.xyz( "CA" ));
129  C_pos( res.xyz( "C" ));
130  O_pos( res.xyz( "O" ));
131 
132  if ( res.is_lower_terminus() || res.aa() == core::chemical::aa_pro ) {
133  /// Build H
134  core::Real res_phi = res.is_lower_terminus() ? 180 : phi();
135  HTReal Nframe( C_pos(), CA_pos(), N_pos() );
136  HTReal phi_rot;
137  phi_rot.set_zaxis_rotation_deg( res_phi );
138  HTReal twistedNframe = Nframe * phi_rot;
139  twistedNframe.walk_along_z( 1.0 ); // N--H bond length
140  H_pos( twistedNframe.point() );
141  } else {
142  H_pos( res.xyz( "H" ));
143  }
144 
145  if ( res.is_lower_terminus() ) {
147  }
148 
149  if ( res.is_upper_terminus() ) {
151  }
152 
153  if ( res.aa() == core::chemical::aa_gly ) {
154  HA_pos( res.xyz( "2HA" ));
155  } else {
156  HA_pos( res.xyz( "HA" ));
157  }
158 }
159 
161 {
162  return other.compatible( *this, false );
163 }
164 
165 /// @details It's ok for a single backbone build point to be used by multiple geometric constraints
166 /// at least from the perspective of the build point. If two different side chain conformations
167 /// are needed for a single build point, then clearly that's impossible; however, if one of the
168 /// geometric constraints requires a particular sidechain conformation, and the other is using
169 /// the backbone of the original build point, then we're fine. Therefore, this method always
170 /// returns true.
172 {
173  return true;
174 }
175 
178 {
179  return original_resid_;
180 }
181 
182 void
184  Size seqpos_to_insert_at,
185  Hit const & hit,
186  UpstreamBuilderCOP builder,
187  core::pose::Pose & pose
188 ) const
189 {
190  output::PoseInserter inserter( pose, seqpos_to_insert_at );
191  builder->recover_hit( hit, *this, inserter );
192 }
193 
194 }
195 }
196 }
197