Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ChiWellRmsdEvaluator.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
23 
24 // Project Headers
26 #include <core/pose/Pose.hh>
27 #include <protocols/jd2/util.hh>
32 
34 #include <basic/MetricValue.hh>
35 // ObjexxFCL Headers
36 
37 // Utility headers
38 #include <basic/Tracer.hh>
39 #include <core/scoring/rms_util.hh>
40 
41 // option key includes
42 
43 // AUTO-REMOVED #include <basic/options/keys/in.OptionKeys.gen.hh>
44 
46 #include <utility/exit.hh>
47 #include <utility/vector1.hh>
48 
49 //Auto Headers
50 static basic::Tracer tr("protocols.evaluation.RMSD");
51 namespace protocols {
52 namespace simple_filters {
53 using namespace core;
54 
55 
57  : evaluation::SingleValuePoseEvaluator< Real >( tag ),
58  rmsd_pose_( pose ),
59  nchi_max_( nchi_max ),
60  sasa_threshold_( sasa_threshold ),
61  tag_( tag )
62 {
63  copy( selection.begin(), selection.end(), std::back_inserter( selection_ ) );
64 }
65 
67  : evaluation::SingleValuePoseEvaluator< Real >( tag ),
68  rmsd_pose_( pose ),
69  nchi_max_( nchi_max ),
70  sasa_threshold_( sasa_threshold ),
71  tag_( tag )
72 {
73  if ( pose ) evaluation::find_existing_residues( pose, tag, selection_ );
74 }
75 
76 Real
78  core::pose::PoseCOP target_pose = rmsd_pose_;
79  if ( !target_pose ) {
80  runtime_assert( jd2::jd2_used() );
82  }
83  if ( !target_pose ) utility_exit_with_message(" no target pose for rmsd simple_filters "+tag_ );
84 
85  core::Size correct( 0 );
86  core::Size total( 0 );
87 
89  basic::MetricValue<utility::vector1< Real > > residue_sasa;
90 
91  sasa_calc.get( "residue_sasa", residue_sasa, pose );
92 
93 
94  for ( core::scoring::ResidueSelection::const_iterator it = selection_.begin(); it != selection_.end(); ++it ) {
95  Size seqpos( *it );
96  if ( residue_sasa.value()[ seqpos ] > sasa_threshold_ ) {
97  tr.Debug << "residue " << seqpos << " is solvent exposed (SASA: " << residue_sasa.value()[ seqpos ] << " ) ignored... " << std::endl;
98  continue;
99  }
100  conformation::Residue const & rsd( pose.residue(seqpos) );
101  conformation::Residue const & target_rsd( target_pose->residue(seqpos) );
102  if ( rsd.type().name() != target_rsd.type().name() ) continue; // residue types must match
103 
106 
107  pack::dunbrack::RotVector target_rot;
108  pack::dunbrack::rotamer_from_chi( target_rsd, target_rot );
109 
110  Size nchi = rsd.chi().size();
111  bool good( true );
112  for ( Size i=1; i<= std::min( nchi, nchi_max_ ) && good; ++i ) {
113  tr.Debug << "Chi " << i << " " << rot[ i ] << " target: " << target_rot[ i ] << std::endl;
114  good = rot[ i ] == target_rot[ i ];
115  }
116  if ( good ) correct+=1;
117  total += 1;
118  tr.Debug << "pos: " << seqpos << " correct: " << correct << " total: " << total << std::endl;
119  }
120  return 1.0/total*correct;
121 }
122 
123 }
124 }