Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CloseOneCDRLoop.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file protocols/antibody2/CloseOneCDRLoop.cc
11 /// @brief grafts a cdr onto the template of an antibody framework
12 /// @detailed
13 /// @author Jianqing Xu (xubest@gmail.com)
14 
15 
16 
18 
19 #include <core/pose/Pose.hh>
23 //#include <protocols/loops/LoopMover.fwd.hh>
24 //#include <protocols/loops/LoopMover.hh>
27 #include <numeric/xyz.functions.hh>
28 #include <numeric/xyz.io.hh>
30 
31 #include <basic/Tracer.hh>
32 static basic::Tracer TRC("protocols.antibody2.CloseOneCDRLoop");
33 
34 namespace protocols {
35 namespace antibody2 {
36 using namespace core;
37 
38 
39 CloseOneCDRLoop::CloseOneCDRLoop( ) : Mover( "CloseOneCDRLoop" ) {
40  set_default();
41  cdr_loop_start_ = 0;
42  cdr_loop_end_ = 0;
45 } // CloseOneCDRLoop default constructor
46 
47 
48 
49 CloseOneCDRLoop::CloseOneCDRLoop( Size query_start, Size query_end ) : Mover( "CloseOneCDRLoop" ) {
50  set_default();
51  cdr_loop_start_ = query_start;
52  cdr_loop_end_ = query_end;
53  loop_start_ = query_start-flanking_residues_;
54  loop_end_ = query_end+flanking_residues_;
55 } // CloseOneCDRLoop default constructor
56 
57 
58 
59 
60 // CloseOneCDRLoop default destructor
62 
63 
64 
65 
66 
67 
69 {
70  allowed_separation_ = 1.9;
71  flanking_residues_ = 5; // default 5;
73  movemap_->set_chi( false );
74  movemap_->set_bb( false );
75 } // CloseOneCDRLoop::set_default
76 
77 
78 
79 
81 CloseOneCDRLoop::get_name() const { return "CloseOneCDRLoop"; }
82 
83 
84 
85 
86 
87 
88 
89 
91 {
94 
95  Size const N ( 1 ); // N atom
96  Size const C ( 3 ); // C atom
97 
98  // Coordinates of the C and N atoms at stem
99  numeric::xyzVector_float peptide_C, peptide_N;
100 
101  // N-terminal
102  peptide_C = pose_in.residue( cdr_loop_start_ - 1 ).xyz( C );
103  peptide_N = pose_in.residue( cdr_loop_start_ ).xyz( N );
104 
105  // C-terminal
106  peptide_C = pose_in.residue( cdr_loop_end_ ).xyz( C );
107  peptide_N = pose_in.residue( cdr_loop_end_ + 1 ).xyz( N );
108 
109  // calculate separation at ends to see if it needs to be closed
110 // Real nter_separation=distance(peptide_C, peptide_N);
111 // Real cter_separation=distance(peptide_C, peptide_N);
112  Real nter_separation=peptide_C.distance(peptide_N);
113  Real cter_separation=peptide_C.distance(peptide_N);
114 
115 
116  // save the starting foldtree
117  core::kinematics::FoldTree f( pose_in.fold_tree() );
118 
119 
120  // setup movemap to only loop residues
121  utility::vector1< bool> allow_bb_move( pose_in.total_residue(), false );
122  for ( Size i=loop_start_; i<= loop_end_; ++i )
123  allow_bb_move[ i ] = true;
124  movemap_->set_bb( allow_bb_move );
125  movemap_->set_jump( 1, false );
126 
127 
128  if( nter_separation > allowed_separation_ ) {
129  loops::Loop one_loop( loop_start_, cdr_loop_start_, cdr_loop_start_-1, 0, false );
130  simple_one_loop_fold_tree( pose_in, one_loop );
131  CcdMoverOP ccd_moves = new CcdMover( one_loop, movemap_ );
132  ccd_moves->apply( pose_in );
133  }
134 
135  if( cter_separation > allowed_separation_ ) {
136  loops::Loop one_loop( cdr_loop_end_, loop_end_, cdr_loop_end_+1, 0, false );
137  simple_one_loop_fold_tree( pose_in, one_loop );
138  CcdMoverOP ccd_moves = new CcdMover( one_loop, movemap_ );
139  ccd_moves->apply( pose_in );
140  }
141 
142  Real separation = 0.00;
143  for( Size ii = loop_start_; ii <= loop_end_; ii++ ) {
144  peptide_C = pose_in.residue( ii ).xyz( C );
145  peptide_N = pose_in.residue( ii + 1 ).xyz( N );
146  separation=peptide_C.distance(peptide_N);
147 // separation=distance(peptide_C, peptide_N);
148  if( separation > allowed_separation_ ) {
149  Size cutpoint = ii;
150  loops::Loop one_loop( loop_start_, loop_end_, cutpoint, 0, false );
151  CcdMoverOP ccd_moves = new CcdMover( one_loop, movemap_ );
152  ccd_moves->apply( pose_in );
153  }
154  }
155 
156  // reset to original foldtree
157  pose_in.fold_tree( f );
158 } // CloseOneCDRLoop::apply
159 
160 
161 
162 
163 } // namespace antibody2
164 } // namespace protocols