20 #include <basic/options/option.hh>
21 #include <basic/options/keys/OptionKeys.hh>
22 #include <basic/options/keys/in.OptionKeys.gen.hh>
28 #include <utility/io/izstream.hh>
31 #include <ObjexxFCL/FArray1D.hh>
36 #include <utility/vector1.hh>
40 namespace frag_picker {
43 using namespace basic::options;
44 using namespace basic::options::OptionKeys;
51 target_ca_dev_(target_ca_dev),
52 target_ca_dist_(target_ca_dist),
53 largest_fragment_(largest_fragment),
54 max_length_(max_length)
60 n_res_ = current_chunk->size();
71 Real distance = sqrt( pow( xr->x() - yr->x(), 2) + pow( xr->y() - yr->y(), 2) + pow( xr->z() - yr->z(), 2) );
84 std::string tmp = fragment->get_chunk()->chunk_key();
94 Size offset_q = fragment->get_first_index_in_query() - 1;
95 Size offset_v = fragment->get_first_index_in_vall() - 1;
101 for (
Size ix = 1; ix <= fragment->get_length()+3; ++ix) {
102 for (
Size iy = ix+1; iy <= fragment->get_length()+4; ++iy) {
104 Size res1 = ix+offset_q;
105 Size res2 = iy+offset_q;
107 Size v1 = ix+offset_v;
108 Size v2 = iy+offset_v;
111 ( v1 >= 3) && (v2 <=
n_res_ + 2) ) {
125 Real sig_function = ( 1 / ( 1 + exp(-2*(diff/dev) + 5 )));
129 score += sig_function;
135 score /= (
Real) fragment->get_length();
137 scores->set_score_component(score,
id_);
167 std::string target( picker->get_query_seq_string());
169 Size max_length = target.length();
174 target_ca_dev.redimension(max_length, max_length, 0.0);
175 target_ca_dist.redimension(max_length, max_length, 0.0);
178 if (option[in::file::PCS_frag_cst].user()) {
180 utility::io::izstream data( option[ in::file::PCS_frag_cst ]() );
185 while (!data.eof()) {
187 std::istringstream line_stream(line);
192 line_stream >> resX >> resY >> dist >> dev;
201 target_ca_dist(resX,resY) = dist;
202 target_ca_dev(resX,resY) = dev;
205 Size largest_fragment(0);
206 for (
Size i = 1; i <= picker->frag_sizes_.size(); ++i ) {
207 if ( picker->frag_sizes_[i] > largest_fragment ) largest_fragment = picker->frag_sizes_[i];
210 runtime_assert( largest_fragment > 0 );
213 target_ca_dev, target_ca_dist, largest_fragment, max_length);
216 utility_exit_with_message(
217 "Can't read PCS_frag_cst file. Provide a connectivity file with -in::PCS_frag_cst <file>\n");