Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ABEGO_SS_Map.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/frag_picker/quota/ABEGO_SS_Map.cc
11 /// @brief map ABEGO vs. SS combinations
12 /// @author Dominik Gront (dgront@chem.uw.edu.pl)
13 
15 
16 // utility headers
17 #include <utility/vector1.hh>
18 #include <core/types.hh>
19 
20 #include <sstream>
21 
22 #include <utility/options/BooleanVectorOption.hh>
23 
24 
25 namespace protocols {
26 namespace frag_picker {
27 namespace quota {
28 
29 /// @details Auto-generated virtual destructor
31 
32 char ABEGO_SS_Map::all_abego_[6] = {'X','A','B','E','G','O'};
33 char ABEGO_SS_Map::all_ss_[4] = {'X','H','E','L'};
34 
35 ABEGO_SS_Map::ABEGO_SS_Map(utility::vector1< std::pair<Size,Size> > ss_abego_types) {
36 
37  for(Size i=1;i<=3;i++) {
39  for(Size j=1;j<=5;j++)
40  row.push_back(false);
41  ss_abego_types_.push_back(row);
42  }
43  for(Size i=1;i<=ss_abego_types.size();i++)
44  set_status(ss_abego_types[i],true);
45 }
46 
48 
49  std::ostringstream ss;
50  for(Size i=1;i<=3;i++) {
51  for(Size j=1;j<=5;j++) {
52  if(! ss_abego_types_[i][j] ) continue;
53  ss<< "("<<all_ss_[i]<<","<<all_abego_[j]<<") ";
54  }
55  }
56 
57  return ss.str();
58 }
59 
61 
62  if ( std::abs( omega ) < 90 ) {
63  return 5; // cis-omega
64  } else if ( phi >= 0.0 ) {
65  if ( -100 < psi && psi <= 100 ) {
66  return 4; // alpha-L
67  } else {
68  return 3; // E
69  }
70  } else {
71  if ( -125 < psi && psi <= 50 ) {
72  return 1; // helical
73  } else {
74  return 2; // extended
75  }
76  }
77  return 0;
78 }
79 
80 Size abego_index(char abego_class) {
81 
82  switch(abego_class) {
83  case 'A' :
84  case 'a' :
85  return 1;
86  case 'B' :
87  case 'b' :
88  return 2;
89  case 'E' :
90  case 'e' :
91  return 3;
92  case 'G' :
93  case 'g' :
94  return 4;
95  case 'O' :
96  case 'o' :
97  return 5;
98  default :
99  std::stringstream ss (std::stringstream::out);
100  ss << "[ERROR] Unrecognized abego class id: "<<abego_class<<"\n";
101  utility_exit_with_message(ss.str());
102  return 0;
103  }
104 }
105 
106 Size ss_index(char ss_class) {
107 
108  switch(ss_class) {
109  case 'H' :
110  case 'h' :
111  return 1;
112  case 'E' :
113  case 'e' :
114  return 2;
115  case 'C' :
116  case 'c' :
117  case 'L' :
118  case 'l' :
119  return 3;
120  default :
121  std::stringstream ss (std::stringstream::out);
122  ss << "[ERROR] Unrecognized ss class id: "<<ss_class<<"\n";
123  utility_exit_with_message(ss.str());
124  return 0;
125  }
126 }
127 
128 } // quota
129 } // frag_picker
130 } // protocols
131