14 #include <utility/tag/Tag.hh>
18 #include <basic/Tracer.hh>
24 #include <basic/options/option.hh>
25 #include <basic/options/keys/in.OptionKeys.gen.hh>
32 #include <ObjexxFCL/format.hh>
36 #include <utility/vector0.hh>
37 #include <utility/vector1.hh>
40 namespace protein_interface_design{
43 static basic::Tracer
TR(
"protocols.protein_interface_design.filters.SequenceRecoveryFilter" );
47 parent(
"SequenceRecovery" ),
48 task_factory_( NULL ),
49 reference_pose_( NULL ),
50 rate_threshold_( 0.0 ),
51 mutation_threshold_( 100 ),
152 TR<<
"The designed pose possesses "<<num_mutations<<
" compared to the reference pose. ";
154 TR<<
"Success."<<std::endl;
157 TR<<
"Failing."<<std::endl;
162 TR<<
"Sequence recovery rate evaluates to "<<recovery_rate<<
". ";
164 TR<<
"Failing."<<std::endl;
167 TR<<
"Success."<<std::endl;
173 if( pmap[
"reference"]->
size() == 1 )
213 if( total_residue_ref != total_residue )
214 utility_exit_with_message(
"Reference pose and current pose have a different number of residues" );
218 for(
core::Size resi=1; resi<=total_residue; ++resi ) {
219 if( packer_task->being_designed( resi ) ) {
222 if( packer_task->being_packed( resi ) ) {
226 if( !designable_count ) {
227 TR<<
"Warning: No designable residues identified in pose. Are you sure you have set the correct task operations?"<<std::endl;
228 if( !packable_count ) {
229 utility_exit_with_message(
"No designable or packable residues identified in pose. Are you sure you have set the correct task operations?" );
232 using namespace core::scoring;
234 rsd.
calculate( asym_ref_pose, asym_pose );
235 std::map< core::Size, std::string >
const res_names1( rsd.
res_name1() );
236 std::map< core::Size, std::string >
const res_names2( rsd.
res_name2() );
237 core::Size const mutated( res_names1.size() );
239 TR<<
"Your design mover mutated "<<mutated<<
" positions out of "<<designable_count<<
" designable positions. Sequence recovery is: "<<rate<<std::endl;
260 std::map< Size, std::string >::const_iterator it_name1 = res_names1.begin();
261 std::map< Size, std::string >::const_iterator it_name2 = res_names2.begin();
262 while( it_name1 != res_names1.end() ) {
263 std::string output_string =
"SequenceRecoveryFilter " + user_name +
": " + it_name2->second + ObjexxFCL::string_of( it_name1->first ) + it_name1->second;
264 job->add_string( output_string );
265 ++it_name1; ++it_name2;
279 out<<
"SequenceRecoveryFilter returns "<<
compute( pose,
false )<<std::endl;
289 TR <<
"SequenceRecoveryFilter"<<std::endl;
293 mutations( tag->getOption<
bool >(
"report_mutations", 0 ) );
294 verbose( tag->getOption<
bool >(
"verbose", 0 ) );
295 write2pdb( tag->getOption<
bool >(
"write2pdb", 0 ) );
297 using namespace basic::options;
298 using namespace basic::options::OptionKeys;
300 if( option[ in::file::native ].user() ){
301 std::string const reference_pdb = option[ in::file::native ]();
305 TR<<
"Using native pdb "<<reference_pdb<<
" as reference.";
308 TR<<
"Using starting pdb as reference. You could use -in::file::native to specify a different pdb for reference";
315 utility::lua::LuaObject
const & ,
316 utility::lua::LuaObject
const & tasks ) {
317 TR <<
"SequenceRecoveryFilter"<<std::endl;
319 rate_threshold( def[
"rate_threshold"] ? def[
"rate_threshold"].to<core::Real>() : 0.0 );
320 mutation_threshold( def[
"mutation_threshold"] ? def[
"mutation_threshold"].to<core::Size>() : 100 );
321 mutations( def[
"report_mutations"] ? def[
"report_mutations"].to<bool>() :
false );
322 verbose( def[
"verbose"] ? def[
"verbose"].to<bool>() :
false );
323 write2pdb( def[
"write2pdb"] ? def[
"write2pdb"].to<bool>() :
false );
325 using namespace basic::options;
326 using namespace basic::options::OptionKeys;
328 if( option[ in::file::native ].user() ){
329 std::string const reference_pdb = option[ in::file::native ]();
333 TR<<
"Using native pdb "<<reference_pdb<<
" as reference.";