23 #include <basic/Tracer.hh>
36 #include <numeric/xyz.functions.hh>
37 #include <numeric/numeric.functions.hh>
38 #include <numeric/random/random.hh>
39 #include <numeric/PCA.hh>
60 static basic::Tracer
TR(
"antibody2.AntibodyUtil");
88 using namespace kinematics;
90 TR <<
"Utility: Setting up simple one loop fold tree" << std::endl;
99 if( jumppoint1 < 1 ) jumppoint1 = 1;
100 if( jumppoint2 > nres) jumppoint2 = nres;
102 f.add_edge( 1, jumppoint1, Edge::PEPTIDE );
103 f.add_edge( jumppoint1, loop.
cut(), Edge::PEPTIDE );
104 f.add_edge( loop.
cut() + 1, jumppoint2, Edge::PEPTIDE );
105 f.add_edge( jumppoint2, nres, Edge::PEPTIDE );
106 f.add_edge( jumppoint1, jumppoint2, 1 );
111 TR <<
"Utility: Finished setting up simple one loop fold tree" << std::endl;
125 using namespace kinematics;
127 TR <<
"Utility: Setting up simple fold tree" << std::endl;
134 if( jumppoint1 < 1 ) jumppoint1 = 1;
135 if( jumppoint2 > nres) jumppoint2 = nres;
137 f.add_edge( 1, jumppoint1, Edge::PEPTIDE );
138 f.add_edge( jumppoint1, cutpoint, Edge::PEPTIDE );
139 f.add_edge( cutpoint + 1, jumppoint2, Edge::PEPTIDE );
140 f.add_edge( jumppoint2, nres, Edge::PEPTIDE );
141 f.add_edge( jumppoint1, jumppoint2, 1 );
146 TR <<
"Utility: Finished setting up simple fold tree" << std::endl;
202 TR <<
"Utility: Checking Kink/Extended CDR H3 Base Angle" << std::endl;
205 char const light_chain =
'L';
212 Real const kink_lower_bound = -10.00;
213 Real const kink_upper_bound = 70.00;
214 Real const extended_lower_bound = 125.00;
215 Real const extended_upper_bound = 185.00;
228 bool is_kinked(
false );
229 bool is_extended(
false );
233 std::vector <std::string> aa_name;
244 Real base_dihedral( numeric::dihedral_degrees(
253 TR <<
"Base Dihedral: " << base_dihedral << std::endl;
262 bool H3_base_only=
false;
266 if((base_dihedral > kink_lower_bound) && (base_dihedral < kink_upper_bound)){
268 TR <<
" " << base << std::endl;
270 else if((base_dihedral > extended_lower_bound) && (base_dihedral < extended_upper_bound)){
272 TR <<
" " << base << std::endl;
276 TR <<
" " << base << std::endl;
284 if( base_dihedral < kink_lower_bound ){
285 base_dihedral = base_dihedral + 360.00;
289 if ((aa_name[aa_name.size()-3] !=
"ASP") && (aa_name[aa_name.size()-1] ==
"TRP"))
291 if( (base_dihedral > kink_lower_bound) && (base_dihedral < kink_upper_bound))
300 if ( ( aa_name[ aa_name.size() - 3 ] ==
"ASP" ) &&
301 ( ( aa_name[1] !=
"LYS" ) && ( aa_name[1] !=
"ARG" ) ) &&
305 if( ( base_dihedral>extended_lower_bound) && (base_dihedral<extended_upper_bound) ) {
313 bool is_basic(
false);
314 for(
Size ii = 2; ii <=
Size(aa_name.size() - 5); ii++) {
315 if( aa_name[ii] ==
"ARG" || aa_name[ii] ==
"LYS" ) {
322 Size rosetta_number_of_L49 = pose_in.
pdb_info()->pdb2pose(light_chain, 49 );
324 if( let3_code_L49 ==
"ARG" || let3_code_L49 ==
"LYS"){
328 if( is_basic && ( base_dihedral > kink_lower_bound ) &&
329 ( base_dihedral < kink_upper_bound ) ) {
339 if ( ( aa_name[ aa_name.size() - 3 ] ==
"ASP") &&
340 ( ( aa_name[1] ==
"LYS") || ( aa_name[1] ==
"ARG" ) ) &&
341 ( (aa_name[0] !=
"LYS" ) && ( aa_name[0] !=
"ARG" ) ) &&
343 if( (base_dihedral > kink_lower_bound ) &&
344 (base_dihedral < kink_upper_bound ) ) {
351 bool is_basic(
false);
352 Size rosetta_number_of_L46 = pose_in.
pdb_info()->pdb2pose( light_chain, 46 );
354 if( let3_code_L46 ==
"ARG" || let3_code_L46 ==
"LYS") is_basic =
true;
355 if( is_basic && (base_dihedral > extended_lower_bound ) &&
356 ( base_dihedral < extended_upper_bound ) ) {
366 if ( ( aa_name[ aa_name.size() - 3 ] ==
"ASP") &&
367 ( ( aa_name[1] ==
"LYS") || ( aa_name[1] ==
"ARG" ) ) &&
368 ( ( aa_name[0] ==
"LYS") || ( aa_name[0] ==
"ARG") ) &&
371 if( ( base_dihedral > extended_lower_bound ) &&
372 ( base_dihedral < extended_upper_bound ) ) {
380 TR <<
"Utility: Finished Checking Kink/Extended CDR H3 Base Angle: " << is_H3 << std::endl;
389 TR <<
"Utility: Checking Kink/Extended CDR H3 Base Angle" << std::endl;
391 if(ab_info->is_Camelid() ){
return(
true ); }
395 Real const kink_lower_bound = -10.00;
396 Real const kink_upper_bound = 70.00;
397 Real const extended_lower_bound = 125.00;
398 Real const extended_upper_bound = 185.00;
407 Size start( ab_info->get_CDR_loop(
h3).start() - 2 );
408 Size stop( ab_info->get_CDR_loop(
h3).stop() + 1 );
411 bool matched_kinked(
false );
412 bool matched_extended(
false );
416 std::vector <std::string> aa_name;
427 Real base_dihedral( numeric::dihedral_degrees(
435 TR <<
"Base Dihedral: " << base_dihedral << std::endl;
438 if( base_dihedral < kink_lower_bound ){
439 base_dihedral = base_dihedral + 360.00;
443 if( (base_dihedral > kink_lower_bound ) && (base_dihedral < kink_upper_bound ) ) {
444 if(ab_info->get_Predicted_H3BaseType()==
Kinked) {matched_kinked =
true;}
446 if( (base_dihedral > extended_lower_bound ) && (base_dihedral < extended_upper_bound ) ) {
447 if(ab_info->get_Predicted_H3BaseType()==
Extended) {matched_extended =
true;}
452 if (matched_kinked || matched_extended){
459 TR <<
"Utility: Finished Checking Kink/Extended CDR H3 Base Angle: " << passed << std::endl;
468 using namespace pack::task;
469 using namespace pack::task::operation;
471 TR <<
"Utility: Setting Up Packer Task" << std::endl;
486 unboundrot->initialize_from_command_line();
489 tf->push_back( unboundrot_operation );
496 TR <<
"Utility: Done: Setting Up Packer Task" << std::endl;
577 bool closed_cutpoints =
true;
580 it_end=antibody_info->get_AllCDRs_in_loopsop()->end(),
581 it_next; it != it_end; ++it ) {
582 Size cutpoint = it->cut();
583 Real separation = 10.00;
586 if( separation > 1.9 ) {
587 closed_cutpoints =
false;
591 return( closed_cutpoints );
600 numeric::xyzVector_float peptide_C(pose_in.
residue( cutpoint ).
xyz( C )),
601 peptide_N( pose_in.
residue( cutpoint + 1 ).
xyz( N ) );
605 return( cutpoint_separation );
616 using namespace scoring;
618 Size loop_start = (*current_loop)[1].start();
619 Size loop_end = (*current_loop)[1].stop();
621 using ObjexxFCL::FArray1D_bool;
622 FArray1D_bool superpos_partner ( pose_in.
total_residue(), false );
624 for (
Size i = loop_start; i <= loop_end; ++i ) superpos_partner(i) =
true;
626 using namespace core::scoring;
637 for (
Size i=1; i<=8; ++i){
638 vl_coord_set.push_back( pose_in.
residue( vl_vh_residues[i] ).
xyz(
"CA" ) );
642 for (
Size i=9; i<=16; ++i){
643 vh_coord_set.push_back( pose_in.
residue( vl_vh_residues[i] ).
xyz(
"CA" ) );
646 Size vl_n_res = vl_coord_set.size();
648 for (
Size i = 1; i <= vl_n_res; ++i) {
649 vl_centroid += vl_coord_set[i];
651 vl_centroid /= vl_n_res;
653 Size vh_n_res = vh_coord_set.size();
655 for (
Size i = 1; i <= vh_n_res; ++i) {
656 vh_centroid += vh_coord_set[i];
658 vh_centroid /= vh_n_res;
663 vl_first_principal_component += vl_centroid;
664 vh_first_principal_component += vh_centroid;
666 Real packing_angle = numeric::dihedral_degrees( vl_first_principal_component, vl_centroid, vh_centroid, vh_first_principal_component );
668 if ( packing_angle > 0 ) {
669 packing_angle -= 180;
672 return packing_angle;
690 for (
Size i_chain=1; i_chain<=ab_info->get_AntibodyFrameworkInfo().size(); i_chain++){
692 vector1<FrameWork> native_chain_frmwk = native_ab_info->get_AntibodyFrameworkInfo()[i_chain];
696 for (
Size j_seg=1; j_seg<=chain_frmwk.size(); j_seg++) {
699 for (
Size k_res=chain_frmwk[j_seg].
start; k_res<= chain_frmwk[j_seg].stop; k_res++){
701 Size res_counter = k_res;
702 Size nat_counter = native_chain_frmwk[j_seg].start+count-1;
708 atom_map[ id1 ] = id2;