Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HydrophobicityProfileSimilarity.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/HydrophobicityProfileSimilarity.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 // mini headers
25 #include <core/chemical/AA.hh>
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 
48  static const Real MIN_HYDROPHOBIC_PROBABILITY(0.75);
49 
50  Real totalScore = 0;
51  VallChunkOP chunk = f->get_chunk();
52  for (Size i = 1; i <= f->get_length(); i++) {
53  Size qindex = i + f->get_first_index_in_query() - 1;
54  if (is_hydrophobic_[query_[qindex - 1]]) {
55  utility::vector1<Real> query_prof_row = query_profile_->prof_row(qindex);
56  Real query_hydrophobic_sum = query_prof_row[core::chemical::aa_from_oneletter_code( 'F' )] +
57  query_prof_row[core::chemical::aa_from_oneletter_code( 'I' )] +
58  query_prof_row[core::chemical::aa_from_oneletter_code( 'L' )] +
59  query_prof_row[core::chemical::aa_from_oneletter_code( 'M' )] +
60  query_prof_row[core::chemical::aa_from_oneletter_code( 'V' )] +
61  query_prof_row[core::chemical::aa_from_oneletter_code( 'W' )] +
62  query_prof_row[core::chemical::aa_from_oneletter_code( 'Y' )];
63  if (query_hydrophobic_sum > MIN_HYDROPHOBIC_PROBABILITY) {
64  Size vallindex = f->get_first_index_in_vall() + i - 1;
65  utility::vector1<Real> tmplt_prof_row = chunk->at(vallindex)->profile();
66  Real tmplt_residue_hydrophobic_sum = tmplt_prof_row[core::chemical::aa_from_oneletter_code( 'F' )] +
67  tmplt_prof_row[core::chemical::aa_from_oneletter_code( 'I' )] +
68  tmplt_prof_row[core::chemical::aa_from_oneletter_code( 'L' )] +
69  tmplt_prof_row[core::chemical::aa_from_oneletter_code( 'M' )] +
70  tmplt_prof_row[core::chemical::aa_from_oneletter_code( 'V' )] +
71  tmplt_prof_row[core::chemical::aa_from_oneletter_code( 'W' )] +
72  tmplt_prof_row[core::chemical::aa_from_oneletter_code( 'Y' )];
73  utility::vector1<Real> tmplt_prof_struct_row = chunk->at(vallindex)->profile_struct();
74  tmplt_residue_hydrophobic_sum += tmplt_prof_struct_row[core::chemical::aa_from_oneletter_code( 'F' )] +
75  tmplt_prof_struct_row[core::chemical::aa_from_oneletter_code( 'I' )] +
76  tmplt_prof_struct_row[core::chemical::aa_from_oneletter_code( 'L' )] +
77  tmplt_prof_struct_row[core::chemical::aa_from_oneletter_code( 'M' )] +
78  tmplt_prof_struct_row[core::chemical::aa_from_oneletter_code( 'V' )] +
79  tmplt_prof_struct_row[core::chemical::aa_from_oneletter_code( 'W' )] +
80  tmplt_prof_struct_row[core::chemical::aa_from_oneletter_code( 'Y' )];
81  tmplt_residue_hydrophobic_sum /= (Real) 2.0;
82  if (tmplt_residue_hydrophobic_sum < MIN_HYDROPHOBIC_PROBABILITY - 0.10) { // .1 buffer
83  totalScore += 0.5; // penalty if avg sum of hydrophobic residue profile values from vall sequence and structure profiles less than query avg sum
84  }
85  }
86  }
87  }
88  totalScore /= (Real) f->get_length();
89  empty_map->set_score_component(totalScore, id_);
90  if ((totalScore > lowest_acceptable_value_) && (use_lowest_ == true))
91  return false;
92  return true;
93 }
94 
96 
97 } // scores
98 } // frag_picker
99 } // protocols
100 
101