26 #include <basic/Tracer.hh>
29 #include <ObjexxFCL/FArray1D.hh>
30 #include <ObjexxFCL/format.hh>
33 #include <utility/excn/Exceptions.hh>
39 static basic::Tracer
TR(
"antibody2.AntibodyInfo");
50 bool const & cdr_pdb_numbered) {
77 throw excn::EXCN_Msg_Exception(
"the number of chains in the input pose is '0' !!");
85 throw excn::EXCN_Msg_Exception(
" A): the input pose has only 1 chain, if it is a nanobody, the chain ID is supposed to be 'H' !!");
100 throw excn::EXCN_Msg_Exception(
" B): the input pose has two chains, 1). if it is nanobody, the 1st chain should be 'H'. 2). If it is a regular antibody, the 1st and 2nd chains should be 'L' and 'H' !!");
115 throw excn::EXCN_Msg_Exception(
" C). the input pose has more than two chains, 1). if it is nanobody, the 1st chain should be 'H'. 2). If it is a regular antibody, the 1st and 2nd chains should be 'L' and 'H' !!");
158 for (
Size i=1;i<=3;++i) { Chain_IDs_for_CDRs.push_back(
'H'); }
159 for (
Size i=1;i<=3;++i) { Chain_IDs_for_CDRs.push_back(
'L'); }
163 int loop_start_in_pose, loop_stop_in_pose, cut_position ;
167 loop_start_in_pose = pose.
pdb_info()->pdb2pose( Chain_IDs_for_CDRs[i], cdr_numbering_info[
Begin][i]);
169 loop_stop_in_pose= pose.
pdb_info()->pdb2pose( Chain_IDs_for_CDRs[i], cdr_numbering_info[
End][i]);
170 cut_position = (loop_stop_in_pose - loop_start_in_pose +1) /2 + loop_start_in_pose;
173 loop_stop_in_pose = pose.
pdb_info()->pdb2pose( Chain_IDs_for_CDRs[i], cdr_numbering_info[
End][i]+1 );
174 loop_stop_in_pose -=1;
182 cut_position = (loop_start_in_pose +1 ) ;
188 loops::Loop one_loop(loop_start_in_pose, loop_stop_in_pose, cut_position);
201 TR<<
"Successfully finished the CDR defintion"<<std::endl;
214 if (! pose.
pdb_info()->pdb2pose(
'L', 5)) {
215 throw excn::EXCN_Msg_Exception(
"L chain 5th residues missing, framework definition failed!!! " );
217 if (! pose.
pdb_info()->pdb2pose(
'L', 105)) {
218 throw excn::EXCN_Msg_Exception(
"L chain 105th residues missing, framework definition failed!!! " );
221 if (! pose.
pdb_info()->pdb2pose(
'H', 5)) {
222 throw excn::EXCN_Msg_Exception(
"H chain 5th residues missing, framework definition failed!!! " );
224 if (! pose.
pdb_info()->pdb2pose(
'H', 110)) {
225 throw excn::EXCN_Msg_Exception(
"H chain 110th residues missing, framework definition failed!!! " );
261 throw excn::EXCN_Msg_Exception(
"the numbering schemes can only be 'Aroop','Chothia','Kabat', 'Enhanced_Chothia', 'AHO', 'IMGT' !!!!!! ");
267 else {
throw excn::EXCN_Msg_Exception(
"The heavy chain has no framework? This cannot be correct");}
277 for (
Size i=1;i<=2;++i) { Chain_IDs_for_packing_angle.push_back(
'L'); }
278 for (
Size i=1;i<=2;++i) { Chain_IDs_for_packing_angle.push_back(
'H'); }
282 Size packing_angle_start_in_pose, packing_angle_stop_in_pose;
284 for (
Size i=1; i<=4; ++i){
285 packing_angle_start_in_pose = pose.
pdb_info()->pdb2pose( Chain_IDs_for_packing_angle[i], packing_angle_numbering_info[
Pack_Angle_Begin][i]);
286 packing_angle_stop_in_pose = pose.
pdb_info()->pdb2pose( Chain_IDs_for_packing_angle[i], packing_angle_numbering_info[
Pack_Angle_End][i]);
287 for (
Size j=packing_angle_start_in_pose; j<=packing_angle_stop_in_pose; j++){
313 TR <<
"AC Detecting Camelid CDR H3 Stem Type" << std::endl;
315 bool kinked_H3 (
false);
316 bool extended_H3 (
false);
321 cdr_h3_sequence.push_back( pose.
sequence()[ii-1] );
325 if( ( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] ==
'Y' ) ||
326 ( cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] ==
'W' ) ||
327 ( cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] ==
'F' ) ) &&
328 ( cdr_h3_sequence[ cdr_h3_sequence.size() - 2 ] !=
'H' ) &&
329 ( cdr_h3_sequence[ cdr_h3_sequence.size() - 1 ] !=
'G' ) )
335 if( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] ==
'R' ) ||
336 ( cdr_h3_sequence[ cdr_h3_sequence.size() - 2 ] ==
'Y' ) ||
337 (( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 1 ] !=
'Y' ) || ( cdr_h3_sequence[ cdr_h3_sequence.size() - 1 ] !=
'W' ) ) &&
338 ( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 2 ] !=
'Y' ) || ( cdr_h3_sequence[ cdr_h3_sequence.size() - 2 ] !=
'W' ) ) &&
339 ( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] !=
'Y' ) || ( cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] !=
'W' ) ))
352 TR <<
"AC Detecting Regular CDR H3 Stem Type" << std::endl;
353 bool extended_H3 (
false) ;
354 bool kinked_H3 (
false);
360 cdr_h3_sequence.push_back( pose.
sequence()[ii-1] );
363 if( cdr_h3_sequence[ cdr_h3_sequence.size() - 2 ] !=
'D') {
369 if( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 2 ] ==
'D')
370 && ( (cdr_h3_sequence[2] !=
'K') &&
371 (cdr_h3_sequence[2] !=
'R') ) && (is_H3 !=
true)) {
378 bool is_basic(
false );
379 for(
Size ii = 3; ii <=
Size(cdr_h3_sequence.size() - 4); ++ii) {
380 if( cdr_h3_sequence[ii] ==
'R' || cdr_h3_sequence[ii] ==
'K') {
387 Size L49_pose_number = pose.
pdb_info()->pdb2pose(
'L', 49 );
388 char aa_code_L49 = pose.
residue( L49_pose_number ).
name1();
389 if( aa_code_L49 ==
'R' || aa_code_L49 ==
'K')
399 if( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 2 ] ==
'D') &&
400 ( (cdr_h3_sequence[2] ==
'K') ||
401 (cdr_h3_sequence[2] ==
'R') ) &&
402 ( (cdr_h3_sequence[1] !=
'K') &&
403 (cdr_h3_sequence[1] !=
'R') ) && (is_H3 !=
true) ) {
407 bool is_basic(
false );
408 Size L46_pose_number = pose.
pdb_info()->pdb2pose(
'L', 46 );
409 char aa_code_L46 = pose.
residue( L46_pose_number ).
name1();
410 if( aa_code_L46 ==
'R' || aa_code_L46 ==
'K')
420 if( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 2 ] ==
'D') &&
421 ( ( cdr_h3_sequence[ 2 ] ==
'K') ||
422 (cdr_h3_sequence[2] ==
'R')) &&
423 ( (cdr_h3_sequence[1] ==
'K') ||
424 (cdr_h3_sequence[1] ==
'R') ) && (is_H3 !=
true) ) {
437 TR <<
"AC Detecting Regular CDR H3 Stem Type" << std::endl;
439 bool extended_H3 (
false) ;
440 bool kinked_H3 (
false);
445 cdr_h3_sequence.push_back( pose.
sequence()[ii-1] );
456 bool is_basic(
false );
458 Size L49_pose_number = pose.
pdb_info()->pdb2pose(
'L', 49 );
459 char aa_code_L49 = pose.
residue( L49_pose_number ).
name1();
460 if( aa_code_L49 ==
'R' || aa_code_L49 ==
'K')
465 if( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 2 ] ==
'D') &&
466 ( ( cdr_h3_sequence[ 2 ] ==
'K') || (cdr_h3_sequence[2] ==
'R') ) &&
467 ( ( cdr_h3_sequence[ 1 ] ==
'K') || (cdr_h3_sequence[1] ==
'R') ) ) {
470 }
else if( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 2 ] ==
'D') &&
471 ( ( cdr_h3_sequence[ 2 ] ==
'K') || ( cdr_h3_sequence[ 2 ] ==
'R') ) &&
472 ( ( cdr_h3_sequence[ 1 ] !=
'K') && ( cdr_h3_sequence[ 1 ] !=
'R') ) ) {
475 Size L46_pose_number = pose.
pdb_info()->pdb2pose(
'L', 46 );
476 char aa_code_L46 = pose.
residue( L46_pose_number ).
name1();
479 Size L36_pose_number = pose.
pdb_info()->pdb2pose(
'L', 36 );
480 char aa_code_L36 = pose.
residue( L36_pose_number ).
name1();
482 if( ( aa_code_L46 ==
'R' || aa_code_L46 ==
'K') && aa_code_L36 !=
'Y' ){
487 }
else if( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 2 ] ==
'D' ) &&
488 ( cdr_h3_sequence[ 2 ] !=
'K' ) && ( cdr_h3_sequence[ 2 ] !=
'R' ) &&
489 ( is_basic ==
true ) ) {
492 }
else if( ( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] ==
'F' ) &&
493 ( cdr_h3_sequence[ cdr_h3_sequence.size() - 4 ] ==
'A' ) ) ||
494 ( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] ==
'F' ) &&
495 ( cdr_h3_sequence[ cdr_h3_sequence.size() - 4 ] ==
'G' ) ) ||
496 ( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] ==
'M' ) &&
497 ( cdr_h3_sequence[ cdr_h3_sequence.size() - 4 ] ==
'A' ) ) ||
498 ( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] ==
'M' ) &&
499 ( cdr_h3_sequence[ cdr_h3_sequence.size() - 4 ] ==
'G' ) ) ) {
502 }
else if( ( cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] ==
'R' ) ||
503 ( cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] ==
'K' ) ||
504 ( cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] ==
'D' ) ||
505 ( cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] ==
'N' ) ){
508 }
else if( ( ( cdr_h3_sequence[ 3 ] ==
'Y' ) &&
509 ( cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] ==
'F' ) ) ||
510 ( (cdr_h3_sequence[ 3 ] ==
'Y' ) &&
511 (cdr_h3_sequence[ cdr_h3_sequence.size() - 3 ] ==
'M') ) ){
514 }
else if( cdr_h3_sequence.size() - 3 == 7 ) {
517 }
else if( cdr_h3_sequence[ cdr_h3_sequence.size() - 2 ] ==
'D' ) {
520 }
else if( cdr_h3_sequence[ cdr_h3_sequence.size() - 2 ] !=
'D' ) {
531 TR <<
"AC Finished Detecting Regular CDR H3 Stem Type: "
532 <<
"Kink: " << kinked_H3 <<
" Extended: " << extended_H3 << std::endl;
544 Size const & jumppoint1,
545 Size const & cutpoint,
546 Size const & jumppoint2,
549 using namespace kinematics;
555 f->add_edge( 1, jumppoint1, Edge::PEPTIDE );
556 f->add_edge( jumppoint1, cutpoint, Edge::PEPTIDE );
557 f->add_edge( cutpoint + 1, jumppoint2, Edge::PEPTIDE );
558 f->add_edge( jumppoint2, pose.
total_residue(), Edge::PEPTIDE );
559 f->add_edge( jumppoint1, jumppoint2, 1 );
568 using namespace kinematics;
582 f->add_edge( it->start()-1, it->stop()+1, jump_num );
583 f->add_edge( it->start()-1, it->cut(), Edge::PEPTIDE );
584 f->add_edge( it->cut()+1, it->stop()+1, Edge::PEPTIDE );
585 if( it == (it_end-1) )
586 f->add_edge( it->stop()+1, pose.
total_residue(), Edge::PEPTIDE);
588 f->add_edge( it->stop()+1, it_next->start()-1, Edge::PEPTIDE );
608 using namespace kinematics;
612 char second_chain =
'H';
615 for (
Size i = 1; i <= nres; ++i ) {
616 if( pdb_info->chain( i ) == second_chain) {
630 if ( jump_pos1 >= ( it->start() - 1 ) && jump_pos1 <= ( it->stop() + 1) )
631 jump_pos1 = it->stop() + 2;
632 if ( jump_pos2 >= ( it->start() - 1 ) && jump_pos2 <= ( it->stop() + 1) )
633 jump_pos2 = it->start() - 2;
640 Size const loop_start ( it->start() );
641 Size const loop_stop ( it->stop() );
642 Size const loop_cutpoint ( it->cut() );
643 Size edge_start(0), edge_stop(0);
644 bool edge_found =
false;
645 const FoldTree & f_const = *f;
646 Size const num_jump = f_const.num_jump();
647 for( FoldTree::const_iterator it2=f_const.begin(), it2_end=f_const.end(); it2 !=it2_end; ++it2 ) {
650 edge_start = std::min( it2->start(), it2->stop() );
651 edge_stop = std::max( it2->start(), it2->stop() );
652 if ( ! it2->is_jump() && loop_start > edge_start && loop_stop < edge_stop ) {
658 f->delete_unordered_edge( edge_start, edge_stop, Edge::PEPTIDE);
659 f->add_edge( loop_start-1, loop_stop+1, num_jump+1 );
660 f->add_edge( edge_start, loop_start-1, Edge::PEPTIDE );
661 f->add_edge( loop_start-1, loop_cutpoint, Edge::PEPTIDE );
662 f->add_edge( loop_cutpoint+1, loop_stop+1, Edge::PEPTIDE );
663 f->add_edge( loop_stop+1, edge_stop, Edge::PEPTIDE );
685 using namespace core;
686 using namespace kinematics;
690 char second_chain =
'H';
695 for (
Size i = 1; i <= nres; ++i ) {
696 if(pdb_info->chain(1) !=
'L'){
697 throw excn::EXCN_Msg_Exception(
"Chains are not named correctly or are not in the expected order");
700 if( (pdb_info->chain(i) ==
'L') && (pdb_info->chain(i) != pdb_info->chain(i+1))) {
701 if(pdb_info->chain(i+1) != second_chain){
702 throw excn::EXCN_Msg_Exception(
"Chains are not named correctly or are not in the expected order");
706 if( (pdb_info->chain(i) == second_chain) && (pdb_info->chain(i) != pdb_info->chain(i+1))) {
716 LH_A_foldtree.clear();
718 LH_A_foldtree.new_jump( jump_pos1, jump_pos2, cutpoint);
720 Size chain_begin(0), chain_end(0);
723 chain_end = cutpoint;
725 while (chain_begin != 1){
726 chain_end = chain_begin-1;
727 LH_A_foldtree.new_jump( chain_end, chain_begin, chain_end);
732 chain_begin = cutpoint+1;
735 chain_begin = chain_end+1;
736 LH_A_foldtree.new_jump( chain_end, chain_begin, chain_end);
740 LH_A_foldtree.reorder( 1 );
741 LH_A_foldtree.check_fold_tree();
743 return LH_A_foldtree;
762 using namespace core;
763 using namespace kinematics;
767 char second_chain =
'H';
772 for (
Size i = 1; i <= nres; ++i ) {
773 if(pdb_info->chain(1) !=
'L'){
774 throw excn::EXCN_Msg_Exception(
"Chains are not named correctly or are not in the expected order");
777 if( (pdb_info->chain(i) ==
'L') && (pdb_info->chain(i) != pdb_info->chain(i+1))) {
778 if(pdb_info->chain(i+1) != second_chain){
779 throw excn::EXCN_Msg_Exception(
"Chains are not named correctly or are not in the expected order");
783 if( (pdb_info->chain(i) ==
'L') && (pdb_info->chain(i+1) == second_chain)) {
793 L_HA_foldtree.clear();
795 L_HA_foldtree.new_jump( jump_pos1, jump_pos2, cutpoint);
797 Size chain_begin(0), chain_end(0);
800 chain_begin = cutpoint+1;
803 chain_begin = chain_end+1;
804 L_HA_foldtree.new_jump( chain_end, chain_begin, chain_end);
808 L_HA_foldtree.reorder( 1 );
809 L_HA_foldtree.check_fold_tree();
811 return L_HA_foldtree;
830 using namespace core;
831 using namespace kinematics;
835 char second_chain =
'H';
837 bool lchain_jump =
false;
841 for (
Size i = 1; i <= nres; ++i ) {
842 if(pdb_info->chain(1) !=
'L'){
843 throw excn::EXCN_Msg_Exception(
"Chains are not named correctly or are not in the expected order");
846 if( (pdb_info->chain(i) ==
'L') && (pdb_info->chain(i) != pdb_info->chain(i+1))) {
847 if(pdb_info->chain(i+1) != second_chain){
848 throw excn::EXCN_Msg_Exception(
"Chains are not named correctly or are not in the expected order");
852 if( (pdb_info->chain(i) ==
'L') && (pdb_info->chain(i+1) == second_chain)) {
862 LA_H_foldtree.clear();
864 LA_H_foldtree.new_jump( jump_pos1, jump_pos2, cutpoint);
866 Size chain_begin(0), chain_end(0);
869 chain_begin = cutpoint+1;
872 chain_begin = chain_end+1;
878 LA_H_foldtree.new_jump( chain_end, chain_begin, chain_end);
883 LA_H_foldtree.reorder( 1 );
884 LA_H_foldtree.check_fold_tree();
886 return LA_H_foldtree;
893 bool const & bb_only,
894 bool const & include_nb_sc,
895 Real const & nb_dist)
const {
905 move_map.
set_bb( bb_is_flexible );
906 if (bb_only==
false) {
908 move_map.
set_chi( sc_is_flexible );
920 bool const & bb_only,
921 bool const & include_nb_sc,
922 Real const & nb_dist)
const {
927 for(
Size ii = 2; ii <= the_loops.
num_loop() +1 ; ++ii ){
943 using namespace pack::task;
944 using namespace pack::task::operation;
946 ObjexxFCL::FArray1D_bool loop_residues( pose.
total_residue(), false );
948 loop_residues(i) = sc_is_packable[i];
951 using namespace protocols::toolbox::task_operations;
969 using namespace protocols::toolbox::task_operations;
987 start.clear(); stop.clear(); pack_angle_start.clear(); pack_angle_stop.clear();
988 for (
Size i=1;i<=local_numbering_info.size(); ++i){
989 local_numbering_info[i].clear();
991 local_numbering_info.clear();
1000 if(numbering_scheme ==
Aroop ){
1002 start.push_back(26); stop.push_back(35);
1003 start.push_back(50); stop.push_back(65);
1004 start.push_back(95); stop.push_back(102);
1006 start.push_back(24); stop.push_back(34);
1007 start.push_back(50); stop.push_back(56);
1008 start.push_back(89); stop.push_back(97);
1010 pack_angle_start.push_back(35); pack_angle_stop.push_back(38);
1011 pack_angle_start.push_back(85); pack_angle_stop.push_back(88);
1012 pack_angle_start.push_back(36); pack_angle_stop.push_back(39);
1013 pack_angle_start.push_back(89); pack_angle_stop.push_back(92);
1019 else if(numbering_scheme ==
Chothia ){
1021 start.push_back(26); stop.push_back(32);
1022 start.push_back(52); stop.push_back(56);
1023 start.push_back(95); stop.push_back(102);
1025 start.push_back(24); stop.push_back(34);
1026 start.push_back(50); stop.push_back(56);
1027 start.push_back(89); stop.push_back(97);
1029 pack_angle_start.push_back(35); pack_angle_stop.push_back(38);
1030 pack_angle_start.push_back(85); pack_angle_stop.push_back(88);
1031 pack_angle_start.push_back(36); pack_angle_stop.push_back(39);
1032 pack_angle_start.push_back(89); pack_angle_stop.push_back(92);
1039 else if(numbering_scheme ==
Kabat ){
1051 else if(numbering_scheme ==
AHO){
1057 else if(numbering_scheme ==
IMGT){
1060 throw excn::EXCN_Msg_Exception(
"the numbering schemes can only be 'Aroop','Chothia','Kabat', 'Enhanced_Chothia', 'AHO', 'IMGT' !!!!!! ");
1063 local_numbering_info.push_back(start);
1064 local_numbering_info.push_back(stop);
1065 local_numbering_info.push_back(pack_angle_start);
1066 local_numbering_info.push_back(pack_angle_stop);
1067 return local_numbering_info;
1092 int l1found = 0, l2found = 0, l3found = 1, h1found = 1, h2found = 0, h3found = 1;
1093 int lenl1 = 0, lenl2 = 0, lenl3 = 0, lenh1 = 0, lenh2 = 0, lenh3 = 0;
1094 int posl1_s = 0, posl1_e = 0, posl2_s = 0, posl2_e = 0, posl3_s = 0, posl3_e = 0;
1095 int posh1_s = 0, posh1_e = 0, posh2_s = 0, posh2_e = 0, posh3_s = 0, posh3_e = 0;
1097 int k = 0, l = 0, m = 0, n = 0;
1099 int pos_fr1_s = 0, pos_fr1_e = 0, pos_fr2_s = 0, pos_fr2_e = 0;
1100 int pos_fr3_s = 0, pos_fr3_e = 0, pos_fr4_s = 0, pos_fr4_e = 0;
1101 int len_fr1 = 0, len_fr2 = 0, len_fr3 = 0, len_fr4 = 0;
1106 std::string seql1, seql2, seql3, seqh1, seqh2, seqh3;
1114 std::string p3_l3[] = {
"G",
"A",
"P",
"C",
"D",
"E",
"Q",
"N",
"R",
"K",
"H",
"W",
"Y",
"F",
"M",
"T",
"V",
"I",
"S",
"L"};
1119 std::string p2_h1[] = {
"I",
"V",
"F",
"Y",
"A",
"M",
"L",
"N",
"G",
"E",
"W"};
1126 std::string p3_h3[] = {
"A",
"P",
"C",
"D",
"E",
"Q",
"N",
"R",
"K",
"H",
"W",
"Y",
"F",
"M",
"T",
"V",
"I",
"S",
"L",
"G"};
1139 len = querychain.length();
1142 }
else if(len < 250){
1156 if(querychain_first.find(
"WYL") != std::string::npos){
1157 posl1_e = querychain_first.find(
"WYL") - 1;
1158 }
else if(querychain_first.find(
"WLQ") != std::string::npos){
1159 posl1_e = querychain_first.find(
"WLQ") - 1;
1160 }
else if(querychain_first.find(
"WFQ") != std::string::npos){
1161 posl1_e = querychain_first.find(
"WFQ") - 1;
1162 }
else if(querychain_first.find(
"WYQ") != std::string::npos){
1163 posl1_e = querychain_first.find(
"WYQ") - 1;
1164 }
else if(querychain_first.find(
"WYH") != std::string::npos){
1165 posl1_e = querychain_first.find(
"WYH") - 1;
1166 }
else if(querychain_first.find(
"WVQ") != std::string::npos){
1167 posl1_e = querychain_first.find(
"WVQ") - 1;
1168 }
else if(querychain_first.find(
"WVR") != std::string::npos){
1169 posl1_e = querychain_first.find(
"WVR") - 1;
1170 }
else if(querychain_first.find(
"WWQ") != std::string::npos){
1171 posl1_e = querychain_first.find(
"WWQ") - 1;
1172 }
else if(querychain_first.find(
"WVK") != std::string::npos){
1173 posl1_e = querychain_first.find(
"WVK") - 1;
1174 }
else if(querychain_first.find(
"WLL") != std::string::npos){
1175 posl1_e = querychain_first.find(
"WLL") - 1;
1176 }
else if(querychain_first.find(
"WFL") != std::string::npos){
1177 posl1_e = querychain_first.find(
"WFL") - 1;
1178 }
else if(querychain_first.find(
"WVF") != std::string::npos){
1179 posl1_e = querychain_first.find(
"WVF") - 1;
1180 }
else if(querychain_first.find(
"WIQ") != std::string::npos){
1181 posl1_e = querychain_first.find(
"WIQ") - 1;
1182 }
else if(querychain_first.find(
"WYR") != std::string::npos){
1183 posl1_e = querychain_first.find(
"WYR") - 1;
1184 }
else if(querychain_first.find(
"WNQ") != std::string::npos){
1185 posl1_e = querychain_first.find(
"WNQ") - 1;
1186 }
else if(querychain_first.find(
"WHL") != std::string::npos){
1187 posl1_e = querychain_first.find(
"WHL") - 1;
1188 }
else if(querychain_first.find(
"WYM") != std::string::npos){
1189 posl1_e = querychain_first.find(
"WYM") - 1;
1195 posl1_s = querychain_first.find(
"C") + 1;
1196 lenl1 = posl1_e - posl1_s + 1;
1197 seql1 = querychain_first.substr(posl1_s,lenl1);
1200 pos_fr1_e = posl1_s - 1;
1201 len_fr1 = pos_fr1_e - pos_fr1_s + 1;
1202 seq_fr1 = querychain_first.substr(pos_fr1_s,len_fr1);
1208 posl2_s = posl1_e + 16;
1209 posl2_e = posl2_s + 6;
1210 lenl2 = posl2_e - posl2_s + 1;
1211 seql2 = querychain.substr(posl2_s,lenl2);
1213 pos_fr2_s = posl1_e + 1;
1214 pos_fr2_e = posl2_s - 1;
1215 len_fr2 = pos_fr2_e - pos_fr2_s + 1;
1216 seq_fr2 = querychain.substr(pos_fr2_s,len_fr2);
1227 for(l = 0;l < 3; ++l){
1228 for(m = 0;m < 4; ++m){
1229 for(n = 0;n < 2; ++n){
1230 for(k = 0;k < 20; ++k){
1233 frl3 = p1_l3[l] + p2_l3[m] + p3_l3[k] + p4_l3[n];
1235 if(querychain3.find(frl3, 80) != std::string::npos){
1236 posl3_e = querychain3.find(frl3,80) - 1;
1237 posl3_s = querychain3.find(
"C",80) + 1;
1238 lenl3 = posl3_e - posl3_s + 1;
1242 seql3 = querychain3.substr(posl3_s,lenl3);
1244 if(seql3.length() > 4){
1251 pos_fr3_s = posl2_e + 1;
1252 pos_fr3_e = posl3_s - 1;
1253 pos_fr4_s = posl3_e + 1;
1254 pos_fr4_e = pos_fr4_s + 5;
1255 len_fr3 = pos_fr3_e - pos_fr3_s + 1;
1256 len_fr4 = pos_fr4_e - pos_fr4_s + 1;
1257 seq_fr3 = querychain3.substr(pos_fr3_s,len_fr3);
1258 seq_fr4 = querychain3.substr(pos_fr4_s,len_fr4);
1274 if(l1found == 1 || l2found == 1 || l3found == 1){
1280 for(n = 0; n < 2; ++n){
1281 for(l = 0; l < 6; ++l){
1282 for(m = 0; m < 6; ++m){
1283 for(k = 0;k < 10; ++k){
1285 frh1 = p1_h1[n] + p2_h1[k] + p3_h1[l] + p4_h1[m];
1287 if(querychain_first.find(frh1, 0) != std::string::npos){
1288 posh1_e = querychain_first.find(frh1, 0) - 1;
1301 posh1_s = querychain_first.find(
"C") + 4;
1302 lenh1 = posh1_e - posh1_s + 1;
1303 seqh1 = querychain_first.substr(posh1_s, lenh1);
1306 pos_fr1_e = posh1_s - 1;
1307 len_fr1 = pos_fr1_e - pos_fr1_s + 1;
1308 seq_fr1 = querychain_first.substr(pos_fr1_s,len_fr1);
1317 for(m = 0;m < 3; ++m){
1318 for(l = 0;l < 5; ++l){
1319 for(k = 0;k < 20; ++k){
1321 frh3 =
"W" + p2_h3[m] + p3_h3[k] + p4_h3[l];
1323 if(querychain2.find(frh3, 80) != std::string::npos){
1324 posh3_e = querychain2.find(frh3,80) - 1;
1334 if(querychain2.find(
"C", 80) != std::string::npos){
1335 posh3_s = querychain2.find(
"C", 80) + 3;
1341 lenh3 = posh3_e - posh3_s + 1;
1342 seqh3 = querychain2.substr(posh3_s,lenh3);
1347 if(h1found != 1 && h3found != 1){
1348 posh2_s = posh1_e + 15;
1349 posh2_e = posh3_s - 33;
1350 lenh2 = posh2_e - posh2_s + 1;
1351 seqh2 = querychain.substr(posh2_s,lenh2);
1353 pos_fr2_s = posh1_e + 1;
1354 pos_fr2_e = posh2_s - 1;
1355 pos_fr3_s = posh2_e + 1;
1356 pos_fr3_e = posh3_s - 1;
1357 pos_fr4_s = posh3_e + 1;
1358 pos_fr4_e = pos_fr4_s + 5;
1359 len_fr2 = pos_fr2_e - pos_fr2_s + 1;
1360 len_fr3 = pos_fr3_e - pos_fr3_s + 1;
1361 len_fr4 = pos_fr4_e - pos_fr4_s + 1;
1362 seq_fr2 = querychain.substr(pos_fr2_s,len_fr2);
1363 seq_fr3 = querychain.substr(pos_fr3_s,len_fr3);
1364 seq_fr4 = querychain.substr(pos_fr4_s,len_fr4);
1369 if(l1found == 0 && l2found == 0 && l3found == 0){
1370 TR << lenl1 <<
"\t" << lenl2 <<
"\t" << lenl3 <<
"\t";
1371 TR << seql1 <<
"\t" << seql2 <<
"\t" << seql3 <<
"\t" << check <<
"\tLIGHT" << std::endl;
1372 }
else if(h1found == 0 && h2found == 0 && h3found == 0){
1373 TR << lenh1 <<
"\t" << lenh2 <<
"\t" << lenh3 <<
"\t";
1374 TR << seqh1 <<
"\t" << seqh2 <<
"\t" << seqh3 <<
"\t" << check <<
"\tHEAVY" << std::endl;
1375 }
else if(l1found == 0 && l2found == 0 && l3found == 0 && h1found == 0 && h2found == 0 && h3found == 0){
1376 TR << lenl1 <<
"\t" << lenl2 <<
"\t" << lenl3 <<
"\t";
1377 TR << lenh1 <<
"\t" << lenh2 <<
"\t" << lenh3 <<
"\t";
1378 TR << seql1 <<
"\t" << seql2 <<
"\t" << seql3 <<
"\t" << check <<
"\tLIGHT" <<
"\t";
1379 TR << seqh1 <<
"\t" << seqh2 <<
"\t" << seqh3 <<
"\t" << check <<
"\tHEAVY" << std::endl;
1381 TR <<
"Some CDRs seem to be missing!\t" << querychain <<
"\t";
1382 TR << lenh1 <<
"\t" << lenh2 <<
"\t" << lenh3 <<
"\t";
1383 TR <<
"H1:" << seqh1 <<
"\tH2: " << seqh2 <<
"\tH3 " << seqh3 <<
"\t" << posh3_s << std::endl;
1394 Size right_stem )
const {
1398 for (
Size i=the_loop.
start()-left_stem; i<=the_loop.
stop()+right_stem; ++i){
1407 if(string_cdr_name==0){
1410 string_cdr_name->push_back(
"H1"); string_cdr_name->push_back(
"H2");string_cdr_name->push_back(
"H3");
1411 string_cdr_name->push_back(
"L1"); string_cdr_name->push_back(
"L2");string_cdr_name->push_back(
"L3");
1413 return *string_cdr_name;
1418 if(string_h3_base_type==0){
1421 string_h3_base_type->push_back(
"KINKED");
1422 string_h3_base_type->push_back(
"EXTENDED");
1423 string_h3_base_type->push_back(
"NEUTRAL");
1425 return *string_h3_base_type;
1430 if(string_numbering_scheme==0){
1433 string_numbering_scheme->push_back(
"Aroop");
1434 string_numbering_scheme->push_back(
"Chothia");
1435 string_numbering_scheme->push_back(
"Kabat");
1436 string_numbering_scheme->push_back(
"Enhanced_Chothia");
1437 string_numbering_scheme->push_back(
"AHO");
1438 string_numbering_scheme->push_back(
"IMGT");
1440 return *string_numbering_scheme;
1446 if(pack_scorefxn == 0){
1449 return pack_scorefxn;
1453 if(dock_scorefxn == 0){
1458 return dock_scorefxn;
1462 if(loopcentral_scorefxn == 0){
1466 return loopcentral_scorefxn;
1470 if(loophighres_scorefxn == 0){
1476 return loophighres_scorefxn;
1493 using namespace ObjexxFCL::fmt;
1495 out <<
"////////////////////////////////////////////////////////////////////////////////" << std::endl;
1496 out << line_marker <<
A( 47,
"Rosetta Antibody Info" ) << space( 27 ) << line_marker << std::endl;
1497 out << line_marker << space( 74 ) << line_marker << std::endl;
1499 out << line_marker <<
" Antibody Type:";
1500 if(ab_info.
is_Camelid()){ out <<
" Camelid Antibody"<< std::endl;}
1501 else { out <<
" Regular Antibody"<< std::endl;}
1503 out << line_marker <<
" Predict H3 Cterminus Base:";
1506 out << line_marker << space( 74 ) << std::endl;
1508 out << line_marker <<
" "+ab_info.
get_CDR_Name(i)+
" info: "<<std::endl;
1510 out << line_marker <<
" sequence: ";
1515 out << line_marker <<
" loop_info: "<< ab_info.
get_CDR_loop(i)<<std::endl;
1517 out <<
"////////////////////////////////////////////////////////////////////////////////" << std::endl;