24 #include <basic/options/option.hh>
25 #include <basic/options/keys/OptionKeys.hh>
26 #include <basic/options/keys/in.OptionKeys.gen.hh>
29 #include <basic/Tracer.hh>
32 #include <numeric/model_quality/rms.hh>
35 #include <ObjexxFCL/FArray2D.hh>
36 #include <ObjexxFCL/FArray1D.hh>
37 #include <basic/prof.hh>
44 #include <utility/io/izstream.hh>
50 namespace frag_picker {
53 using namespace basic::options;
54 using namespace basic::options::OptionKeys;
57 "protocols.frag_picker.scores.FragmentDME");
89 FArray2_double& coords,
Size n_atoms) {
91 trDMEScore.Debug <<
"Copying coordinates from ... The first residues are: "
99 coords(d, i) = xyz[d - 1];
106 PROF_START( basic::CA_DME_EVALUATION );
108 Real dme_native =99.0;
110 for (
Size i = 1; i<=f->get_length(); ++i)
111 tot_pair = tot_pair+i;
114 for (
Size i = 1; i<=f->get_length(); ++i) {
115 VallResidueOP ri = chunk->at( f->get_first_index_in_vall() + i - 1 );
116 Size qindexi = i + f->get_first_index_in_query() - 1;
117 for (
Size j = i+1; j<=f->get_length(); ++j) {
118 VallResidueOP rj = chunk->at( f->get_first_index_in_vall() + j - 1 );
119 Real xdiff = ri->x()-rj->x();
120 Real ydiff = ri->y()-rj->y();
121 Real zdiff = ri->z()-rj->z();
122 Real dist1 = xdiff*xdiff + ydiff*ydiff + zdiff*zdiff;
123 Size qindexj = j + f->get_first_index_in_query() - 1;
127 Real dist2 = xrdiff*xrdiff + yrdiff*yrdiff + zrdiff*zrdiff;
128 dme += (sqrt(dist1)-sqrt(dist2))*(sqrt(dist1)-sqrt(dist2));
131 dme_native=sqrt(dme/tot_pair);
133 empty_map->set_score_component(dme_native,
id_);
134 PROF_STOP( basic::CA_DME_EVALUATION );
145 for (
core::Size i = 1; i <= current_chunk->size(); i++) {
156 std::string tmp = fragment->get_chunk()->chunk_key();
160 PROF_START( basic::CA_DME_EVALUATION );
163 Real dme_native =99.0;
165 for (
Size i = 1; i<=fragment->get_length(); ++i)
166 tot_pair = tot_pair+i;
168 for (
Size i = 1; i<=fragment->get_length(); ++i) {
169 Size qindexi = i + fragment->get_first_index_in_query() - 1;
170 Size vindexi = i + fragment->get_first_index_in_vall() - 1;
171 for (
Size j = i+1; j<=fragment->get_length(); ++j) {
172 Size qindexj = j + fragment->get_first_index_in_query() - 1;
173 Size vindexj = j + fragment->get_first_index_in_vall() - 1;
177 Real dist1 = xdiff*xdiff + ydiff*ydiff + zdiff*zdiff;
181 Real dist2 = xrdiff*xrdiff + yrdiff*yrdiff + zrdiff*zrdiff;
182 dme += (sqrt(dist1)-sqrt(dist2))*(sqrt(dist1)-sqrt(dist2));
185 dme_native=sqrt(dme/tot_pair);
188 scores->set_score_component(dme_native,
id_);
189 PROF_STOP( basic::CA_DME_EVALUATION );
203 if (option[in::file::native].user()) {
205 <<
"Reference structure to score fragments by DME loaded from: "
206 << option[in::file::native]() << std::endl;
211 lowest_acceptable_value, use_lowest, nativePose);
213 if (option[in::file::s].user()) {
215 <<
"Reference structure to score fragments by DME loaded from: "
216 << option[in::file::s]()[1] << std::endl;
221 lowest_acceptable_value, use_lowest, nativePose);
226 <<
"Reference structure to score fragments by DME loaded from: "
233 while( getline( input, line ) ) {
235 if ( line.substr(0,1) ==
"#" )
continue;
236 std::istringstream line_stream( line );
239 line_stream >> x >> y >> z;
243 xyz.push_back( row );
245 trDMEScore << xyz.size() <<
" atoms found in the reference" << std::endl;
248 lowest_acceptable_value, use_lowest, xyz);
250 utility_exit_with_message(
251 "Can't read a reference structure. Provide it with in::file::s flag");