Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RotamerFeatures.hh
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/features/RotamerFeatures.hh
11 /// @brief report idealized torsional DOFs Statistics Scientific Benchmark
12 /// @author Matthew O'Meara
13 
14 #ifndef INCLUDED_protocols_features_RotamerFeatures_hh
15 #define INCLUDED_protocols_features_RotamerFeatures_hh
16 
17 // Unit Headers
20 #include <basic/database/schema_generator/Schema.hh>
21 
22 
30 
31 
32 //External
33 #include <boost/uuid/uuid.hpp>
34 
35 // Project Headers
36 #include <core/types.hh>
37 #include <utility/vector1.fwd.hh>
38 
39 // C++ Headers
40 #include <string>
41 
42 #include <utility/vector1.hh>
43 
44 
45 namespace protocols{
46 namespace features{
47 
48 //@brief Extract from the dunbrack Energy term the model for the
49 // rotamer conformation.
50 template < core::Size T >
52 
53 public:
54  static
55  bool
57  core::conformation::Residue const & residue,
59  core::Size & rotamer_bin
60  ) {
61  using namespace core::pack::dunbrack;
62 
63  SingleResidueRotamerLibraryCAP generic_rotlib =
65 
66  if(!generic_rotlib){
67  return false;
68  }
69 
71  dynamic_cast< RotamericSingleResidueDunbrackLibrary< T > const & >(
72  * generic_rotlib));
73 
74  RotVector rotamer_vector;
75  Size4 rotamer_fixed_vector;
76  core::Size packed_rotno;
77 
78  // can't use get_rotamer_from_chi_static because it's private. Perhaps it should be made public?
79  rotlib.get_rotamer_from_chi(residue.chi(), rotamer_vector);
80 
81  if(rotamer_vector.size() > 4){
82  //eg LYS_p:dimethylated, perhaps there is a more direct way to
83  //detect cases like this?
84  return false;
85  }
86 
87  copy(rotamer_vector.begin(), rotamer_vector.end(), rotamer_fixed_vector.begin());
88 
89  packed_rotno = rotlib.rotwell_2_packed_rotno(rotamer_vector);
90  if(packed_rotno == 0){
92  residue, rotamer_fixed_vector);
93  rotlib.packed_rotno_2_rotwell(packed_rotno, rotamer_vector);
94  }
95  rotamer_bin = rotlib.rotwell_2_rotno(rotamer_vector);
96 
97  PackedDunbrackRotamer< T, core::Real > interpolated_rotamer;
98  rotlib.interpolate_rotamers(
99  residue, scratch, packed_rotno, interpolated_rotamer);
100 
101  return true;
102 
103  }
104 
105 };
106 
107 
109 public:
111 
113  RotamerFeatures const & ) :
115  {}
116 
117  virtual ~RotamerFeatures(){}
118 
119  ///@brief generate the table schemas and write them to the database
120  void
121  write_schema_to_db(
122  utility::sql_database::sessionOP db_session) const;
123 
124 private:
125  ///@brief generate the residue_rotamers table schema
126  void
127  write_residue_rotamers_table_schema(
128  utility::sql_database::sessionOP db_session) const;
129 
130 public:
131  ///@brief return the set of features reporters that are required to
132  ///also already be extracted by the time this one is used.
134  features_reporter_dependencies() const;
135 
136  ///@brief return string with class name
138  type_name() const;
139 
140  ///@brief collect all the feature data for the pose
141  core::Size
142  report_features(
143  core::pose::Pose const & pose,
144  utility::vector1< bool > const & relevant_residues,
145  boost::uuids::uuid struct_id,
146  utility::sql_database::sessionOP db_session);
147 
148  void
149  delete_record(
150  boost::uuids::uuid struct_id,
151  utility::sql_database::sessionOP db_session);
152 };
153 
154 } // namespace
155 } // namespace
156 
157 #endif // include guard