22 #include <ObjexxFCL/string.functions.hh>
24 #include <basic/Tracer.hh>
27 #include <basic/options/option.hh>
28 #include <basic/options/keys/OptionKeys.hh>
29 #include <basic/options/keys/frags.OptionKeys.gen.hh>
50 #include <numeric/model_quality/rms.hh>
60 #include <utility/io/izstream.hh>
61 #include <utility/exit.hh>
64 #include <utility/vector1.hh>
68 namespace frag_picker {
71 "protocols.frag_picker.FragmentCandidate");
81 utility::io::izstream data(file_name.c_str());
86 utility_exit_with_message(
87 "[ERROR] Unable to open a file with fragments: " + file_name);
91 Size res_id = 0, qpos = 1, n_res = 0;
97 Size found = line.find_first_not_of(
" \t");
98 if (found == std::string::npos) {
101 VallChunkOP chunk = chunk_owner->find_chunk(pdb_id, chain_id,
104 for (
Size j = 1; j <= chunk->size(); ++j) {
105 if (chunk->at(j)->resi() == res_id) {
109 <<
"Supprisingly high residue id for a vall postion: "
110 << vpos << std::endl;
116 <<
"Can't find the following chunk in a vall: "
117 << pdb_id <<
" " << chain_id <<
" " << res_id
125 << res_id <<
" within a chunk" << std::endl;
132 if (n_frags < max_nfrags_per_pos) candidates.push_back(c);
139 if ((line.substr(0, 9) ==
"Position:") || (line.substr(0, 9)
140 ==
"position:") || (line.substr(0, 9) ==
" Position")
141 || (line.substr(0, 9) ==
" position")) {
142 std::istringstream line_stream(line);
143 line_stream >> tmp >> qpos;
148 << qpos <<
" in a query";
153 if ((pdb_id.size() == 4) && (res_id > 0) && (res_id < 99999))
155 std::istringstream line_stream(line);
156 line_stream >> pdb_id >> chain_id >> res_id;
157 if (pdb_id.size() != 4) {
173 using namespace basic::options;
174 using namespace basic::options::OptionKeys;
175 bool if_ca_in_output =
false;
177 if ( option[frags::write_ca_coordinates].user() ) {
179 if_ca_in_output = option[frags::write_ca_coordinates]();
183 if (option[frags::write_scores].user() && option[frags::write_scores]() && sc && ms) {
184 out <<
"# score " << F(9,3, ms->total_score(sc)) << std::endl;
191 char aa_upper( toupper(r->aa()) );
193 <<
" " << aa_upper <<
" " << r->ss() << F(9, 3, r->phi())
194 << F(9, 3, r->psi()) << F(9, 3, r->omega());
195 if ( if_ca_in_output ) {
196 out << F(9, 3,r->x()) << F(9, 3, r->y()) << F(9, 3, r->z());
217 using namespace basic::options;
218 using namespace basic::options::OptionKeys;
221 out <<
" " << I(5,r1->resi()) <<
" ";
224 char aa_upper( toupper(r->aa()) );
232 using namespace ObjexxFCL;
233 using namespace basic::options;
234 using namespace basic::options::OptionKeys;
244 if (option[frags::score_output_silent]()) {
254 relax_pose.
data().clear();
262 taskstd->restrict_to_repacking();
263 taskstd->or_include_current(
true);
264 taskstd->restrict_to_residues( needToRepack );
266 pack1.
apply( relax_pose );
272 mm_min->set_bb(
false );
273 mm_min->set_chi(
true );
274 mzr.
run( relax_pose, *mm_min, *sfxn, options );
283 sub_pose_relax_protocol->apply( relax_pose );
301 bool if_quota =
false;
302 if ( sc->get_quota_score() < 999.98 ) if_quota =
true;
304 for (
Size i = 1; i <= sc->size(); i++) {
315 assert (
key() > 0 );
316 assert (
key() < 40000000 );
320 ss->fill_struct( pose, tag );