60 #include <ObjexxFCL/FArray1D.hh>
61 #include <ObjexxFCL/FArray2D.hh>
63 #include <numeric/conversions.hh>
64 #include <numeric/NumericTraits.hh>
69 #include <ObjexxFCL/format.hh>
93 using namespace core::io::silent;
94 using namespace core::scoring;
95 using namespace core::pose;
96 using namespace core::chemical;
97 using namespace core::conformation;
100 std::string const debug_silent_file=silent_file+
"_CONVERSION_DEBUG";
101 std::string const debug_tag=tag+
"_CONVERSION_DEBUG";
102 const Real RADS_PER_DEG = numeric::NumericTraits<Real>::pi() / 180.;
110 Real const local_angle_bin_size=20;
111 Real const local_z_bin_size=0.05;
118 for(
Size trail_num=1; trail_num<=NUM_trails; trail_num++){
135 if(rsd.is_virtual(
at))
continue;
137 centroid += rsd.xyz(
at);
142 if(numatoms==0) utility_exit_with_message(
"numatoms==0");
144 centroid = centroid/numatoms;
153 euler_angles.
alpha=(0.25*trail_num)*local_angle_bin_size*(RADS_PER_DEG);
154 euler_angles.
gamma=(0.25*trail_num)*local_angle_bin_size*(RADS_PER_DEG);
156 euler_angles.
z=(0.25*trail_num)*local_z_bin_size;
157 euler_angles.
beta=acos(euler_angles.
z);
172 pose.
set_xyz(
id, rotation_matrix * pose.
xyz(
id));
182 silent_file_data.write_silent_struct(DEBUG_silent_struct, debug_silent_file,
false);
187 import_silent_file_data.
read_file( debug_silent_file );
190 bool found_tag=
false;
195 if ( iter->decoy_tag() != debug_tag )
continue;
197 iter->fill_pose( pose_from_silent_file, *rsd_set );
200 if(num_struct!=1) utility_exit_with_message(
"num_struct=("+string_of(num_struct)+
")!=1");
201 if(found_tag==
false ) utility_exit_with_message(
"Could not find specified tag (" + debug_tag +
") in silent file (" + debug_silent_file +
")!" );
204 utility_exit_with_message(
"debug_silent_file ("+debug_silent_file+
") SHOULD exist!");
210 first_trail_pose_from_silent_file=pose_from_silent_file;
211 first_trail_pose=pose;
218 return silent_struct;
221 std::cout <<
"WARNING: Problem with writing pose (" << debug_tag <<
") to silent_file [Attempt #" << trail_num <<
"]" << std::endl;
227 first_trail_pose_from_silent_file.dump_pdb(
"SILENT_FILE_CONVERSION_PROBLEM_" + tag +
"_pose_from_silent_file.pdb" );
228 first_trail_pose.dump_pdb(
"SILENT_FILE_CONVERSION_PROBLEM_" + tag +
".pdb" );
230 std::string const ERROR_silent_file=
"SILENT_FILE_CONVERSION_PROBLEM_" + tag +
".out";
231 silent_file_data.write_silent_struct(ERROR_silent_struct, ERROR_silent_file,
false);
233 utility_exit_with_message(
"Fail to write pose (" + debug_tag +
") to silent_file after "+string_of(NUM_trails)+
" trails ");
237 return EMPTY_silent_struct;
248 using namespace core::io::silent;
249 using namespace core::scoring;
250 using namespace core::pose;
252 if(write_score_only){
265 return EMPTY_silent_struct;
275 using namespace core::io::silent;
276 using namespace core::scoring;
277 using namespace core::pose;
280 std::map< core::Size, core::Size >
const & full_to_sub = job_parameters_->const_full_to_sub();
281 std::map< core::Size, bool >
const & Is_prepend_map = job_parameters_->Is_prepend_map();
282 bool const Is_prepend( job_parameters_->Is_prepend() );
283 Size const moving_base_residue( job_parameters_->actually_moving_res() );
290 bool const output_extra_RMSDs=job_parameters_->output_extra_RMSDs();
292 if ( native_poseCOP ){
294 if(write_score_only){
301 s.add_energy(
"rmsd",
suite_rmsd( pose, *native_poseCOP, moving_base_residue, Is_prepend,
false));
302 s.add_energy(
"loop_rmsd",
rmsd_over_residue_list( pose, *native_poseCOP, rmsd_res_list, full_to_sub, Is_prepend_map,
false,
false) );
304 s.add_energy(
"V_rms",
suite_rmsd( pose, *native_poseCOP, moving_base_residue, Is_prepend,
true));
305 s.add_energy(
"V_loop_rms",
rmsd_over_residue_list( pose, *native_poseCOP, rmsd_res_list, full_to_sub, Is_prepend_map,
false,
true) );
307 if(job_parameters_->gap_size()==0){
310 s.add_energy(
"PBP_rmsd", 0.0);
318 if(output_extra_RMSDs){
324 if(working_native_alignment.size()!=0){
325 align_poses(current_pose, tag, *native_poseCOP,
"native", working_native_alignment);
327 align_poses(current_pose, tag, *native_poseCOP,
"native", working_best_alignment);
329 s.add_energy(
"O_rmsd",
suite_rmsd( current_pose, *native_poseCOP, moving_base_residue, Is_prepend,
false));
330 s.add_energy(
"O_loop_rmsd",
rmsd_over_residue_list( current_pose, *native_poseCOP, rmsd_res_list, full_to_sub, Is_prepend_map,
false,
false) );
332 s.add_energy(
"O_V_rms",
suite_rmsd( current_pose, *native_poseCOP, moving_base_residue, Is_prepend,
true));
333 s.add_energy(
"O_V_loop_rms",
rmsd_over_residue_list( current_pose, *native_poseCOP, rmsd_res_list, full_to_sub, Is_prepend_map,
false,
true) );
335 if(job_parameters_->gap_size()==0){
338 s.add_energy(
"O_PBP_rmsd", 0.0);
346 if(working_native_alignment.size()!=0){
347 align_poses(curr_pose_no_variants, tag +
"_no_variants", (*native_poseCOP),
"native", working_native_alignment);
349 align_poses(curr_pose_no_variants, tag +
"_no_variants", (*native_poseCOP),
"native", working_best_alignment);
352 s.add_energy(
"NAT_rmsd",
rmsd_over_residue_list( curr_pose_no_variants, *native_poseCOP, rmsd_res_list, full_to_sub, Is_prepend_map,
false ,
true ) );