22 #include <utility/tag/Tag.hh>
31 #include <basic/options/option.hh>
32 #include <basic/options/keys/in.OptionKeys.gen.hh>
38 #include <ObjexxFCL/FArray1D.hh>
43 #include <utility/vector0.hh>
44 #include <utility/vector1.hh>
45 #include <basic/Tracer.hh>
48 namespace protein_interface_design {
52 protocols::filters::
Filter(
"Rmsd" ),
56 reference_pose_( NULL ),
57 selection_from_segment_cache_(false),
58 superimpose_on_all_( false )
64 std::list<core::Size>
const selection,
68 ) : protocols::filters::
Filter(
"Rmsd" ),
69 selection_(selection),
70 superimpose_(superimpose),
71 threshold_(threshold),
72 reference_pose_(reference_pose),
73 selection_from_segment_cache_(false)
84 static basic::Tracer
TR(
"protocols.protein_interface_design.filters.RmsdFilter" );
89 using namespace core::scoring;
95 runtime_assert_msg( copy_pose.total_residue() == native.total_residue(),
"the reference pose must be the same size as the working pose" );
99 FArray1D_bool superimpose_array( pose.
total_residue(), false );
107 for( std::list<core::Size>::const_iterator it =
selection_.begin(); it!=
selection_.end(); ++it ) {
108 selection_array[*it-1] =
true;
109 superimpose_array[*it-1] =
true;
131 TR <<
"RMSD over selected residues: " << rmsd ;
134 TR<<
" passing."<<std::endl;
137 else TR<<
" failing." << std::endl;
144 out<<
"RMSD: " << rmsd<<
'\n';
159 if( tag->hasOption(
"reference_name") ){
164 if ( basic::options::option[ basic::options::OptionKeys::in::file::native ].user() )
168 symmetry_ = tag->getOption<
bool>(
"symmetry", 0 );
177 for( std::string::const_iterator chain_it = chains.begin(); chain_it != chains.end(); ++chain_it ) {
178 char const chain = *chain_it;
179 TR.Debug <<
"Chain " << chain <<
" selected" << std::endl;
193 else chain_start =
reference_pose_->conformation().chain_begin( chainid );
194 for(
core::Size i = chain_start; i <= chain_end; ++i ) {
205 if( rmsd_tag->getName() ==
"residue" ) {
209 if( rmsd_tag->getName() ==
"span" ) {
212 runtime_assert( end > begin );
213 runtime_assert( begin>=1);
214 runtime_assert( end<=reference_pose_->total_residue() );
220 TR.Debug <<
"RMSD selected residues: ";
221 if(
selection_.size() == 0 )
TR.Debug <<
"ALL" << std::endl;
223 for( std::list<core::Size>::const_iterator it =
selection_.begin(); it !=
selection_.end(); ++it ) {
224 TR.Debug << *it <<
" ";
227 TR.Debug << std::endl;
229 superimpose_ = tag->getOption<
bool>(
"superimpose", 1 );
231 if( tag->hasOption(
"rms_residues_from_pose_cache") ){
233 if(
selection_.size() != 0 ) std::cerr <<
"Warning: in rmsd filter tag, both a span selection and the instruction to set the residues from the pose cache is given. Incompatible, defined span will be ignored." << std::endl;
238 TR<<
" superimpose_on_all set to true. Any spans defined will be used only to measure RMSd but the pose will be supreimposed on the reference pose through all residues ";
241 TR <<
"ALL" << std::endl;
245 for( std::list<core::Size>::const_iterator it=
selection_.begin(); it !=
selection_.end(); ++it )
TR << *it <<
" ";