Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DisulfideIdentity.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/DisulfideIdentity.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 
39 
40  //std::cout << "DISULF " << i << " " << f->get_first_index_in_query() << " " << query_[i + f->get_first_index_in_query() - 2] << std::endl;
41  if (query_[i + f->get_first_index_in_query() - 2] == 'c') {
42 
43  VallResidueOP r = f->get_residue(i);
44  utility::vector1<Real> tmplt_prof_row = r->profile();
45 
46  for (Size k = 1; k <= 20; k++){
47 
48  if ( k == 1 ) {
49  totalScore += 1.0 - tmplt_prof_row[k];
50  } else {
51  totalScore += tmplt_prof_row[k];
52  }
53  }
54  }
55 
56 
57 
58  //if (query_[i + f->get_first_index_in_query() - 2] == 'c') {
59  // if (r->aa() != 'c')
60  // totalScore += 1;
61  //} else {
62  // if (r->aa() == 'c')
63  // totalScore += 1;
64  //}
65  }
66  totalScore /= (Real) f->get_length();
67  empty_map->set_score_component(totalScore, id_);
68  if ((totalScore > lowest_acceptable_value_) && (use_lowest_ == true))
69  return false;
70  return true;
71 }
72 
74  FragmentScoreMapOP empty_map, std::ostream& out) {
75 
76  Real totalScore = 0;
77 
78  out << f->get_chunk()->get_pdb_id() << " " << I(5,
79  f->get_first_index_in_vall()) << " ";
80  for (Size i = 1; i <= f->get_length(); i++)
81  out << f->get_residue(i)->aa();
82  out << std::endl << " ";
83  for (Size i = 1; i <= f->get_length(); i++) {
84  VallResidueOP r = f->get_residue(i);
85  if (query_[i + f->get_first_index_in_query() - 2] == 'c') {
86 
87  if (r->aa() != query_[i + f->get_first_index_in_query() - 2]) {
88  totalScore += 1;
89  out << "-";
90  } else {
91  if (r->aa() == 'c')
92  totalScore += 1;
93  out << "-";
94  }
95 
96  }
97  }
98  out << "\nquery " << I(5, f->get_first_index_in_query()) << " ";
99  for (Size i = 1; i <= f->get_length(); i++)
100  out << query_[i + f->get_first_index_in_query() - 2];
101  if ((totalScore > lowest_acceptable_value_) && (use_lowest_ == true))
102  out << "\nTotal score " << F(5, 3, totalScore) << " ACCEPTED"
103  << std::endl;
104  else
105  out << "\nTotal score " << F(5, 3, totalScore) << " REJECTED"
106  << std::endl;
107 
108  totalScore /= (Real) f->get_length();
109  empty_map->set_score_component(totalScore, id_);
110  if ((totalScore > lowest_acceptable_value_) && (use_lowest_ == true))
111  return false;
112  return true;
113 }
114 
115 } // scores
116 } // frag_picker
117 } // protocols
118 
119