21 #include <basic/options/option.hh>
22 #include <basic/options/keys/OptionKeys.hh>
23 #include <basic/options/keys/in.OptionKeys.gen.hh>
26 #include <basic/Tracer.hh>
29 #include <numeric/model_quality/rms.hh>
32 #include <ObjexxFCL/FArray2D.hh>
33 #include <ObjexxFCL/FArray1D.hh>
34 #include <basic/prof.hh>
41 #include <utility/io/izstream.hh>
47 namespace frag_picker {
50 using namespace basic::options;
51 using namespace basic::options::OptionKeys;
54 "protocols.frag_picker.scores.FragmentCrmsdResDepth");
88 FArray2_double& coords,
Size n_atoms) {
90 trRmsScore.Debug <<
"Copying coordinates from ... The first residues are: "
98 coords(d, i) = xyz[d - 1];
105 PROF_START( basic::CA_RMSD_EVALUATION );
107 Real depth_score = 0;
113 for (
Size i = 1; i <= f->get_length(); i++) {
114 Size qindex = i + f->get_first_index_in_query() - 1;
116 VallResidueOP r = chunk->at( f->get_first_index_in_vall() + i - 1 );
126 depth_score += depthdiff*depthdiff;
128 Real rms = numeric::model_quality::rms_wrapper(f->get_length(),
133 Real totalScore = rms*rms + 10*depth_score;
135 empty_map->set_score_component(totalScore,
id_);
136 PROF_STOP( basic::CA_RMSD_EVALUATION );
147 for (
core::Size i = 1; i <= current_chunk->size(); i++) {
158 std::string tmp = fragment->get_chunk()->chunk_key();
162 Real depth_score = 0;
164 PROF_START( basic::CA_RMSD_EVALUATION );
165 Size frag_len = fragment->get_length();
172 Size qindex = i + fragment->get_first_index_in_query() - 1;
173 Size vindex = i + fragment->get_first_index_in_vall() - 1;
181 exp(-1*fragment->get_chunk()->at( vindex )->depth()/2.8);
182 depth_score += depthdiff*depthdiff;
185 Real rms = numeric::model_quality::rms_wrapper(frag_len,
190 Real totalScore = rms*rms + 10*depth_score;
192 scores->set_score_component(totalScore,
id_);
193 PROF_STOP( basic::CA_RMSD_EVALUATION );
206 if (option[in::file::native].user()) {
208 <<
"Reference structure to score fragments by crmsd loaded from: "
209 << option[in::file::native]() << std::endl;
213 if (nativePose->total_residue() != picker->get_query_residue_depth().size())
214 utility_exit_with_message(
"MakeFragmentCrmsdResDepth native total residue != query residue depth length");
217 lowest_acceptable_value, use_lowest, nativePose, picker->get_query_residue_depth());
219 if (option[in::file::s].user()) {
221 <<
"Reference structure to score fragments by crmsd loaded from: "
222 << option[in::file::s]()[1] << std::endl;
226 if (nativePose->total_residue() != picker->get_query_residue_depth().size())
227 utility_exit_with_message(
"MakeFragmentCrmsdResDepth native total residue != query residue depth length");
230 lowest_acceptable_value, use_lowest, nativePose, picker->get_query_residue_depth());
235 <<
"Reference structure to score fragments by crmsd loaded from: "
242 while( getline( input, line ) ) {
244 if ( line.substr(0,1) ==
"#" )
continue;
245 std::istringstream line_stream( line );
248 line_stream >> x >> y >> z;
252 xyz.push_back( row );
254 trRmsScore << xyz.size() <<
" atoms found in the reference" << std::endl;
256 if (xyz.size() != picker->get_query_residue_depth().size())
257 utility_exit_with_message(
"MakeFragmentCrmsdResDepth xyz size != query residue depth length");
260 lowest_acceptable_value, use_lowest, xyz, picker->get_query_residue_depth());
262 utility_exit_with_message(
263 "Can't read a reference structure. Provide it with in::file::s flag");