29 #include <basic/options/option.hh>
30 #include <basic/options/keys/antibody.OptionKeys.gen.hh>
31 #include <basic/options/keys/constraints.OptionKeys.gen.hh>
32 #include <basic/options/keys/in.OptionKeys.gen.hh>
34 #include <basic/options/keys/run.OptionKeys.gen.hh>
56 #include <basic/Tracer.hh>
57 #include <basic/datacache/BasicDataCache.hh>
58 #include <basic/datacache/DiagnosticData.hh>
60 #include <ObjexxFCL/format.hh>
61 #include <ObjexxFCL/string.functions.hh>
62 using namespace ObjexxFCL::fmt;
94 #include <utility/vector0.hh>
95 #include <utility/vector1.hh>
101 static basic::Tracer
TR(
"protocols.AntibodyModeler");
103 namespace protocols {
109 using namespace core;
112 AntibodyModeler::AntibodyModeler() :
Mover(),
113 init_for_input_yet_( false )
129 TR <<
"Setting up default settings" << std::endl;
146 using namespace basic::options;
147 using namespace basic::options::OptionKeys;
148 TR <<
"Reading Options" << std::endl;
149 model_h3_ = option[ OptionKeys::antibody::model_h3 ]();
150 snugfit_ = option[ OptionKeys::antibody::snugfit ]();
154 graft_l1_ = option[ OptionKeys::antibody::graft_l1 ]();
155 graft_l2_ = option[ OptionKeys::antibody::graft_l2 ]();
156 graft_l3_ = option[ OptionKeys::antibody::graft_l3 ]();
157 graft_h1_ = option[ OptionKeys::antibody::graft_h1 ]();
158 graft_h2_ = option[ OptionKeys::antibody::graft_h2 ]();
159 graft_h3_ = option[ OptionKeys::antibody::graft_h3 ]();
160 benchmark_ = option[ OptionKeys::run::benchmark ]();
161 camelid_ = option[ OptionKeys::antibody::camelid ]();
163 camelid_constraints ]();
164 cst_weight_ = option[ OptionKeys::constraints::cst_weight ]();
177 TR <<
"setting up Snug Dock fold tree" << std::endl;
178 TR <<
"Snug Dock Fold Tree: " << std::endl;
211 using namespace core;
212 using namespace chemical;
214 using namespace fragment;
215 using namespace scoring;
216 using namespace core::scoring::constraints;
217 using namespace protocols::moves;
222 cdr_constraint->apply( pose_in );
279 graft_move->enable_graft_l1(
graft_l1_ );
280 graft_move->enable_graft_l2(
graft_l2_ );
281 graft_move->enable_graft_l3(
graft_l3_ );
282 graft_move->enable_graft_h1(
graft_h1_ );
283 graft_move->enable_graft_h2(
graft_h2_ );
284 graft_move->enable_graft_h3(
graft_h3_ );
285 graft_move->enable_benchmark_mode(
benchmark_ );
286 graft_move->set_camelid(
camelid_ );
288 model_antibody->add_mover( graft_move );
292 model_cdrh3->enable_benchmark_mode(
benchmark_ );
293 model_cdrh3->set_camelid(
camelid_ );
297 model_cdrh3->set_centroid_loop_building(
true );
298 model_cdrh3->set_fullatom_loop_building(
true );
299 model_antibody->add_mover( model_cdrh3 );
332 cutpoint, 0,
false );
349 ( *scorefxn )( pose_in );
356 ( *scorefxn )( pose_in );
367 score_map_[
"AF_constraint" ] = constraint_score;
376 return "AntibodyModeler";
381 using namespace chemical;
383 using namespace fragment;
384 using namespace core::scoring;
403 offset_3mer_frags = frag_libs[2]->empty_clone();
404 FrameList loop_3mer_frames;
406 frag_libs[2]->region_simple( 1, frag_size, loop_3mer_frames );
407 for ( FrameList::const_iterator it = loop_3mer_frames.begin(),
408 eit = loop_3mer_frames.end(); it!=eit; ++it ) {
409 FrameOP short_frame = (*it)->clone_with_frags();
412 offset_3mer_frags->add( short_frame );
417 offset_9mer_frags = frag_libs[1]->empty_clone();
418 FrameList loop_9mer_frames;
420 frag_libs[1]->region_simple( 1, frag_size, loop_9mer_frames );
421 for ( FrameList::const_iterator it = loop_9mer_frames.begin(),
422 eit = loop_9mer_frames.end(); it!=eit; ++it ) {
423 FrameOP short_frame = (*it)->clone_with_frags();
426 offset_9mer_frags->add( short_frame );
443 using namespace kinematics;
445 TR <<
"ABM Setting up simple fold tree" << std::endl;
450 f.add_edge( 1, jumppoint1, Edge::PEPTIDE );
451 f.add_edge( jumppoint1, cutpoint, Edge::PEPTIDE );
452 f.add_edge( cutpoint + 1, jumppoint2, Edge::PEPTIDE );
453 f.add_edge( jumppoint2, nres, Edge::PEPTIDE );
454 f.add_edge( jumppoint1, jumppoint2, 1 );
459 TR <<
"ABM Done: Setting up simple fold tree" << std::endl;
492 using namespace pack;
493 using namespace pack::task;
494 using namespace pack::task::operation;
495 using namespace protocols;
496 using namespace protocols::toolbox::task_operations;
497 using namespace protocols::moves;
513 allcdr_map->set_chi(
false );
514 allcdr_map->set_bb(
false );
516 bool include_neighbors(
false );
518 include_neighbors, is_flexible );
519 allcdr_map->set_bb( is_flexible );
520 include_neighbors =
true;
522 include_neighbors, is_flexible );
523 allcdr_map->set_chi( is_flexible );
525 allcdr_map->set_jump( ii,
false );
534 Real min_tolerance = 0.1;
539 scorefxn, min_type, min_tolerance, nb_list );
547 repack->task_factory(
tf_ );
587 using namespace kinematics;
591 char second_chain =
'H';
594 for (
Size i = 1; i <= nres; ++i ) {
595 if( pdb_info->chain( i ) == second_chain) {
608 it_end = loops_in.
end(); it != it_end; ++it ) {
609 if ( jump_pos1 >= ( it->start() - 1 ) &&
610 jump_pos1 <= ( it->stop() + 1) )
611 jump_pos1 = it->stop() + 2;
612 if ( jump_pos2 >= ( it->start() - 1 ) &&
613 jump_pos2 <= ( it->stop() + 1) )
614 jump_pos2 = it->start() - 2;
625 it_end=loops_in.
end(); it != it_end; ++it ) {
626 Size const loop_start ( it->start() );
627 Size const loop_stop ( it->stop() );
628 Size const loop_cutpoint ( it->cut() );
629 Size edge_start(0), edge_stop(0);
631 const FoldTree & f_const = f;
632 Size const num_jump = f_const.num_jump();
633 for( FoldTree::const_iterator it2=f_const.begin(),
634 it2_end=f_const.end(); it2 !=it2_end; ++it2 ) {
635 edge_start = std::min( it2->start(), it2->stop() );
636 edge_stop = std::max( it2->start(), it2->stop() );
637 if ( ! it2->is_jump() && loop_start > edge_start
638 && loop_stop < edge_stop ) {
646 f.delete_unordered_edge( edge_start, edge_stop, Edge::PEPTIDE);
647 f.add_edge( loop_start-1, loop_stop+1, num_jump+1 );
648 f.add_edge( edge_start, loop_start-1, Edge::PEPTIDE );
649 f.add_edge( loop_start-1, loop_cutpoint, Edge::PEPTIDE );
650 f.add_edge( loop_cutpoint+1, loop_stop+1, Edge::PEPTIDE );
651 f.add_edge( loop_stop+1, edge_stop, Edge::PEPTIDE );
701 cdr_dock_map->clear();
702 cdr_dock_map->set_chi(
false );
703 cdr_dock_map->set_bb(
false );
705 bool include_neighbors(
false );
707 cdr_dock_map->set_bb( is_flexible );
708 include_neighbors =
true;
710 cdr_dock_map->set_chi( is_flexible );
711 cdr_dock_map->set_jump( 1,
true );
713 cdr_dock_map->set_jump( ii,
false );
732 using namespace core::chemical;
734 it_end = loops_in.
end(); it != it_end; ++it ) {
739 ( *scorefxn )( pose_in );
743 Size rep_ramp_cycles(3);
745 Real minimization_threshold(15.0);
752 minimization_threshold = 150.0;
756 Real rep_ramp_step = (rep_weight_max - 0.02) /
Real(rep_ramp_cycles-1);
757 for (
Size i = 1; i <= rep_ramp_cycles; i++ ) {
758 Real rep_weight = 0.02 + rep_ramp_step *
Real(i-1);
760 snugfit_MC_min ( pose_in, cdr_dock_map, cycles, minimization_threshold,
761 scorefxn, pack_scorefxn, is_flexible);
772 Real minimization_threshold,
777 using namespace moves;
782 "dfpmin_armijo_nonmonotone", minimization_threshold, nb_list );
790 utility::vector1_size rb_jump;
791 rb_jump.push_back( 1 );
792 using namespace core::pack::task;
793 using namespace core::pack::task::operation;
795 ObjexxFCL::FArray1D_bool loop_residues( nres,
false );
796 for(
Size i = 1; i <= nres; i++ )
797 loop_residues( i ) = is_flexible[ i ];
798 using namespace protocols::toolbox::task_operations;
802 pack_scorefxn,
tf_ );
805 rb_mover->add_mover( pack_rottrial );
807 scorefxn, minimization_threshold );
809 Real temperature = 0.8;
814 first_mcm_cycles->apply( pose_in );
825 using namespace moves;
830 Real trans_mag ( 0.1 );
831 Real rot_mag ( 5.0 );
834 std::string min_type =
"dfpmin_armijo_nonmonotone";
835 Real min_threshold ( 15.0 );
838 using namespace core::scoring;
854 using namespace core::chemical;
856 it_end = loops_in.
end(); it != it_end; ++it ) {
864 cdr_dock_map->clear();
865 cdr_dock_map->set_chi(
false );
866 cdr_dock_map->set_bb(
false );
868 bool include_neighbors(
false );
870 cdr_dock_map->set_bb( is_flexible );
871 include_neighbors =
true;
873 cdr_dock_map->set_chi( is_flexible );
874 cdr_dock_map->set_jump( 1,
true );
876 cdr_dock_map->set_jump( ii,
false );
881 min_threshold, nb_list );
889 utility::vector1_size rb_jump;
890 rb_jump.push_back( 1 );
891 using namespace core::pack::task;
892 using namespace core::pack::task::operation;
894 ObjexxFCL::FArray1D_bool loop_residues( nres,
false );
895 for(
Size i = 1; i <= nres; i++ )
896 loop_residues( i ) = is_flexible[ i ];
897 using namespace protocols::toolbox::task_operations;
903 pack_scorefxn,
tf_ );
907 pack_interface_repack->task_factory(
tf_);
909 Real temperature = 0.8;
921 rb_mover->add_mover( pack_rottrial );
924 scorefxn, min_threshold);
928 repack_step->
add_mover( rb_mover_min_trial );
929 repack_step->add_mover( pack_interface_trial );
930 repack_step->add_mover( scmin_trial );
933 for (
Size i=1; i < 8; ++i )
934 rb_mover_min_trial_repack->
add_mover( rb_mover_min_trial );
935 rb_mover_min_trial_repack->add_mover( repack_step );
939 initial_repack->
add_mover( pack_interface_trial );
940 initial_repack->add_mover( scmin_trial );
952 rb_mover_min_trial_repack, cycles );
955 snugfit_mcm->
add_mover( initial_repack );
956 snugfit_mcm->add_mover( minimize_trial );
957 snugfit_mcm->add_mover( mcm_four_cycles );
958 snugfit_mcm->add_mover( mcm_final_cycles );
959 snugfit_mcm->add_mover( minimize_trial );
961 snugfit_mcm->apply ( pose_in );
969 using namespace pack::task;
970 using namespace pack::task::operation;
974 TR <<
"AbModeler Reinitializing Packer Task" << std::endl;
980 TR <<
"AbModeler Setting Up Packer Task" << std::endl;
993 unboundrot->initialize_from_command_line();
996 tf_->push_back( unboundrot_operation );
1002 TR <<
"AbModeler Done: Setting Up Packer Task" << std::endl;
1013 using namespace scoring;
1015 Size loop_start( 1 );
1017 if( cdr_type ==
"l1" ) {
1020 }
else if( cdr_type ==
"l2" ) {
1023 }
else if( cdr_type ==
"l3" ) {
1026 }
else if( cdr_type ==
"h1" ) {
1029 }
else if( cdr_type ==
"h2" ) {
1032 }
else if( cdr_type ==
"h3" ) {
1037 using ObjexxFCL::FArray1D_bool;
1038 FArray1D_bool superpos_partner ( pose_in.
total_residue(), false );
1040 for (
Size i = loop_start; i <= loop_end; ++i )
1041 superpos_partner(i) =
true;
1043 using namespace core::scoring;
1054 Size H1_Cys(0), H3_Cys(0);
1057 32 ) ).name3() ==
"CYS" )
1060 'H', 33 ) ).name3() ==
"CYS" )
1068 if( ( H1_Cys != 0 ) && ( H3_Cys != 0 ) )
1069 TR <<
"CONSTRAINTS: "
1070 <<
"AtomPair CA " << H1_Cys <<
" CA " << H3_Cys
1071 <<
" BOUNDED 4.0 6.1 0.6 BOND; mean 5.6 sd 0.6" << std::endl;
1075 Size hfr_46(0), h3_closest(0);
1079 if( h3_closest != 0 )
1080 TR <<
"CONSTRAINTS: "
1081 <<
"AtomPair CA " << hfr_46 <<
" CA " << h3_closest
1082 <<
" BOUNDED 6.5 9.1 0.7 DISTANCE; mean 8.0 sd 0.7" << std::endl;