Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MidPhiOut.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 // This file is part of the Rosetta software suite && is made available under license.
5 // The Rosetta software is developed by the contributing members of the Rosetta Commons consortium.
6 // (C) 199x-2009 Rosetta Commons participating institutions && developers.
7 // For more information, see http://www.rosettacommons.org/.
8 
9 /// @file protocols/frag_picker/scores/FragmentCrmsd.cc
10 /// @brief Object that scores a fragment by root mean square deviation of Phi && Psi dihedrals
11 /// @author Dominik Gront (dgront@chem.uw.edu.pl)
12 
14 
17 // AUTO-REMOVED #include <protocols/frag_picker/PhiPsiTalosIO.hh>
18 // AUTO-REMOVED #include <protocols/frag_picker/scores/FragmentCrmsd.hh>
19 // AUTO-REMOVED #include <protocols/frag_picker/scores/FragmentScoreManager.hh>
21 
22 // option key includes
23 // AUTO-REMOVED #include <core/init.hh>
24 // AUTO-REMOVED #include <basic/options/option.hh>
25 // AUTO-REMOVED #include <basic/options/option_macros.hh>
26 #include <basic/options/keys/OptionKeys.hh>
27 // AUTO-REMOVED #include <basic/options/keys/in.OptionKeys.gen.hh>
28 
29 // AUTO-REMOVED #include <core/pose/util.hh>
30 // AUTO-REMOVED #include <core/io/pdb/pose_io.hh>
31 // AUTO-REMOVED #include <basic/Tracer.hh>
32 
33 // AUTO-REMOVED #include <protocols/Protocol.hh>
34 
35 // AUTO-REMOVED #include <numeric/model_quality/rms.hh>
36 
37 // utils
38 #include <ObjexxFCL/FArray1D.hh>
39 // AUTO-REMOVED #include <basic/prof.hh>
40 
41 // C++
42 // AUTO-REMOVED #include <math.h>
43 // AUTO-REMOVED #include <stdio.h>
44 // AUTO-REMOVED #include <string.h>
45 
46 // Boost
47 // AUTO-REMOVED #include <boost/algorithm/string.hpp>
48 // AUTO-REMOVED #include <boost/tuple/tuple.hpp>
49 
50 #include <utility/vector1.hh>
51 
52 #ifdef WIN32
54 #endif
55 
56 
57 
58 namespace protocols {
59 namespace frag_picker {
60 namespace scores {
61 
62 using namespace basic::options;
63 using namespace basic::options::OptionKeys;
64 
65 MidPhiOut::MidPhiOut(Size priority, Real lowest_acceptable_value, bool use_lowest) :
66  CachingScoringMethod(priority, lowest_acceptable_value, use_lowest, "MidPhiOut") {
67 }
68 
69 void MidPhiOut::do_caching(VallChunkOP current_chunk) {
70 
71  chunk_phi_.redimension(current_chunk->size());
72  for (Size i = 1; i <= current_chunk->size(); ++i) {
73  VallResidueOP r = current_chunk->at(i);
74  chunk_phi_(i) = r->phi();
75  }
76 }
77 
79  return cached_score( fragment, scores );
80 }
81 
83 
84  std::string tmp = fragment->get_chunk()->chunk_key();
85 
86  if (tmp.compare(cached_scores_id_) != 0) {
87  do_caching(fragment->get_chunk());
88  cached_scores_id_ = tmp;
89  }
90 
91  Size offset_v = fragment->get_first_index_in_vall() - 1;
92 
93  Real r_phi = static_cast< Real > ( fragment->get_length() );
94  r_phi = (r_phi/2)+0.5+offset_v;
95  Size i_phi = static_cast< Size > ( r_phi );
96 
97  Real phi = chunk_phi_(i_phi);
98 
99  scores->set_score_component( phi, id_);
100 
101  return true;
102 }
103 
105 }
106 
107 /// @brief Creates a MidPhiOut scoring method
108 /// @param priority - priority of the scoring method. The higher value the earlier the score
109 /// will be evaluated
110 /// @param lowest_acceptable_value - if a calculated score is higher than this value,
111 /// fragment will be neglected
112 /// @param FragmentPickerOP object - not used
113 /// @param line - the relevant line extracted from the scoring configuration file that defines this scoring method
114 /// It could look like: "MidPhiOut 140 -5.0 100.0 additional_string"
115 /// where 140, -5.0 && 100.0 are priority, weight && treshold, respectively.
116 /// The additional string may be:
117 /// - empty: then the maker tries to create a scoring object from a TALOS file
118 /// trying in::file::talos_phi_psi flag. If fails, will try to use a pose from in::file::s
119 /// - a pdb file, pdb extension is necessary. This will create a pose && steal Phi && Psi
120 /// - a TALOS file with Phi/Psi prediction (tab extension is necessary)
122  Real lowest_acceptable_value, bool use_lowest, FragmentPickerOP //picker
123  , std::string ) {
124 
125  return (FragmentScoringMethodOP) new MidPhiOut(priority,
126  lowest_acceptable_value, use_lowest);
127 }
128 
129 } // scores
130 } // frag_picker
131 } // protocols