20 #include <basic/options/option.hh>
23 #include <basic/datacache/BasicDataCache.hh>
33 #include <basic/datacache/DiagnosticData.hh>
52 #include <basic/options/keys/filters.OptionKeys.gen.hh>
54 #include <basic/options/keys/score.OptionKeys.gen.hh>
72 #include <basic/options/keys/packing.OptionKeys.gen.hh>
73 #include <basic/options/keys/in.OptionKeys.gen.hh>
74 #include <basic/options/keys/out.OptionKeys.gen.hh>
75 #include <basic/options/keys/constraints.OptionKeys.gen.hh>
76 #include <basic/options/keys/cluster.OptionKeys.gen.hh>
77 #include <basic/options/keys/edensity.OptionKeys.gen.hh>
78 #include <basic/options/keys/symmetry.OptionKeys.gen.hh>
80 #include <utility/file/FileName.hh>
82 #include <ObjexxFCL/FArray1D.hh>
87 #include <basic/Tracer.hh>
97 #include <utility/vector0.hh>
98 #include <utility/vector1.hh>
99 #include <basic/options/keys/docking.OptionKeys.gen.hh>
100 #include <basic/prof.hh>
102 namespace protocols {
103 namespace symmetric_docking {
105 using namespace core;
106 using namespace ObjexxFCL;
108 static basic::Tracer
TR(
"protocols.symmetric_docking.SymDockProtocol");
111 using namespace protocols::simple_moves::symmetry;
116 seq_mover->add_mover( dock_mover );
124 Mover::type(
"SymDockProtocol" );
133 bool const local_refine,
137 Mover::type(
"SymDockProtocol" );
147 bool const local_refine,
153 Mover::type(
"SymDockProtocol" );
222 using namespace basic::options;
223 using namespace core::scoring;
228 if ( option[ OptionKeys::docking::low_patch ].user() ) {
234 if ( option[ OptionKeys::docking::high_patch ].user() ) {
240 if ( option[ OptionKeys::docking::high_min_patch ].user() ) {
246 if ( option[ OptionKeys::docking::pack_patch ].user() ) {
281 if ( option[ OptionKeys::edensity::mapfile ].user() ) {
294 using namespace basic::options;
296 set_fullatom(option[ OptionKeys::out::file::fullatom ]());
301 set_sc_min(option[ OptionKeys::docking::sc_min ]());
303 set_dock_ppk(option[ OptionKeys::docking::dock_ppk ]());
306 if( basic::options::option[basic::options::OptionKeys::in::file::native].user() ){
318 using namespace scoring;
319 using namespace basic::options;
320 using namespace moves;
324 using namespace viewer;
341 TR <<
"Setting non-default TaskFactory." << std::endl;
345 TR <<
"Setting design to " <<
design_ << std::endl;
361 if ( option[ OptionKeys::constraints::cst_file ].user() || option[ OptionKeys::constraints::cst_fa_file ].user() ){
375 if ( option[ OptionKeys::run::score_only ]() ) {
380 core::Size const max_repeats( option[ OptionKeys::docking::max_repeats ]() );
383 for (
Size r = 1; r <= max_repeats; r++){
384 pose = starting_pose;
391 to_centroid.
apply( pose );
392 if ( option[ OptionKeys::constraints::cst_file ].user() || option[ OptionKeys::constraints::cst_fa_file ].user() ){
398 initial.
apply( pose );
400 TR <<
"finished initial perturbation" << std::endl;
405 job->add_string_real_pair(
"st_rmsd", st_rmsd);
410 TR.Debug <<
"DockingLowRes object created" << std::endl;
421 job->add_string_real_pair(
"cen_rms", cen_rms);
432 to_all_atom.
apply( pose );
433 if ( option[ OptionKeys::constraints::cst_file ].user() || option[ OptionKeys::constraints::cst_fa_file ].user() ){
436 recover_sidechains.
apply( pose );
441 TR.Debug <<
"DockingHighRes object created" << std::endl;
449 job->add_string_real_pair(
"I_sc", interface_score);
451 if ( !option[ OptionKeys::docking::dock_ppk ]() ) {
455 if(option[ OptionKeys::docking::kick_relax ].user())
463 else TR<<
"REPEAT STRUCTURE "<< r <<std::endl;
471 job->add_string_real_pair(
"rms", rms);
477 job->add_string_real_pair(
"I_sc", interface_score_);
498 using namespace core;
499 using namespace core::scoring;
500 using namespace basic::options;
502 bool passed_filter =
true;
505 Real interchain_contact_cutoff = 10.0;
506 Real interchain_vdw_cutoff = 1.0;
507 Real distance_constraint_cutoff = 1.0;
509 if( option[ OptionKeys::docking::dock_lowres_filter ].user() ) {
511 interchain_contact_cutoff = dock_filters[1];
512 interchain_vdw_cutoff = dock_filters[2];
513 if (dock_filters.size() > 2) {
514 distance_constraint_cutoff = dock_filters[3];
521 if ( option[ OptionKeys::constraints::cst_file ].user() ){
526 if( ( option[basic::options::OptionKeys::filters::set_saxs_filter ].user() ) &&
530 if( ! saxs_filter->apply(pose) )
531 passed_filter =
false;
536 if (!passed_filter) {
537 TR <<
"STRUCTURE FAILED LOW-RES FILTER" << std::endl;
540 TR <<
" cutoffs: " << interchain_contact_cutoff <<
" " << interchain_vdw_cutoff <<
" " << distance_constraint_cutoff << std::endl;
543 return passed_filter;
549 using namespace core;
550 using namespace core::scoring;
551 using namespace basic::options;
553 bool passed_filter =
true;
554 if ( option[ OptionKeys::docking::dock_ppk ]() )
return passed_filter;
556 Real score_cutoff = option[ OptionKeys::cluster::output_score_filter ]();
559 if (
score_map_[
"I_sc"] >= 0.0) passed_filter =
false;
561 if (!passed_filter)
TR <<
"STRUCTURE FAILED HIGH-RES FILTER" << std::endl;
563 return passed_filter;
570 recover_sidechains.
apply( pose );
572 TR <<
"Doing initial repack of sidechains" << std::endl;
576 using namespace moves;
577 using namespace core::pack::task;
578 using namespace core::pack::task::operation;
579 using namespace protocols::toolbox::task_operations;
588 if( basic::options::option[basic::options::OptionKeys::packing::resfile].user() ) tf->push_back(
new ReadResfile );
593 dock_pack->task_factory( tf );
594 dock_pack->apply( pose );
600 if (basic::options::option[ basic::options::OptionKeys::docking::sc_min ]()){
602 scmin_mover->apply(pose);
705 if ( option[ OptionKeys::run::debug ]() ) {
706 add_conformation_viewer( pose.conformation(), "start_pose", 450, 450, true );
708 mc_ = docking_low_->get_mc();
709 //add_monte_carlo_viewer( *mc_, "", 450, 450 );
710 add_monte_carlo_silent_viewer( *mc_, "", false );
713 TR.Debug << "SymDockingLowRes object created" << std::endl;
715 docking_low_->apply( pose );
717 //check low res filter to see if it should repeat low res or not
718 passed_filters = docking_lowres_filter( pose );
720 // add scores to map for output
721 ScoreMap::nonzero_energies( score_map_, docking_scorefxn, pose );
722 // core::Real cen_rms = symmetric_rms ? calc_symmetric_rms( pose ) : rmsd_no_super_subset( *get_native_pose(), pose, superpos_partner, is_protein_CA );
723 core::Real cen_rms = calc_rms( pose );
724 score_map_["cen_rms"] = cen_rms;
726 passed_filters = true;
729 // only do this is full atom is true
730 if ( fullatom_ && passed_filters ) {
732 //(*scorefxn_lowres_)(pose);
734 docking_scorefxn = new core::scoring::symmetry::SymmetricScoreFunction( *scorefxn_hires_ ) ;
735 if (!pose.is_fullatom()) to_all_atom.apply( pose );
736 // to_all_atom.apply( pose );
738 //recover sidechains from starting structures
739 protocols::simple_moves::ReturnSidechainMover recover_sidechains( *get_input_pose() );
740 recover_sidechains.apply( pose );
742 (*docking_scorefxn)( pose );
743 docking_high_->set_default_mc( pose );
746 mc_ = docking_high_->get_mc();
747 //add_monte_carlo_viewer( *mc_, "", 450, 450 );
748 add_monte_carlo_silent_viewer( *mc_, "", true );
751 TR.Debug << "DockingHighRes object created" << std::endl;
753 // TODO Add rtmin!!! Need to check if this has been incorporated into the packer
754 TR << "Doing initial repack of sidechains" << std::endl;
755 (*docking_scorefxn)( pose );
758 // Do initial pack over all residues within 1000A of the interface.
759 // Equates to repacking all residues, but doing so without RestrictTaskForDocking invalidates -norepack1 and -norepack2 flags
760 TaskFactoryOP tf = new TaskFactory;
762 tf->push_back( new OperateOnCertainResidues( new PreventRepackingRLT, new ResidueLacksProperty("PROTEIN") ) );
763 tf->push_back( new InitializeFromCommandline );
764 tf->push_back( new IncludeCurrent );
765 tf->push_back( new RestrictToRepacking );
766 tf->push_back( new NoRepackDisulfides );
767 tf->push_back( new SymRestrictTaskForDocking( docking_scorefxn, true, 1000 ) );
769 if( option[OptionKeys::packing::resfile].user() ) tf->push_back( new ReadResfile );
771 simple_moves::symmetry::SymPackRotamersMover pack( docking_scorefxn );
772 pack.task_factory( tf );
774 // run high resolution docking
775 docking_high_->apply( pose );
777 // add scores to map for output
778 ScoreMap::nonzero_energies( score_map_, docking_scorefxn, pose );
779 calc_interaction_energy( pose );
781 // check highres docking filter
782 passed_filters = docking_highres_filter( pose );
785 if ( passed_filters ) break;
786 if (!passed_filters) TR<<"REPEAT STRUCTURE "<< r <<std::endl;
788 }//end of repeat decoy creation
790 // calculate and store the rms no matter which mode was used
791 //score_map_["rms"] = rmsd_no_super_subset( *get_native_pose(), pose, superpos_partner, is_protein_CA );
792 // core::Real rms = symmetric_rms ? calc_symmetric_rms( pose ) : rmsd_no_super_subset( *get_native_pose(), pose, superpos_partner, is_protein_CA );
793 core::Real rms = calc_rms( pose );
794 score_map_["rms"] = rms;
795 calc_interaction_energy( pose );
797 if ( option[ OptionKeys::run::debug ]() ) basic::prof_show();
799 // cache the score map to the pose
800 pose.data().set(SCORE_MAP, new basic::datacache::DiagnosticData(score_map_));
805 return "SymDockProtocol";
853 using namespace scoring;
854 using namespace core::conformation::symmetry;
859 Real trans_magnitude = 1000;
863 dynamic_cast<SymmetricConformation & > ( pose.
conformation()) );
865 std::map< Size, SymDof > dofs ( symm_conf.
Symmetry_Info()->get_dofs() );
867 translate_away->step_size( trans_magnitude );
875 Real bound_energy = (*docking_scorefxn)( complex_pose );
876 translate_away->apply( complex_pose );
878 Real unbound_energy = (*docking_scorefxn)( complex_pose );
880 return bound_energy - unbound_energy;
887 using namespace core::conformation::symmetry;
888 using namespace basic::options;
892 dynamic_cast<SymmetricConformation &> ( pose.
conformation()) );
896 for (
Size res=1; res <= symm_info->num_total_residues_without_pseudo(); ++res )
898 superpos(res) =
true;
901 if ( option[ OptionKeys::symmetry::symmetric_rmsd ]() ) {
939 using namespace scoring;
940 using namespace moves;
945 score_and_exit.
apply( pose );
948 to_centroid.
apply( pose );
952 score_and_exit.
apply( pose );