Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HelixKinkFilter.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/filters/HelixKinkFilter.cc
11 /// @brief
12 /// @detailed filter structures out, which have kink helices
13 /// @author Nobuyasu Koga ( nobuyasu@uw.edu )
14 
15 // Unit Headers
18 
19 // Package Headers
23 
24 // Project Headers
25 #include <core/scoring/Energies.hh>
27 #include <core/types.hh>
28 #include <core/pose/Pose.hh>
29 
30 // Utility headers
31 #include <basic/Tracer.hh>
32 
33 // Parser headers
34 #include <utility/tag/Tag.hh>
35 
36 // AUTO-REMOVED #include <protocols/fldsgn/topology/HSSTriplet.hh>
37 
38 #include <utility/vector0.hh>
39 #include <utility/vector1.hh>
40 
41 #ifdef WIN32
43 #endif
44 
45 
46 //// C++ headers
47 static basic::Tracer TR("protocols.fldsgn.filters.HelixKinkFilter");
48 
49 namespace protocols {
50 namespace fldsgn {
51 namespace filters {
52 
53 // @brief default constructor
55  Filter( "HelixKink" ),
56  bend_angle_( 20.0 ),
57  secstruct_( "" )
58 {}
59 
60 
61 // @brief copy constructor
63  //utility::pointer::ReferenceCount(),
64  Super( rval ),
65  bend_angle_( rval.bend_angle_ ),
66  secstruct_( rval.secstruct_ )
67 {}
68 
69 
70 /// @brief
71 bool
72 HelixKinkFilter::apply( Pose const & pose ) const
73 {
80 
81  // set SS_Info
82  String secstruct( pose.secstruct() );
83  if( secstruct_ != "" ) {
84  secstruct = secstruct_;
85  }
86  SS_Info2_OP ss_info = new SS_Info2( pose, secstruct );
87  Helices const & helices( ss_info->helices() );
88 
89  if( helices.size() < 1 ) {
90  TR << "There is no helix definition in pose. " << std::endl;
91  return true;
92  }
93 
94  if ( ! pose.energies().data().has( HBOND_SET ) ) {
95  TR << " Pose does not have HBOND_SET. Checking hbonds will be skipped. " << std::endl;
96  }
97 
98  // check kink
99  for( Size ii=1; ii<=helices.size(); ++ii ) {
100 
101  TR << "Helix " << ii << ", res " << helices[ ii ]->begin() << "-" << helices[ ii ]->end() << ", ";
102  // check helix bend
103  if ( helices[ ii ]->bend() > bend_angle_ ) {
104  TR << "is bended angle=" << helices[ ii ]->bend() << std::endl;
105  return false;
106  }
107 
108  // check broken hydrogen within helix
109  /// @brief check kink of helix, return number of loosen hydrogen
110  if ( pose.energies().data().has( HBOND_SET ) ) {
111  Size broken_hbonds( check_kink_helix( pose, helices[ ii ]->begin()-1, helices[ ii ]->end()-5 ) );
112  if( broken_hbonds > 0 ) {
113  TR << "is kinked, hbonds are broken. " << std::endl;
114  return false;
115  }
116  }
117 
118  TR << "is OK." << std::endl;
119  }
120 
121  // check broken hydrogen bond
122  TR << " Filter success ! " << std::endl;
123 
124  return true;
125 
126 }
127 
128 
129 /// @brief parse xml
130 void
132  TagPtr const tag,
133  DataMap &,
134  Filters_map const &,
135  Movers_map const &,
136  Pose const & )
137 {
138  bend_angle_ = tag->getOption<Real>( "bend", 20 );
139  // secondary strucuture info
140  String const blueprint = tag->getOption<String>( "blueprint", "" );
141  if( blueprint != "" ) {
142  protocols::jd2::parser::BluePrint blue( blueprint );
143  secstruct_ = blue.secstruct();
144  }
145 }
146 
149 
151 HelixKinkFilterCreator::keyname() const { return "HelixKink"; }
152 
153 } // filters
154 } // fldsgn
155 } // protocols