Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HydrophobicitySimilarity.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/HydrophobicitySimilarity.cc
11 /// @brief a base class for fragment scoring
12 /// @author David E Kim
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  std::string ctmp = current_chunk()->chunk_key();
33  if (ctmp.compare("change to 'cached_scores_id_' when ready") != 0) {
34  return; // CACHING NOT BUILT IN YET
35  }
36 }
37 
39  FragmentScoreMapOP scores) {
40 
41  return score( fragment, scores );
42 
43 }
44 
46  FragmentScoreMapOP empty_map) {
47  Real totalScore = 0;
48  for (Size i = 1; i <= f->get_length(); i++) {
49  VallResidueOP r = f->get_residue(i);
50  // scoring based on SEGMER hydrophobicity energy term
51  if (is_hydrophobic_[r->aa()] && is_hydrophobic_[query_[i + f->get_first_index_in_query() - 2]])
52  continue; // no penalty if both query and vall residue are hydrophobic
53  else if (r->aa() == query_[i + f->get_first_index_in_query() - 2]) {
54  if (r->aa() == 'G' || r->aa() == 'g' || r->aa() == 'P' || r->aa() == 'p')
55  continue; // no penalty for identical G or P
56  else
57  totalScore += 0.3; // small penalty if residues are equal
58  } else
59  totalScore += 1.0; // penalty if different and not hydrophobic
60  }
61  totalScore /= (Real) f->get_length();
62  empty_map->set_score_component(totalScore, id_);
63  if ((totalScore > lowest_acceptable_value_) && (use_lowest_ == true))
64  return false;
65  return true;
66 }
67 
69 
70 } // scores
71 } // frag_picker
72 } // protocols
73 
74