Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RDC_Evaluator.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 PoseEvaluator
11 /// @brief PoseEvaluator
12 /// @detailed
13 ///
14 ///
15 /// @author Oliver Lange
16 
17 
18 
19 // Unit Headers
21 
22 // Package Headers
25 
26 
27 // Project Headers
29 #include <core/pose/Pose.hh>
30 
31 // AUTO-REMOVED #include <basic/options/util.hh>
32 // AUTO-REMOVED #include <basic/options/after_opts.hh>
33 // ObjexxFCL Headers
34 
35 // Utility headers
36 #include <basic/Tracer.hh>
37 // AUTO-REMOVED #include <core/scoring/rms_util.hh>
38 
39 // option key includes
40 
41 // AUTO-REMOVED #include <basic/options/keys/in.OptionKeys.gen.hh>
42 
44 #include <utility/vector1.hh>
45 
46 static basic::Tracer tr("protocols.evalution.RMSD");
47 
48 namespace protocols {
49 namespace simple_filters {
50 using namespace core;
51 
53  evaluation::SingleValuePoseEvaluator< Real >( tag )
54 {}
55 
56 //RDC_Evaluator::RDC_Evaluator( utility::vector1< std::string > const& rdc_files, std::string tag) :
57 // evaluation::SingleValuePoseEvaluator< Real >( tag ),
58 // rdc_files_( rdc_files )
59 //{
60 // init_rdcs();
61 //}
62 
64  ///@brief evaluate pose
67  return energy_evaluator.eval_dipolar( pose, rdc_data_ ); //const
68 }
69  ///@brief evaluate pose
70 SelectRDC_Evaluator::SelectRDC_Evaluator( std::list< Size > const& selection, std::string tag, std::string file )
71  : evaluation::SingleValuePoseEvaluator< Real >( "rdc"+tag ),
72  selection_( selection ),
73  tag_ ( tag ),
74  rdc_file_( file )
75 {
76  init_rdcs();
77 }
78 
80  : evaluation::SingleValuePoseEvaluator< Real >( "rdc"+tag ),
81  tag_( tag ),
82  rdc_file_ ( file )
83 {
84  copy( selection.begin(), selection.end(), std::back_inserter( selection_ ) );
85  init_rdcs();
86 }
87 
88 
90  : evaluation::SingleValuePoseEvaluator< Real >( "rdc"+tag ),
91  tag_( tag )
92 {
94  init_rdcs();
95 }
96 
98  : evaluation::SingleValuePoseEvaluator< Real >( "rdc"+tag ),
99  tag_( tag )
100 {
102  init_rdcs();
103 }
104 
105 Real
107  return energy_evaluator.eval_dipolar( pose, *rdc_data_ ); //cons
108 }
109 
110 void
112  using namespace scoring;
113  ResidualDipolarCoupling orig_rdcs( rdc_file_ );;
114  ResidualDipolarCoupling::RDC_lines const& rdcs = orig_rdcs.get_RDC_data();
115  if ( selection_.size() ) {
117  for ( ResidualDipolarCoupling::RDC_lines::const_iterator it = rdcs.begin(); it != rdcs.end(); ++it ) {
118  core::scoring::ResidueSelection::const_iterator iter1 = find( selection_.begin(), selection_.end(), it->res1() );
119  core::scoring::ResidueSelection::const_iterator iter2 = find( selection_.begin(), selection_.end(), it->res2() );
120  if ( iter1 != selection_.end() && iter2 != selection_.end() ) {
121  filtered.push_back( *it );
122  }
123  }
124  rdc_data_ = new ResidualDipolarCoupling( filtered );
125  } else {
126  rdc_data_ = new ResidualDipolarCoupling( rdcs );
127  }
128 }
129 }
130 }