26 #include <utility/tag/Tag.hh>
29 #include <basic/Tracer.hh>
32 #include <boost/foreach.hpp>
33 #define foreach BOOST_FOREACH
34 #include <utility/string_util.hh>
42 #include <basic/options/option.hh>
43 #include <basic/options/keys/in.OptionKeys.gen.hh>
45 #include <utility/vector0.hh>
46 #include <utility/vector1.hh>
50 namespace simple_filters {
52 static basic::Tracer
TR(
"protocols.simple_filters.RelativePoseFilter" );
59 dump_pose_fname_(
"" ),
62 packing_shell_( 8.0 ),
65 baseline_val_( -9999 ),
67 copy_stretch_( false ),
68 symmetry_definition_(
""),
133 using namespace core::chemical;
134 using namespace protocols::toolbox::task_operations;
146 rbtm.
apply( *copy_pose );
150 copy_pose->conformation().detect_disulfides();
155 std::vector< core::Size > diffs;
157 TR<<
"differences at positions: ";
158 for( std::map< core::Size, core::Size >::const_iterator aln=
alignment_.begin(); aln!=
alignment_.end(); ++aln ){
159 char const res1_name(
pose()->conformation().residue( aln->first ).name1());
161 if( res1_name != res2_name ) {
162 diffs.push_back( aln->first );
163 TR<<res1_name<<aln->first<<res2_name<<
", ";
170 dao->include_residue( d );
171 using namespace core::pack::task;
172 using namespace core::pack::task::operation;
179 if( !pack->nonconst_residue_task( i ).being_designed() ){
180 pack->nonconst_residue_task( i ).prevent_repacking();
181 TR<<
"prevent repacking: "<<i<<std::endl;
183 else if( std::find( diffs.begin(), diffs.end(), i ) == diffs.end() ){
184 pack->nonconst_residue_task( i ).restrict_to_repacking();
185 TR<<
"restrict to repacking: "<<i<<std::endl;
195 allowed_aas[
pose()->residue( i ).aa() ] =
true;
196 pack->nonconst_residue_task( i ).restrict_absent_canonical_aas( allowed_aas );
197 TR<<
"design: "<<i<<std::endl;
200 using namespace protocols::simple_moves;
207 prm->apply( *copy_pose );
210 rtmin->apply( *copy_pose );
211 TR<<
"finished rtmin"<<std::endl;
226 dump.
apply( *threaded_pose );
228 TR<<
"filter "<<
filter_name()<<
" reports value pos: "<<filter_val<<
", "<<std::endl;
234 TR<<
"filter "<<
filter_name()<<
" val: "<<filter_val<<std::endl;
235 return( filter_val );
248 out<<
"Dummy: All reports are dummy for this filter. Only report_sm is defined"<<std::endl;
266 using namespace protocols::rosetta_scripts;
268 TR <<
"RelativePoseFilter"<<std::endl;
270 bool use_native ( tag->getOption<
bool >(
"use_native_pdb",
false ));
273 if ( tag->hasOption(
"pdb_name" ) ) {
274 pose_fname = tag->getOption<
std::string >(
"pdb_name" );
277 if( tag->hasOption(
"symmetry_definition" ) ){
289 baseline( tag->getOption<
bool >(
"baseline", 1 ));
293 TR<<
"The baseline value for the pose read from disk is: "<<
baseline_val()<<std::endl;
296 TR<<
"Baseline turned off. Is that intended?"<<std::endl;
298 if( tag->hasOption(
"alignment" ) ){
300 foreach(
std::string const residue_pair, residue_pairs ){
302 runtime_assert( residues.size() == 2 );
303 char const residues1_cstr( residues[ 1 ].c_str()[ 0 ] ), residues2_cstr( residues[ 2 ].c_str()[ 0 ] );
304 if( residues[ 1 ].length() == 1 &&
305 ( residues1_cstr <= 'Z' && residues2_cstr >=
'A' ) &&
306 ( residues[ 2 ].length() == 1 &&
307 ( residues2_cstr <= 'Z' && residues2_cstr >=
'A' ) ) ){
310 for(; pose_res <=
pose()->total_residue(); ++pose_res )
311 if( pdbinfo1->chain( pose_res ) == residues1_cstr )
break;
313 if( pdbinfo2->chain( p_res ) == residues2_cstr )
break;
319 if( pdbinfo1->chain( pose_res ) != residues1_cstr ||
320 pdbinfo2->chain( p_res ) != residues2_cstr )
335 rtmin( tag->getOption<
bool >(
"rtmin", 0 ) );
338 unbound( tag->getOption<
bool >(
"unbound",
false ) );
339 copy_stretch( tag->getOption<
bool >(
"copy_stretch",
false ) );