Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SecondaryIdentity.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/SecondaryIdentity.cc
11 /// @brief scores a fragment by an amino acid sequence identity
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  Real totalScore = 0;
35  for (Size i = 1; i <= f->get_length(); i++) {
36  VallResidueOP r = f->get_residue(i);
37  if (r->ss() == query_[i + f->get_first_index_in_query() - 2])
38  totalScore += REWARD;
39  else
40  totalScore += PENALTY;
41  }
42  totalScore /= (Real) f->get_length();
43  empty_map->set_score_component(totalScore, id_);
44  if ((totalScore > lowest_acceptable_value_) && (use_lowest_ == true))
45  return false;
46  return true;
47 }
48 
50  FragmentScoreMapOP empty_map, std::ostream& out) {
51 
52  Real totalScore = 0;
53 
54  out << f->get_chunk()->get_pdb_id() << " " << I(5,
55  f->get_first_index_in_vall()) << " ";
56  for (Size i = 1; i <= f->get_length(); i++)
57  out << f->get_residue(i)->ss();
58  out << std::endl << " ";
59  for (Size i = 1; i <= f->get_length(); i++) {
60  VallResidueOP r = f->get_residue(i);
61  if (r->ss() == query_[i + f->get_first_index_in_query() - 2]) {
62  totalScore += REWARD;
63  out << "+";
64  } else {
65  totalScore += PENALTY;
66  out << "-";
67  }
68  }
69  out << "\nquery " << I(5, f->get_first_index_in_query()) << " ";
70  for (Size i = 1; i <= f->get_length(); i++)
71  out << query_[i + f->get_first_index_in_query() - 2];
72  if ((totalScore > lowest_acceptable_value_) && (use_lowest_ == true))
73  out << "\nTotal score " << F(5, 3, totalScore) << " ACCEPTED"
74  << std::endl;
75  else
76  out << "\nTotal score " << F(5, 3, totalScore) << " REJECTED"
77  << std::endl;
78  totalScore /= (Real) f->get_length();
79  empty_map->set_score_component(totalScore, id_);
80  if ((totalScore > lowest_acceptable_value_) && (use_lowest_ == true))
81  return false;
82  return true;
83 }
84 
85 } // scores
86 } // frag_picker
87 } // protocols