23 #include <basic/options/keys/in.OptionKeys.gen.hh>
24 #include <basic/options/option.hh>
25 #include <basic/Tracer.hh>
26 #include <numeric/numeric.functions.hh>
27 #include <numeric/random/random.hh>
28 #include <utility/exit.hh>
29 #include <utility/io/izstream.hh>
30 #include <utility/pointer/owning_ptr.hh>
39 static numeric::random::RandomGenerator
RG(19810606);
41 static basic::Tracer
TR(
"protocols.antibody2.H3CterInsert");
53 H3CterInsert::H3CterInsert() : Mover()
63 init(antibody_info, camelid,
false);
77 Mover::type(
"H3CterInsert" );
122 TR <<
"Inserting CDR H3 C-ter Fragments" << std::endl;
124 Size loop_begin(0), loop_end(0), cutpoint(0);
128 loop_begin =
ab_info_->get_CDR_loop(
h3).start()-1;
130 loop_end =
ab_info_->get_CDR_loop(
h3).stop()+2;
132 pose.
fold_tree( *
ab_info_->setup_simple_fold_tree(loop_begin, cutpoint, loop_end, pose) );
135 bool success =
false;
136 while(success ==
false){
139 Size random_H3_ter(0);
156 if( (
ab_info_->get_CDR_loop(
h3).stop()-cter_insertion_pos) <=
ab_info_->get_CDR_loop(
h3).start() )
158 TR <<
"H3 LOOP IS TOO SHORT: CAN NOT USE C-TERM INFORMATION"<< std::endl;
176 TR <<
"Finished Inserting CDR H3 C-ter Fragments" << std::endl;
189 return "H3CterInsert";
201 using namespace fragment;
203 std::string const path = basic::options::option[ basic::options::OptionKeys::in::path::path ]()[1];
205 TR <<
"Reading CDR H3 C-ter Fragments" << std::endl;
207 bool is_kinked =
false;
208 bool is_extended =
false;
209 if (
ab_info_->get_Predicted_H3BaseType() ==
Kinked) is_kinked =
true;
218 TR<<
"cdr_h3_size="<<cdr_h3_size<<std::endl;
221 TR<<
"aa_1name.size()="<<aa_1name.size()<<std::endl;
224 for(
Size i=1;i<=aa_1name.size();i++){
227 TR<<tttttt<<std::endl;
252 if ( !H3_ter_library_stream ) {
253 TR <<
"[Error]: Could not open H3 base library file: "
255 <<
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << std::endl;
256 std::exit( EXIT_FAILURE );
266 Real resolution(0.0);
269 Size pdb_H3_length = cdr_h3_size;
270 Size h3_base_frag_size(
ab_info_->is_Camelid() ? 6 : 4 );
272 bool end_not_reached(
true);
273 while(end_not_reached){
274 bool seq_match(
true );
275 bool base_match(
false );
280 for (
Size i = 1; i <= h3_base_frag_size; ++i ) {
281 H3_ter_library_stream >> pdb_name >> res_no >> res_name
282 >> omega >> phi >> psi
283 >> H3_length >> resolution >> base_type
286 if(H3_ter_library_stream.eof()) {
287 end_not_reached =
false;
291 if( res_name != aa_1name[aa_1name.size() - 5 + i] ){
297 new BBTorsionSRFD( 3,
'L', res_name ) );
300 res_torsions->set_torsion ( 1, phi );
301 res_torsions->set_torsion ( 2, psi );
302 res_torsions->set_torsion ( 3, omega );
303 res_torsions->set_secstruct (
'L' );
304 f.add_residue( res_torsions );
309 if(
ab_info_->is_Camelid() ==
false) {
310 if( is_kinked && base_type ==
"KINK" ){
313 else if( is_extended && base_type ==
"EXTENDED" ){
316 else if( !is_kinked && !is_extended && base_type ==
"NEUTRAL" ){
322 if( is_extended && base_type ==
"EXTENDED" ){
325 else if( ( is_kinked && base_type ==
"KINK" ) || ( is_kinked && base_type ==
"EXTENDED" ) ){
328 else if( !is_kinked && !is_extended ){
335 if(
ab_info_->is_Camelid() && end_not_reached && base_match ){
341 else if( end_not_reached && (H3_length==pdb_H3_length) && base_match ){
349 if( end_not_reached && seq_match && base_match ){
351 H3_base_library_seq_kink.push_back( f );
353 if( end_not_reached && base_match ){
355 H3_base_library_kink.push_back( f );
366 H3_ter_library_stream.close();
367 H3_ter_library_stream.clear();
379 TR <<
"Finished reading CDR H3 C-ter Fragments" << std::endl;