Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RmsdTargetEvaluatorCreator.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/simple_filters/RmsdTargetEvaluatorCreator.hh
11 /// @brief Header for RmsdTargetEvaluatorCreator
12 /// @author Matthew O'Meara
13 
14 // Unit Headers
16 
17 // Package Headers
20 
21 // Package Headers
26 
28 
30 #include <core/pose/Pose.hh>
31 
32 
34 
35 // ObjexxFCL Headers
36 #include <ObjexxFCL/string.functions.hh>
37 
38 // Utility headers
39 #include <utility/pointer/ReferenceCount.hh>
40 #include <utility/vector1.hh>
41 
42 #include <utility/file/FileName.hh>
43 
44 #include <basic/options/option.hh>
45 #include <basic/Tracer.hh>
46 
47 //// C++ headers
48 
49 // due to template function
51 
52 
53 // option key includes
54 #include <basic/options/option_macros.hh>
55 #include <basic/options/keys/evaluation.OptionKeys.gen.hh>
56 
58 #include <utility/vector0.hh>
59 
60 //Auto Headers
61 
62 
63 #ifdef WIN32
65 #endif
66 
67 
68 static basic::Tracer tr("protocols.evalution.RmsdTargetEvaluatorCreator");
69 
70 namespace protocols {
71 namespace simple_filters {
72 
74 
76  using namespace basic::options;
77  if ( options_registered_ ) return;
78  options_registered_ = true;
79 
80  OPT( evaluation::rmsd_target );
81  OPT( evaluation::rmsd_target );
82  OPT( evaluation::rmsd_column );
83  OPT( evaluation::gdtmm );
84  OPT( evaluation::score_with_rmsd );
85  OPT( evaluation::symmetric_rmsd );
86 }
87 
89  using namespace core;
90  using namespace basic::options;
91  using namespace basic::options::OptionKeys;
92 
93 
94  if ( option[ OptionKeys::evaluation::rmsd_target ].user() ) {
95  /*
96  this creates Evaluators to get RMSD and GDTMM for as many structures as you specify in this FileVector option.
97  pls: provide also as many column-names to match your rmsd-targets.
98  ---
99  missing density in the input file will be ignored, e.g., this is your way to signal on which residues the rmsd should be computed
100  */
101  utility::vector1< std::string > const & rmsd_target ( option[ OptionKeys::evaluation::rmsd_target ]() );
102  utility::vector1< std::string > rmsd_col_name;
103 
104  if ( option[ OptionKeys::evaluation::rmsd_column ].user() ){
105  rmsd_col_name = option[ OptionKeys::evaluation::rmsd_column ]();
106  }else{
107  // make up default names: firone is just empty, leading to the columns being correctly named "rms", "gdtmm" etc.. the
108  // subsequent columns then become "_2", "_3" etc..
109  rmsd_col_name.push_back("");
110  for( core::Size j=2; j<=rmsd_target.size(); ++j){
111  rmsd_col_name.push_back("_" + ObjexxFCL::string_of(j));
112  }
113  }
114  for ( Size ct = 1; ct <= rmsd_target.size(); ct ++ ) {
115  pose::PoseOP rmsd_pose = new pose::Pose;
116  core::import_pose::pose_from_pdb( *rmsd_pose, rmsd_target[ ct ] );
117  std::string tag( ObjexxFCL::string_of( ct ) );
118  if ( rmsd_col_name.size() >= ct ) tag = rmsd_col_name[ ct ];
119  eval.add_evaluation( new simple_filters::SelectRmsdEvaluator( rmsd_pose, tag ) );
120  if ( option[ OptionKeys::evaluation::gdtmm ]() ) eval.add_evaluation( new simple_filters::SelectGdtEvaluator( rmsd_pose, tag ) );
121  if ( option[ OptionKeys::evaluation::score_with_rmsd ]() ){
123  evaluation::find_existing_residues( rmsd_pose, tag, selection );
125  std::copy( selection.begin(), selection.end(), std::back_inserter( vector ) );
126  eval.add_evaluation( new simple_filters::TruncatedScoreEvaluator( tag, vector ) );
127  }
128  if ( option[ OptionKeys::evaluation::symmetric_rmsd ]() ) {
129  eval.add_evaluation( new simple_filters::SymmetricRmsdEvaluator( rmsd_pose, tag ) );
130  }
131  }
132  }
133 
134 
135 }
136 
138  return "RmsdTargetEvaluatorCreator";
139 }
140 
141 } //namespace
142 } //namespace