25 #include <basic/options/option.hh>
27 #include <basic/options/keys/OptionKeys.hh>
28 #include <basic/options/keys/in.OptionKeys.gen.hh>
32 #include <basic/Tracer.hh>
39 #include <ObjexxFCL/FArray1D.hh>
40 #include <basic/prof.hh>
49 #include <boost/tuple/tuple.hpp>
52 #include <utility/vector1.hh>
57 namespace std { }
using namespace std;
63 namespace frag_picker {
66 using namespace basic::options;
67 using namespace basic::options::OptionKeys;
70 "protocols.frag_picker.scores.PhiPsiRmsd");
72 PhiPsiRmsd::PhiPsiRmsd(
Size priority,
Real lowest_acceptable_value,
bool use_lowest,
76 n_atoms_ = reference_pose->total_residue();
98 trPhiPsiRmsd.Warning <<
"Lack of data for position " << i
104 if ((entry.get<2> () > 181) || (entry.get<2> () < -181)
105 || (entry.get<3> () > 181) || (entry.get<3> () < -181)) {
108 <<
"Unphysical Phi/Psi observation at position " << i
120 chunk_phi_.redimension(current_chunk->size());
121 chunk_psi_.redimension(current_chunk->size());
122 for (
Size i = 1; i <= current_chunk->size(); ++i) {
135 std::string tmp = fragment->get_chunk()->chunk_key();
141 PROF_START( basic::FRAGMENTPICKING_PHIPSI_SCORE );
142 Size offset_q = fragment->get_first_index_in_query() - 1;
143 Size offset_v = fragment->get_first_index_in_vall() - 1;
146 for (
Size i = 1; i <= fragment->get_length(); ++i) {
150 if ( stmp > 180.0 ) stmp = abs(360.0 - stmp);
151 score += stmp * stmp;
153 if ( stmp > 180.0 ) stmp = abs(360.0 - stmp);
154 score += stmp * stmp;
157 score = sqrt(score) / ((
Real) fragment->get_length());
158 score /= (
Real) fragment->get_length();
159 scores->set_score_component(score,
id_);
160 PROF_STOP( basic::FRAGMENTPICKING_PHIPSI_SCORE );
172 out << f->get_chunk()->get_pdb_id() <<
" " << I(5,
173 f->get_first_index_in_vall()) <<
" ";
174 for (
Size i = 1; i <= f->get_length(); i++)
175 out <<
" " << f->get_residue(i)->aa() <<
" ";
176 out << std::endl <<
" ";
177 for (
Size i = 1; i <= f->get_length(); i++)
178 out << F(6, 1,
chunk_phi_(f->get_first_index_in_vall() + i - 1)) <<
" ";
179 out << std::endl <<
"query " << I(5, f->get_first_index_in_query()) <<
" ";
180 for (
Size i = 1; i <= f->get_length(); i++)
181 out << F(6, 1,
query_phi_(f->get_first_index_in_query() + i - 1))
184 Size offset_q = f->get_first_index_in_query() - 1;
185 Size offset_v = f->get_first_index_in_vall() - 1;
188 for (
Size i = 1; i <= f->get_length(); ++i) {
190 score += stmp * stmp;
191 if ( stmp > 180.0 ) stmp = abs(360.0 - stmp);
193 if ( stmp > 180.0 ) stmp = abs(360.0 - stmp);
194 score += stmp * stmp;
197 score = sqrt(score) / ((
Real) f->get_length());
200 out <<
"\nTotal score " << F(5, 3, score) <<
" REJECTED" << std::endl;
202 out <<
"\nTotal score " << F(5, 3, score) <<
" ACCEPTED" << std::endl;
203 totalScore /= (
Real) f->get_length();
204 empty_map->set_score_component(totalScore,
id_);
239 if (input_file !=
"") {
241 Size pos = input_file.find(
".pdb");
242 if (pos != std::string::npos) {
246 <<
"Reference structure for Phi,Psi scoring loaded from a PDB file: "
247 << input_file << std::endl;
249 << nativePose->sequence() << std::endl;
252 lowest_acceptable_value, use_lowest, nativePose);
254 pos = input_file.find(
".tab");
255 if (pos != std::string::npos) {
257 <<
"Reference file for Phi,Psi scoring loaded from a TALOS file: "
258 << input_file << std::endl;
262 lowest_acceptable_value, use_lowest, in);
267 if (option[in::file::talos_phi_psi].user()) {
269 <<
"Reference file for Phi,Psi scoring loaded from a TALOS file: "
270 << input_file << std::endl;
274 lowest_acceptable_value, use_lowest, in);
276 if (option[in::file::native].user()) {
279 trPhiPsiRmsd <<
"Reference file for Phi,Psi scoring loaded from "
280 << option[in::file::native]() << std::endl;
281 trPhiPsiRmsd.Debug <<
"its sequence is:\n" << nativePose->sequence()
285 lowest_acceptable_value, use_lowest, nativePose);
287 if (option[in::file::s].user()) {
290 trPhiPsiRmsd <<
"Reference file for Phi,Psi scoring loaded from "
291 << option[in::file::s]()[1] << std::endl;
292 trPhiPsiRmsd.Debug <<
"its sequence is:\n" << nativePose->sequence()
296 lowest_acceptable_value, use_lowest, nativePose);
299 utility_exit_with_message(
300 "Can't read a reference Phi,Psi data. Provide a structure with in::file::s flag\n\t or a Phi-Psi prediction in TALOS format.");