Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AddChainBreak.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/protein_interface_design/movers/AddChainBreak.cc
11 /// @brief
12 /// @author Sarel Fleishman (sarelf@u.washington.edu)
13 
14 // Unit headers
17 #include <core/pose/util.hh>
18 // Package headers
20 // Project headers
21 #include <utility/tag/Tag.hh>
22 #include <basic/Tracer.hh>
23 #include <core/pose/Pose.hh>
26 #include <core/pose/selection.hh>
27 #include <boost/foreach.hpp>
28 #define foreach BOOST_FOREACH
29 
30 //Auto Headers
31 #include <utility/vector0.hh>
32 #include <utility/vector1.hh>
33 
34 
35 namespace protocols {
36 namespace protein_interface_design {
37 namespace movers {
38 
39 using namespace core;
40 using namespace std;
41 using namespace core::scoring;
42 using namespace protocols::moves;
43 
44 static basic::Tracer TR( "protocols.protein_interface_design.movers.AddChainBreak" );
45 
48 {
50 }
51 
54  return new AddChainBreak;
55 }
56 
59 {
60  return "AddChainBreak";
61 }
62 
64  protocols::moves::Mover( AddChainBreakCreator::mover_name() ),
65  resnum_( "" ),
66  change_foldtree_( true ),
67  find_automatically_( false ),
68  automatic_distance_cutoff_( 2.5 )
69 {}
70 
72 
75  return (protocols::moves::MoverOP( new AddChainBreak( *this ) ) );
76 }
77 
78 void
80 {
81  /// resnum & pdb_num are now equivalent
82  if( tag->hasOption( "resnum" ) )
83  resnum_ = tag->getOption< std::string > ("resnum" );
84  else if( tag->hasOption( "pdb_num" ) ){
85  resnum_ = tag->getOption< std::string > ("pdb_num" );
86  }
87  if( tag->hasOption( "find_automatically" ) ){
88  find_automatically( tag->getOption< bool >( "find_automatically" ) );
89  automatic_distance_cutoff( tag->getOption< core::Real >( "distance_cutoff", 2.5 ));
90  }
91  change_foldtree( tag->getOption< bool >( "change_foldtree", true ) );
92  TR<<"resnum: "<<resnum_<<" change foldtree "<<change_foldtree()<<" find cutpoints automatically "<<find_automatically()<<std::endl;
93 }//end parse my tag
94 
95 void
97 {
98  using namespace core::chemical;
99  using namespace pose;
101 
102  if( resnum() != "" ){
103  core::Size const resn( core::pose::parse_resnum( resnum(), pose ) );
104 
105  if( change_foldtree() ){
106  f.new_jump( resn, resn+1, resn );
107  }
112  }
114  cuts.clear();
115  if( find_automatically() ){
116  for( core::Size i = 1; i < pose.total_residue(); ++i ){
117  core::Real const distance( pose.residue( i ).xyz( "C" ).distance( pose.residue( i + 1 ).xyz( "N" ) ) );
118  if( distance >= automatic_distance_cutoff() ){
119  cuts.push_back( i );
120  TR<<"Detecting cut at "<<i<<" with distance "<<distance<<std::endl;
121  }
122  }
123  }
124  foreach( core::Size const res, cuts ){
127  if( change_foldtree() ){
128  f.new_jump( res, res+1, res );
129  }
130  }
131  if( change_foldtree() ){
132  pose.fold_tree( f );
133  TR<<"New fold tree: "<<pose.fold_tree()<<std::endl;
134  }
135 }
136 
140 }
141 
142 } //movers
143 } //protein_interface_design
144 } //protocols
145