Rosetta
|
Log a detailed account of everything that happens in a loop modeling simulation. More...
#include <TrajectoryLogger.hh>
Public Member Functions | |
TrajectoryLogger (string const &prefix="") | |
Construct an empty logger. More... | |
TrajectoryLogger (LoopMover const *mover, string const &prefix="") | |
Construct a logger from a loop mover. More... | |
TrajectoryLogger (protocols::loops::LoopsCOP loops, core::scoring::ScoreFunctionCOP scorefxn, string const &prefix="") | |
Construct a logger from a score function and a loops object. More... | |
void | init (LoopMover const *mover) |
Initialize the logger from a loop mover after it has been constructed. More... | |
void | init (protocols::loops::LoopsCOP loops, core::scoring::ScoreFunctionCOP scorefxn) |
Initialize the logger from a score function and a loops object after it has been constructed. More... | |
void | record_move (basic::Tracer &tr, Pose &pose, core::Size const i, core::Size const j, core::Size const k, bool const proposed, bool const accepted) const |
Record a single Monte Carlo move. More... | |
void | record_move (basic::Tracer &tr, Pose &pose, core::Size const iteration, bool const proposed, bool const accepted) const |
Record a single Monte Carlo move. More... | |
void | record_new_pose (basic::Tracer &tr, Pose &pose) const |
Record when a low-scoring pose is recovered. More... | |
void | record_new_score_function (basic::Tracer &tr, Pose &pose) const |
Record when a score function term is ramped (and scores change as a result). More... | |
void | record_new_temperature (basic::Tracer &tr, Real temperature) const |
Record when the temperature is ramped. More... | |
void | record_endpoint (basic::Tracer &tr, Pose &pose) const |
Record the end of a protocol. More... | |
string | get_prefix () const |
Get the prefix that will be used for the scores associated with the pose at the end of the trajectory. More... | |
void | set_prefix (string) |
Set the prefix that will be used for the scores associated with the pose at the end of the trajectory. More... | |
Pose const & | get_native_pose () const |
Get the reference structure for RMSD calculations. More... | |
void | set_native_pose (Pose const &) |
Set the reference structure for RMSD calculations. More... | |
void | unset_native_pose () |
Disable RMSD calculations. More... | |
protocols::loops::LoopsCOP | get_loops () const |
Get the region of the protein where an backbone heavy-atom RMSD will be calculated for each step in the trajectory. More... | |
void | set_loops (protocols::loops::LoopsCOP) |
Set the region of the protein where an backbone heavy-atom RMSD will be calculated for each step in the trajectory. More... | |
core::scoring::ScoreFunctionCOP | get_score_function () const |
Get the score function used to score each step in the trajectory. More... | |
void | set_score_function (core::scoring::ScoreFunctionCOP) |
Set the score function used to score each step in the trajectory. More... | |
long | get_timer () const |
Return how long the trajectory has been running in seconds. More... | |
void | reset_timer () |
Indicate that the trajectory is starting now. More... | |
Private Member Functions | |
Real | calc_score (Pose &pose) const |
Return the score of the given pose. More... | |
Real | calc_rmsd_to_native (Pose &pose) const |
Return the heavy-atom backbone RMSD between the given pose and the -in:file:native pose within the given loops. More... | |
Private Attributes | |
string | prefix_ |
The prefix that will be used for the scores associated with the pose at the end of the trajectory. More... | |
Pose | native_pose_ |
The reference structure for RMSD calculations. More... | |
bool | have_native_pose_ = false |
Indicate that RMSDs can be calculated because there is a native pose. More... | |
protocols::loops::LoopsCOP | loops_ = nullptr |
The region of the protein where an backbone heavy-atom RMSD will be calculated for each step in the trajectory. More... | |
core::scoring::ScoreFunctionCOP | scorefxn_ = nullptr |
The score function used to score each step in the trajectory. More... | |
long | start_time_ = 0 |
The number of seconds since the epoch that had elapsed at the beginning of the trajectory. More... | |
Log a detailed account of everything that happens in a loop modeling simulation.
Basic usage is to initialize the logger either with one of the constructors or the init() method, then to call the record methods (e.g. record_move()) whenever something of note happens. The record method were written with LoopProtocol and LoopBuilder in mind, so you may have to add some of your own record methods if you want to use this logger with another LoopMover subclass.
protocols::loop_modeling::utilities::TrajectoryLogger::TrajectoryLogger | ( | string const & | prefix = "" | ) |
Construct an empty logger.
Use the init() method to give the setup the logger before any of the record methods are called.
References core::import_pose::PDB_file, and core::import_pose::pose_from_file().
protocols::loop_modeling::utilities::TrajectoryLogger::TrajectoryLogger | ( | LoopMover const * | mover, |
string const & | prefix = "" |
||
) |
Construct a logger from a loop mover.
The given loop mover must have both a loops and a score function at the time to constructor is called. If either condition is not met, an exception will be raised.
References init().
protocols::loop_modeling::utilities::TrajectoryLogger::TrajectoryLogger | ( | protocols::loops::LoopsCOP | loops, |
core::scoring::ScoreFunctionCOP | scorefxn, | ||
string const & | prefix = "" |
||
) |
Construct a logger from a score function and a loops object.
|
private |
Return the heavy-atom backbone RMSD between the given pose and the -in:file:native
pose within the given loops.
References have_native_pose_, core::scoring::is_protein_backbone(), loops_, native_pose_, core::scoring::rmsd_no_super_subset(), and core::pose::Pose::size().
Referenced by record_endpoint(), record_move(), and record_new_pose().
|
private |
Return the score of the given pose.
References scorefxn_.
Referenced by record_endpoint(), record_move(), record_new_pose(), and record_new_score_function().
LoopsCOP protocols::loop_modeling::utilities::TrajectoryLogger::get_loops | ( | void | ) | const |
Pose const & protocols::loop_modeling::utilities::TrajectoryLogger::get_native_pose | ( | ) | const |
string protocols::loop_modeling::utilities::TrajectoryLogger::get_prefix | ( | ) | const |
Get the prefix that will be used for the scores associated with the pose at the end of the trajectory.
References prefix_.
ScoreFunctionCOP protocols::loop_modeling::utilities::TrajectoryLogger::get_score_function | ( | ) | const |
Get the score function used to score each step in the trajectory.
References scorefxn_.
long protocols::loop_modeling::utilities::TrajectoryLogger::get_timer | ( | ) | const |
Return how long the trajectory has been running in seconds.
References start_time_.
Referenced by record_endpoint(), and record_move().
void protocols::loop_modeling::utilities::TrajectoryLogger::init | ( | LoopMover const * | mover | ) |
Initialize the logger from a loop mover after it has been constructed.
References protocols::loop_modeling::LoopMover::get_tool(), protocols::loop_modeling::ToolboxKeys::LOOPS, and protocols::loop_modeling::ToolboxKeys::SCOREFXN.
Referenced by TrajectoryLogger().
void protocols::loop_modeling::utilities::TrajectoryLogger::init | ( | protocols::loops::LoopsCOP | loops, |
core::scoring::ScoreFunctionCOP | scorefxn | ||
) |
Initialize the logger from a score function and a loops object after it has been constructed.
void protocols::loop_modeling::utilities::TrajectoryLogger::record_endpoint | ( | basic::Tracer & | tr, |
Pose & | pose | ||
) | const |
Record the end of a protocol.
Print out some more expensive quality metrics and attach some scores to the pose itself.
References calc_rmsd_to_native(), calc_score(), core::scoring::chainbreak, protocols::simple_filters::BuriedUnsatHbondFilter::compute(), core::pose::Pose::energies(), get_timer(), have_native_pose_, core::pose::Pose::is_fullatom(), native_pose_, prefix_, protocols::hybridization::score, protocols::simple_filters::BuriedUnsatHbondFilter::set_report_bb_heavy_atom_unsats(), protocols::simple_filters::BuriedUnsatHbondFilter::set_report_sc_heavy_atom_unsats(), core::pose::setPoseExtraScore(), core::scoring::Energies::total_energies(), and core::chemical::tr().
void protocols::loop_modeling::utilities::TrajectoryLogger::record_move | ( | basic::Tracer & | tr, |
Pose & | pose, | ||
core::Size const | i, | ||
core::Size const | j, | ||
core::Size const | k, | ||
bool const | proposed, | ||
bool const | accepted | ||
) | const |
Record a single Monte Carlo move.
This overload is meant for use in LoopProtocol, which uses three nested for-loops to ramp some score function terms and the temperature at different rates.
tr | The output stream to record the move to. |
pose | The pose on which the last move was made (used for calculating a score and an RMSD). |
i | The current "score function" cycle. |
j | The current "temperature" cycle. |
k | The current "mover" cycle. |
proposed | Whether or not a move was proposed (i.e. did the loop mover succeed in producing a new conformation). |
accepted | Whether or not the last move was accepted (i.e. did it pass the Metropolis criterion). |
References calc_rmsd_to_native(), calc_score(), get_timer(), have_native_pose_, and core::chemical::tr().
void protocols::loop_modeling::utilities::TrajectoryLogger::record_move | ( | basic::Tracer & | tr, |
Pose & | pose, | ||
core::Size const | iteration, | ||
bool const | proposed, | ||
bool const | accepted | ||
) | const |
Record a single Monte Carlo move.
This overload is meant for use in LoopBuilder, which generates loop conformation is a single non-nested for-loop.
tr | The output stream to record the move to. |
pose | The pose on which the last move was made (used for calculating a score and an RMSD). |
i | The current iteration. |
proposed | Whether or not a move was proposed (i.e. did the loop mover succeed in producing a new conformation). |
accepted | Whether or not the last move was accepted (i.e. did it pass the Metropolis criterion). |
References calc_rmsd_to_native(), calc_score(), get_timer(), have_native_pose_, and core::chemical::tr().
void protocols::loop_modeling::utilities::TrajectoryLogger::record_new_pose | ( | basic::Tracer & | tr, |
Pose & | pose | ||
) | const |
Record when a low-scoring pose is recovered.
References calc_rmsd_to_native(), calc_score(), have_native_pose_, and core::chemical::tr().
void protocols::loop_modeling::utilities::TrajectoryLogger::record_new_score_function | ( | basic::Tracer & | tr, |
Pose & | pose | ||
) | const |
Record when a score function term is ramped (and scores change as a result).
References calc_score(), core::scoring::chainbreak, core::scoring::fa_rep, core::scoring::rama, core::scoring::rama2b, scorefxn_, and core::chemical::tr().
void protocols::loop_modeling::utilities::TrajectoryLogger::record_new_temperature | ( | basic::Tracer & | tr, |
Real | temperature | ||
) | const |
Record when the temperature is ramped.
References core::chemical::tr().
void protocols::loop_modeling::utilities::TrajectoryLogger::reset_timer | ( | ) |
Indicate that the trajectory is starting now.
The timer is automatically started when the logger is constructed, you only need to call this method if the logger is constructed significantly before the trajectory in question begins.
References start_time_.
void protocols::loop_modeling::utilities::TrajectoryLogger::set_loops | ( | protocols::loops::LoopsCOP | ) |
void protocols::loop_modeling::utilities::TrajectoryLogger::set_native_pose | ( | Pose const & | pose | ) |
Set the reference structure for RMSD calculations.
References have_native_pose_, and native_pose_.
void protocols::loop_modeling::utilities::TrajectoryLogger::set_prefix | ( | string | prefix | ) |
Set the prefix that will be used for the scores associated with the pose at the end of the trajectory.
References prefix_.
void protocols::loop_modeling::utilities::TrajectoryLogger::set_score_function | ( | core::scoring::ScoreFunctionCOP | scorefxn | ) |
Set the score function used to score each step in the trajectory.
References scorefxn_.
void protocols::loop_modeling::utilities::TrajectoryLogger::unset_native_pose | ( | ) |
Disable RMSD calculations.
References have_native_pose_.
|
private |
Indicate that RMSDs can be calculated because there is a native pose.
Referenced by calc_rmsd_to_native(), record_endpoint(), record_move(), record_new_pose(), set_native_pose(), and unset_native_pose().
|
private |
The region of the protein where an backbone heavy-atom RMSD will be calculated for each step in the trajectory.
The RMSD is calculated relative to the -in:file:native
structure. If that option was not specified, no RMSD will be calculated.
Referenced by calc_rmsd_to_native(), get_loops(), and set_loops().
|
private |
The reference structure for RMSD calculations.
This structure is typically initialized from -in:file:native
in the constructor. Reading a pose in from a file is fairly expensive, and we want to calculate RMSDs after every iteration, so it's important that this initialization only happen once.
Referenced by calc_rmsd_to_native(), get_native_pose(), record_endpoint(), and set_native_pose().
|
private |
The prefix that will be used for the scores associated with the pose at the end of the trajectory.
Referenced by get_prefix(), record_endpoint(), and set_prefix().
|
private |
The score function used to score each step in the trajectory.
Referenced by calc_score(), get_score_function(), record_new_score_function(), and set_score_function().
|
private |
The number of seconds since the epoch that had elapsed at the beginning of the trajectory.
Referenced by get_timer(), and reset_timer().