-
Notifications
You must be signed in to change notification settings - Fork 136
SID_ERMS_Rescore #300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
SID_ERMS_Rescore #300
Conversation
added it to apps.src.settings.all file, made two scripts in source to test and build said sid_erms app, and made an inputs directory in main to test the app.
inputs for debugging
|
Looks like you've added an |
|
I just cleared the top level directory and deleted the second ERMS_app.cc. Thanks! |
roccomoretti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautification before merging is a must.
Copy/paste code duplication is also something to be addressed - please move the common code into protocols to share between the applications. (Feel free to make a new protocols subdir if none of the current ones fit -- just be general in naming, such that future loosely related work can go into there as well.)
| "pilot/robert_bolz" : [ | ||
| "SID_ERMS_Rescore", | ||
| ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to delete this if you've removed the pilot app.
| basic::options::RealOptionKey const breakage_cutoff( "breakage_cutoff" ); | ||
|
|
||
|
|
||
| //This section of code is copied and adapted from SID_ERMS_prediction (src/apps/public/analysis/SID_ERMS_prediction.cc) for the purpose of simulating the ERMS data for rescoring. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be worth extracting the shared code and putting it into the protocols level, rather than just copy-pasting it.
| //end copied and adapted section | ||
|
|
||
| //calculate the rescored model | ||
| core::Real Rescore_models( const core::Real nscore_, const core::Real RMSE_, const core::Real max_, const core::Real min_ ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rosetta convention is to use "east const": (core::Real const nscore_)
Also, it's best to reserve trailing underscores for class member variables -- 'regular' variables (including function parameters) should be "normal".
| std::stringstream err_msg; | ||
| err_msg << "Must input the complex type using the complex_type option." << std::endl; | ||
| utility_exit_with_message(err_msg.str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just pass the string directly to utility_exit_with_message() (using a stringstream is only needed if you're doing some complex formatting.)
|
|
||
| utility::vector1<std::string> files; | ||
| utility::vector1<file::FileName> list; | ||
| if ( option[in::file::l].user() ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably recommend using streams_from_cmd_line() from core/import_pose/pose_stream/util.hh -- this parses the command line and loads the poses for you. (And is flexible with various inputs: -s/-l/-in:file:silent/etc.)
MetaPoseInputStream input = streams_from_cmd_line();
core::pose::Pose current_pose;
while ( input.has_another_pose() ) {
input.fill_pose( current_pose, *rsd_set );
std::cout << "Read pose for file: " << core::pose::tag_from_pose(current_pose) << std::endl;
}
| TR << "ERMS simulation complete" << std::endl; | ||
|
|
||
| //calculte RMSE (if applicable) | ||
| if ( option[ RMSE ].user() && option[ ERMS ].user() ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For boolean options, prefer value() to user()
(If someone sets -RMSE false on the command line, user() is true, but value() is false.)
| } else { | ||
| if ( !option[ basic::options::OptionKeys::in::file::l ].user() ) { | ||
| std::stringstream err_msg; | ||
| err_msg << "Must input either file containing B values (using flag B_vals) or PDB file to calculate B values for simulation." << std::endl; | ||
| utility_exit_with_message(err_msg.str()); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to beautify -- that last curly brace isn't matched with the else clause, despite looking like it is from the indentation.
| for ( core::Size i = 1; i <= rmse_list.size(); i++ ) { | ||
| if ( max_rmse < rmse_list[i] ) { | ||
| max_rmse = rmse_list[i]; | ||
| } | ||
| } | ||
| for ( core::Size i = 1; i <= rmse_list.size(); i++ ) { | ||
| if ( min_rmse > rmse_list[i] ) { | ||
| min_rmse = rmse_list[i]; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If found it interesting you used std::max_element above, but you're not using it (or std::minmax_element) here. (That's fine, I just found it interesting.)
protocols/sid_erms_prediction/sid_erms_simulate file, and then correctly called those functions in the apps/public/analysis/SID_ERMS_Rescore.cc
This application builds on the existing SID_ERMS_prediction application (written by jtseffer). It simulates the ERMS data for an input structure, and rescores it based on the given experimental ERMS data. The rescored structures are given as the output (as well as the difference between the simulated and experimental ERMS data).