33 #include <ObjexxFCL/string.functions.hh>
36 #include <utility/pointer/ReferenceCount.hh>
37 #include <utility/vector1.hh>
38 #include <utility/string_util.hh>
39 #include <utility/file/FileName.hh>
41 #include <basic/options/option.hh>
42 #include <basic/Tracer.hh>
49 #include <basic/options/option_macros.hh>
50 #include <basic/options/keys/evaluation.OptionKeys.gen.hh>
51 #include <basic/options/keys/in.OptionKeys.gen.hh>
53 #include <utility/vector0.hh>
61 static basic::Tracer
tr(
"protocols.evaluation.RmsdEvaluatorCreator");
64 namespace simple_filters {
69 using namespace basic::options;
73 OPT( evaluation::rmsd );
74 OPT( evaluation::gdtmm );
75 OPT( in::file::native );
81 using namespace basic::options;
82 using namespace basic::options::OptionKeys;
84 if ( option[ OptionKeys::evaluation::rmsd ].user() ) {
87 if ( option[ in::file::native ].user() ) {
93 RmsdVector
const& rmsd( option[ OptionKeys::evaluation::rmsd ]() );
103 for ( RmsdVector::const_iterator it=rmsd.begin(); it!=rmsd.end(); ++it ) {
109 bool invert(
false );
110 bool loop_rms(
false );
111 bool superimpose_for_looprms(
false );
114 while ( it != rmsd.end() && (*it).find(
'=')!=std::string::npos ) {
115 Size pos( it->find(
'=') );
118 if ( key==
"heavy" && value==
"yes" ) {
119 tr.Info <<
"switching to full-atom RMSD " << std::endl;
121 }
else if ( key ==
"loop") {
123 }
else if ( key ==
"superimpose") {
124 superimpose_for_looprms = (value==
"yes");
125 }
else if ( key ==
"core" ) {
126 std::ifstream is( value.c_str() );
129 utility_exit_with_message(
"[ERROR] Error opening RBSeg file '" + value +
"'" );
136 utility_exit_with_message(
"key not recognized: "+key+
" possible keys: { heavy }" );
138 tr.Info <<
"detected option: " << key <<
" : " << value << std::endl;
141 if ( it != rmsd.end() ) {
144 utility_exit_with_message(
145 "need to specify tripletts <target> [key/value pairs] <column> <selection/FULL> with option -evaluation:rmsd last read: "+fname );
148 if ( it != rmsd.end() ) {
149 selection_file = *it;
151 utility_exit_with_message(
152 "need to specify tripletts <target> <column> <selection/FULL> with option -evaluation:rmsd last read: "+column );
154 if ( fname ==
"NATIVE" ) target_pose = native_pose;
155 else if ( fname !=
"IRMS" ) {
160 if ( selection_file ==
"EXCLUDE" ) {
163 if ( it != rmsd.end() ) {
164 selection_file = *it;
166 utility_exit_with_message(
167 "need to specify a <selection/FULL> after 'EXCLUDE' with option -evaluation:rmsd last read: "+column );
172 if ( selection_file ==
"INLINE" ) {
175 if ( it != rmsd.end() ) {
178 utility_exit_with_message(
179 "need to find END_INLINE after INLINE in option -evaluation:rmsd last read: "+column );
181 while( next_tag !=
"END_INLINE" ) {
182 selection.push_back( utility::string2int( next_tag ) );
184 if ( it != rmsd.end() ) {
187 utility_exit_with_message(
188 "need to find END_INLINE after INLINE in option -evaluation:rmsd last read: "+column );
191 }
else if ( selection_file !=
"FULL" ) {
192 std::ifstream is( selection_file.c_str() );
195 utility_exit_with_message(
"[ERROR] Error opening RBSeg file '" + selection_file +
"'" );
212 for (
Size i = 1; i<=target_pose->total_residue(); ++i) {
214 for (
Size j = 1; j<=selection.size() && !found; ++j ) {
215 if ( selection[ j ]==i ) {
219 if ( !found) inverted_selection.push_back( i );
221 selection = inverted_selection;
223 if ( selection_file !=
"FULL" ) {
229 if ( option[ OptionKeys::evaluation::gdtmm ]() ) {
234 if ( option[ OptionKeys::evaluation::gdtmm ]() ) {
244 return "RmsdEvaluatorCreator";