Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MidPsiOut.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 Psi && Psi dihedrals
11 /// @author Dominik Gront (dgront@chem.uw.edu.pl)
12 
16 //#include <protocols/frag_picker/PsiPsiTalosIO.hh>
17 // AUTO-REMOVED #include <protocols/frag_picker/scores/FragmentCrmsd.hh>
18 // AUTO-REMOVED #include <protocols/frag_picker/scores/FragmentScoreManager.hh>
20 // AUTO-REMOVED #include <protocols/frag_picker/FragmentPicker.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 namespace protocols {
57 namespace frag_picker {
58 namespace scores {
59 
60 using namespace basic::options;
61 using namespace basic::options::OptionKeys;
62 
63 MidPsiOut::MidPsiOut(Size priority, Real lowest_acceptable_value, bool use_lowest) :
64  CachingScoringMethod(priority, lowest_acceptable_value, use_lowest, "MidPsiOut") {
65 }
66 
67 void MidPsiOut::do_caching(VallChunkOP current_chunk) {
68 
69  chunk_psi_.redimension(current_chunk->size());
70  for (Size i = 1; i <= current_chunk->size(); ++i) {
71  VallResidueOP r = current_chunk->at(i);
72  chunk_psi_(i) = r->psi();
73  //chunk_psi_(i) = r->psi();
74  }
75 
76 }
77 
79  return cached_score( fragment, scores );
80 }
81 
83 
84  std::string tmp = fragment->get_chunk()->chunk_key();
85  if (tmp.compare(cached_scores_id_) != 0) {
86  do_caching(fragment->get_chunk());
87  cached_scores_id_ = tmp;
88  }
89 
90  Size offset_v = fragment->get_first_index_in_vall() - 1;
91 
92  Real r_psi = static_cast< Real > ( fragment->get_length() );
93  r_psi = (r_psi/2)+0.5+offset_v;
94  Size i_psi = static_cast< Size > ( r_psi );
95 
96  Real psi = chunk_psi_(i_psi);
97 
98  scores->set_score_component( psi, id_);
99 
100  return true;
101 }
102 
104 }
105 
106 /// @brief Creates a MidPsiOut scoring method
107 /// @param priority - priority of the scoring method. The higher value the earlier the score
108 /// will be evaluated
109 /// @param lowest_acceptable_value - if a calculated score is higher than this value,
110 /// fragment will be neglected
111 /// @param FragmentPickerOP object - not used
112 /// @param line - the relevant line extracted from the scoring configuration file that defines this scoring method
113 /// It could look like: "MidPsiOut 140 -5.0 100.0 additional_string"
114 /// where 140, -5.0 && 100.0 are priority, weight && treshold, respectively.
115 /// The additional string may be:
116 /// - empty: then the maker tries to create a scoring object from a TALOS file
117 /// trying in::file::talos_psi_psi flag. If fails, will try to use a pose from in::file::s
118 /// - a pdb file, pdb extension is necessary. This will create a pose && steal Psi && Psi
119 /// - a TALOS file with Psi/Psi prediction (tab extension is necessary)
121  Real lowest_acceptable_value, bool use_lowest, FragmentPickerOP //picker
122  , std::string) {
123 
124  return (FragmentScoringMethodOP) new MidPsiOut(priority,
125  lowest_acceptable_value, use_lowest);
126 }
127 
128 } // scores
129 } // frag_picker
130 } // protocols