Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ProlinePhiScore.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 && 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/scores/ProlinePhi.cc
11 /// @brief a base class for fragment scoring
12 /// @author Dominik Gront (dgront@chem.uw.edu.pl)
13 
15 
16 // type headers
17 #include <core/types.hh>
18 
19 // package headers
23 
24 #include <utility/vector1.hh>
25 
26 
27 namespace protocols {
28 namespace frag_picker {
29 namespace scores {
30 
32  FragmentScoreMapOP empty_map) {
33 
34  // describe_score(f, empty_map, std::cerr);
35 
36  Real totalScore = 0;
37  for (Size i = 1; i <= f->get_length(); i++) {
38  VallResidueOP r = f->get_residue(i);
39 
40  //std::cout << "DISULF " << i << " " << f->get_first_index_in_query() << " " << query_[i + f->get_first_index_in_query() - 2] << std::endl;
41 
42  Size query_res = i + f->get_first_index_in_query() - 2;
43 
44  Real phi = r->phi();
45  Real psi = r->psi();
46 
47  if (query_[query_res] == 'P') {
48  if ((phi < -103) || (phi > -33)) {
49  return false; // Never possible
50  }
51 
52  if (phi < -59.0) {
53  totalScore += 0.00197753 * (phi + 55.7777)*(phi + 55.7777);
54  } else {
55  totalScore += 6.08188 * (-0.282087*phi)
56  * (-0.0133411*phi)*(-0.0133411*phi)
57  * (-0.000115456*phi)*(-0.000115456*phi)*(-0.000115456*phi);
58  }
59  }
60 
61  if (query_[query_res] != 'G') {
62 
63  if (phi > 75) {
64  return false;
65  }
66 
67  if ((psi < -75) && (psi > -170)) {
68  return false;
69  }
70  }
71 
72  if ((query_[query_res] == 'I')
73  || (query_[query_res] == 'V')
74  || (query_[query_res] == 'T')) {
75  if (phi > -40) {
76  return false;
77  }
78  }
79 
80  if ((query_res + 1) < query_.size()) {
81  if ((query_[query_res+1] == 'P') && (query_[query_res] != 'G')) {
82  if ((psi < 40) && ((psi > -25) || (phi < -90))) {
83  return false;
84  }
85  }
86  }
87 
88  }
89  totalScore /= (Real) f->get_length();
90  empty_map->set_score_component(totalScore, id_);
91  if ((totalScore > lowest_acceptable_value_) && (use_lowest_ == true))
92  return false;
93  return true;
94 }
95 
97  FragmentScoreMapOP empty_map, std::ostream& out) {
98 
99  Real totalScore = 0;
100 
101  out << f->get_chunk()->get_pdb_id() << " " << I(5,
102  f->get_first_index_in_vall()) << " ";
103  for (Size i = 1; i <= f->get_length(); i++)
104  out << f->get_residue(i)->aa();
105  out << std::endl << " ";
106  for (Size i = 1; i <= f->get_length(); i++) {
107  VallResidueOP r = f->get_residue(i);
108 
109  if (query_[i + f->get_first_index_in_query() - 2] == 'P') {
110  Real phi = r->phi();
111 
112  if ((phi < -120) || (phi > -10)) {
113  return false; // Never possible
114  }
115 
116  if (phi < -59.0) {
117  totalScore += 0.00197753 * (phi + 55.7777)*(phi + 55.7777);
118  } else {
119  totalScore += 6.08188 * (-0.282087*phi)
120  * (-0.0133411*phi)*(-0.0133411*phi)
121  * (-0.000115456*phi)*(-0.000115456*phi)*(-0.000115456*phi);
122  }
123 
124  }
125  }
126  out << "\nquery " << I(5, f->get_first_index_in_query()) << " ";
127  for (Size i = 1; i <= f->get_length(); i++)
128  out << query_[i + f->get_first_index_in_query() - 2];
129  if ((totalScore > lowest_acceptable_value_) && (use_lowest_ == true))
130  out << "\nTotal score " << F(5, 3, totalScore) << " ACCEPTED"
131  << std::endl;
132  else
133  out << "\nTotal score " << F(5, 3, totalScore) << " REJECTED"
134  << std::endl;
135 
136  totalScore /= (Real) f->get_length();
137  empty_map->set_score_component(totalScore, id_);
138  if ((totalScore > lowest_acceptable_value_) && (use_lowest_ == true))
139  return false;
140  return true;
141 }
142 
143 } // scores
144 } // frag_picker
145 } // protocols
146 
147