Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DownstreamRMSEvaluator.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/output/DownstreamRMSEvaluator.cc
12 /// @brief
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
25 #include <core/pose/Pose.hh>
26 
27 #include <core/id/AtomID.hh>
28 #include <protocols/match/Hit.hh>
29 #include <utility/vector1.hh>
30 
31 
32 namespace protocols {
33 namespace match {
34 namespace output {
35 
36 
38 
40 
41 void
43 {
44  dspose_ = dspose;
45 
46  /// TEMP!
47  /// Compare all heavy atoms on all residues
48  Size count_atoms = 0;
49  for ( Size ii = 1; ii <= dspose_->total_residue(); ++ii ) {
50  count_atoms += dspose_->residue(ii).nheavyatoms();
51  }
52 
53  atoms_to_compare_.resize( count_atoms );
54  count_atoms = 1;
55  for ( Size ii = 1; ii <= dspose_->total_residue(); ++ii ) {
56  for ( Size jj = 1; jj <= dspose_->residue(ii).nheavyatoms(); ++jj ) {
57  atoms_to_compare_[ count_atoms ] = core::id::AtomID( jj, ii );
58  ++count_atoms;
59  }
60  }
61 }
62 
63 void
65 {
66  n_geometric_constraints_ = setting;
68 }
69 
70 /// @details upstream-only downstream algorithms are handled by having null-pointing
71 /// downstream builder pointers. The score() method checks that the ds_builder is not
72 /// null;
73 void
75  Size which_geom_cst,
77 )
78 {
79  ds_builders_[ which_geom_cst ] = ds_builder;
80 
81 }
82 
85 {
87  for ( Size ii = 1; ii <= n_geometric_constraints_; ++ii ) {
88  ds_coords[ ii ].resize( atoms_to_compare_.size() );
89  }
90 
91  for ( Size ii = 1; ii <= n_geometric_constraints_; ++ii ) {
92  if ( ds_builders_[ ii ] ) {
93  ds_builders_[ ii ]->coordinates_from_hit( m[ ii ], atoms_to_compare_, ds_coords[ ii ] );
94  }
95  }
96 
97  Real rms_sum = 0.0;
98  for ( Size ii = 1; ii <= n_geometric_constraints_; ++ii ) {
99  if ( ! ds_builders_[ ii ] ) continue;
100  for ( Size jj = ii+1; jj <= n_geometric_constraints_; ++jj ) {
101  if ( ! ds_builders_[ jj ] ) continue;
102 
103  Real iijj_rms = 0.0;
104  Size num_atoms_to_compare=atoms_to_compare_.size();
105  for ( Size kk = 1; kk <= num_atoms_to_compare; ++kk ) {
106  iijj_rms += ds_coords[ ii ][ kk ].distance_squared( ds_coords[ jj ][ kk ] );
107  }
108  rms_sum += std::sqrt( iijj_rms/num_atoms_to_compare );
109  }
110  }
111  return rms_sum;
112 }
113 
116 {
117  utility_exit_with_message( "DownstreamRMSEvaluator is not able to evaluate a single-downstream-position match" );
118  return 0.0;
119 }
120 
121 }
122 }
123 }
124