Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
core::scoring::util_methods::DumpTrajectoryEnergy Class Reference

DumpTrajectoryEnergy, a util_method that allows one to dump rosetta trajectories through the use of the dump_trajectory ScoreType. More...

#include <DumpTrajectoryEnergy.hh>

Inheritance diagram for core::scoring::util_methods::DumpTrajectoryEnergy:
Inheritance graph
[legend]

Public Types

typedef
core::scoring::methods::WholeStructureEnergy 
parent1
 
typedef
core::scoring::annealing::ResidueArrayAnnealableEnergy 
parent2
 
- Public Types inherited from core::scoring::methods::WholeStructureEnergy
typedef EnergyMethod parent
 
- Public Types inherited from core::scoring::methods::EnergyMethod
typedef utility::VirtualBase parent
 

Public Member Functions

 DumpTrajectoryEnergy (core::scoring::methods::EnergyMethodOptions const &options)
 Options constructor. More...
 
 DumpTrajectoryEnergy (DumpTrajectoryEnergy const &src)
 Copy constructor. More...
 
 ~DumpTrajectoryEnergy () override
 Default destructor. More...
 
core::scoring::methods::EnergyMethodOP clone () const override
 Clone: create a copy of this object, and return an owning pointer to the copy. More...
 
void indicate_required_context_graphs (utility::vector1< bool > &context_graphs_required) const override
 DumpTrajectoryEnergy is context-independent and thus indicates that no context graphs need to be maintained by class Energies. More...
 
core::Size version () const override
 DumpTrajectoryEnergy is version 2 right now. More...
 
void setup_for_scoring (core::pose::Pose &pose, core::scoring::ScoreFunction const &sfxn) const override
 This is where the state_ moves to SCORING. More...
 
void finalize_total_energy (core::pose::Pose &pose, core::scoring::ScoreFunction const &sfxn, core::scoring::EnergyMap &total_energy) const override
 Dump out a pose whenever we evaluate the energy. More...
 
void setup_for_minimizing (pose::Pose &, ScoreFunction const &, kinematics::MinimizerMapBase const &) const override
 This is where the state_ moves to MINIMIZING. More...
 
void finalize_after_minimizing (core::pose::Pose &pose) const override
 Reset the state to IDLE. More...
 
void setup_for_derivatives (pose::Pose &pose, ScoreFunction const &sfxn) const override
 This is where the minimizer frames are dumped. More...
 
void set_up_residuearrayannealableenergy_for_packing (core::pose::Pose &pose, core::pack::rotamer_set::RotamerSets const &rotamersets, core::scoring::ScoreFunction const &sfxn) override
 This is where the state_ moves to PACKING. More...
 
void clean_up_residuearrayannealableenergy_after_packing (core::pose::Pose &pose) override
 Switch state back to IDLE. More...
 
core::Real calculate_energy (utility::vector1< core::conformation::ResidueCOP > const &resvect, utility::vector1< core::Size > const &rotamer_ids, core::Size const substitution_position=0) const override
 Should be possible to dump the packer from here. Not implemented yet though. More...
 
- Public Member Functions inherited from core::scoring::methods::WholeStructureEnergy
 WholeStructureEnergy (EnergyMethodCreatorOP)
 Constructor with EnergyMethodCreator to list the ScoreTypes computed by this WholeStructureEnergy. More...
 
 ~WholeStructureEnergy () override
 
EnergyMethodType method_type () const override
 Return one of the 7 kinds of energy methods that exist: e.g. context-dependent-one-body vs whole-structure. More...
 
virtual Distance atomic_interaction_cutoff () const
 how far apart must two heavy atoms be to have a zero interaction energy? More...
 
- Public Member Functions inherited from core::scoring::methods::EnergyMethod
 EnergyMethod (EnergyMethodCreatorOP creator)
 Constructor with EnergyMethodCreator, which lists the score types that this energy method is responsible for. More...
 
virtual void setup_for_packing (pose::Pose &, utility::vector1< bool > const &, utility::vector1< bool > const &) const
 if an energy method needs to cache data in the Energies object, before packing begins, then it does so during this function. The packer must ensure this function is called. The default behavior is to do nothing. More...
 
virtual void setup_for_packing_with_rotsets (pose::Pose &pose, pack_basic::RotamerSetsBaseOP const &rotsets, ScoreFunction const &sfxn) const
 if an energy method needs to cache data in the Energies object, before packing begins and requires access to the RotamerSets object, then it does so during this function. The default behavior is to do nothing. More...
 
virtual void prepare_rotamers_for_packing (pose::Pose const &, conformation::RotamerSetBase &) const
 If an energy method needs to cache data in a packing::RotamerSet object before rotamer energies are calculated, it does so during this function. The packer must ensure this function is called. The default behavior is to do nothing. More...
 
virtual void update_residue_for_packing (pose::Pose &, Size resid) const
 If the pose changes in the middle of a packing (as happens in rotamer trials) and if an energy method needs to cache data in the pose that corresponds to its current state, then the method must update that data when this function is called. The packer must ensure this function gets called. The default behavior is to do nothing. More...
 
virtual bool requires_a_setup_for_scoring_for_residue_opportunity_during_regular_scoring (pose::Pose const &pose) const
 Does this EnergyMethod require the opportunity to examine the residue before (regular) scoring begins? Not all energy methods would. The ScoreFunction will not ask energy methods to examine residues that are uninterested in doing so. The default implmentation of this function returns false. More...
 
virtual void setup_for_scoring_for_residue (conformation::Residue const &rsd, pose::Pose const &pose, ScoreFunction const &sfxn, basic::datacache::BasicDataCache &residue_data_cache) const
 Do any setup work before scoring, caching any slow-to-compute data that will be used during energy evaluation inside of the input Residue object's data cache. (The Residue on the whole is given as a constant reference, but non-constant access to its data cache is granted.) More...
 
virtual void finalize_after_derivatives (pose::Pose &, ScoreFunction const &) const
 called at the end of derivatives evaluation More...
 
virtual bool minimize_in_whole_structure_context (pose::Pose const &) const
 Should this EnergyMethod have score and derivative evaluation evaluated only in the context of the whole Pose, or can it be included in a decomposed manner for a residue or a set of residue-pairs that are not part of the Pose that's serving as their context? The default method implemented in the base class returns true in order to grandfather in EnergyMethods that have not had their derivatives changed to take advantage of the new derivative-evaluation machinery. Methods that return "true" will not have their residue-energy(-ext) / residue-pair-energy(-ext) methods invoked by the ScoreFunction during its traversal of the MinimizationGraph, and instead will be asked to perform all their work during finalize_total_energies(). Similarly, they will be expected to perform all their work during eval_atom_deriv() instead of during the ScoreFunction's traversal of the MinimizationGraph for derivative evaluation. IMPORTANT: Methods that return "true" cannot be included in RTMin. More...
 
virtual bool defines_high_order_terms (pose::Pose const &) const
 Should this EnergyMethod have score and derivative evaluation evaluated both in the context of the whole Pose and in the context of residue or residue-pairs? This covers scoring terms like env-smooth wherein the CBeta's get derivatives for increasing the neighbor counts for surrounding residues, and terms like constraints, which are definable on arbitrary number of residues (e.g. more than 2); both of these terms could be used in RTMin, and both should use the residue and residue-pair evaluation scheme with the MinimizationGraph for the majority of the work they do. (Now, high-order constraints (3-body or above) will not be properly evaluated within RTMin.). The default implementation returns "false". More...
 
virtual void eval_atom_derivative (id::AtomID const &id, pose::Pose const &pose, kinematics::DomainMap const &domain_map, ScoreFunction const &sfxn, EnergyMap const &emap, Vector &F1, Vector &F2) const
 Evaluate the XYZ derivative for an atom in the pose. Called during the atomtree derivative calculation, atom_tree_minimize.cc, through the ScoreFunction::eval_atom_derivative intermediary. F1 and F2 should not zeroed, rather, this class should accumulate its contribution from this atom's XYZ derivative. More...
 
ScoreTypes const & score_types () const
 Returns the score types that this energy method computes. More...
 
virtual void show_additional_info (std::ostream &, pose::Pose &, bool) const
 show additional information of the energy method More...
 
virtual bool energy_method_provides_citation_info () const
 Does this energy method provide information about how to cite it? More...
 
virtual utility::vector1
< basic::citation_manager::CitationCollectionCOP > 
provide_citation_info () const
 Provide the citation. More...
 
virtual bool energy_method_is_unpublished () const
 Does this energy method indicate that it is unpublished (and, by extension, that the author should be included in publications resulting from it)? More...
 
virtual utility::vector1
< basic::citation_manager::UnpublishedModuleInfoCOP > 
provide_authorship_info_for_unpublished () const
 Provide a list of authors and their e-mail addresses, as strings. More...
 
- Public Member Functions inherited from core::scoring::annealing::ResidueArrayAnnealableEnergy
 ResidueArrayAnnealableEnergy ()
 Constructor. More...
 
 ResidueArrayAnnealableEnergy (ResidueArrayAnnealableEnergy const &src)
 Copy constructor. More...
 
virtual ~ResidueArrayAnnealableEnergy ()
 Destructor. More...
 
virtual void commit_considered_substitution ()
 What to do when a substitution that was considered is accepted. More...
 

Private Types

enum  DumpState { IDLE, SCORING, MINIMIZING, PACKING }
 

Private Member Functions

void try_move_to_idle () const
 Ensure that the previous activity has finished before starting a new one. More...
 
void start_new_activity (DumpState new_state) const
 Perform initial setup related to an activity. More...
 
void dump_pose (core::pose::Pose const &pose, bool const force=false) const
 Write out a pose, if it's appropriate to do so. More...
 

Private Attributes

DumpState state_
 The activity we are currently dumping. More...
 
std::string dump_filename_
 The filename where frames are being dumped to. More...
 
Size dumped_frames_
 Number of dumped frames so far. More...
 
std::string dump_prefix_
 Prefix for dump files. More...
 
bool dump_as_gz_
 If true, output is g-zipped. More...
 
core::Size dump_on_every_nth_call_
 How many function calls must elapse before we dump a pose? More...
 
core::Size call_count_
 How many times has this function been called? More...
 

Additional Inherited Members

- Protected Member Functions inherited from core::scoring::methods::EnergyMethod
void set_score_types (EnergyMethodCreatorOP creator)
 Override the entirety of the score types list if they were initialized incorrectly in a parent's constructor. More...
 

Detailed Description

DumpTrajectoryEnergy, a util_method that allows one to dump rosetta trajectories through the use of the dump_trajectory ScoreType.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
IDLE 
SCORING 
MINIMIZING 
PACKING 

Constructor & Destructor Documentation

core::scoring::util_methods::DumpTrajectoryEnergy::DumpTrajectoryEnergy ( core::scoring::methods::EnergyMethodOptions const &  options)

Options constructor.

core::scoring::util_methods::DumpTrajectoryEnergy::DumpTrajectoryEnergy ( DumpTrajectoryEnergy const &  src)

Copy constructor.

Must move to IDLE before we duplicate.

References call_count_, dump_as_gz_, dump_filename_, dump_on_every_nth_call_, dump_prefix_, dumped_frames_, IDLE, state_, and try_move_to_idle().

core::scoring::util_methods::DumpTrajectoryEnergy::~DumpTrajectoryEnergy ( )
override

Default destructor.

Member Function Documentation

core::Real core::scoring::util_methods::DumpTrajectoryEnergy::calculate_energy ( utility::vector1< core::conformation::ResidueCOP > const &  resvect,
utility::vector1< core::Size > const &  rotamer_ids,
core::Size const  substitution_position = 0 
) const
overridevirtual
void core::scoring::util_methods::DumpTrajectoryEnergy::clean_up_residuearrayannealableenergy_after_packing ( core::pose::Pose pose)
overridevirtual
core::scoring::methods::EnergyMethodOP core::scoring::util_methods::DumpTrajectoryEnergy::clone ( ) const
overridevirtual

Clone: create a copy of this object, and return an owning pointer to the copy.

Implements core::scoring::methods::EnergyMethod.

void core::scoring::util_methods::DumpTrajectoryEnergy::dump_pose ( core::pose::Pose const &  pose,
bool const  force = false 
) const
private

Write out a pose, if it's appropriate to do so.

If force is true, the pose is always written out. If force is false (the default), then we check the call count and the stride, and only write if we're at the appropriate interval.

References core::io::pdb::add_to_multimodel_pdb(), call_count_, dump_filename_, dump_on_every_nth_call_, dumped_frames_, IDLE, and state_.

Referenced by calculate_energy(), clean_up_residuearrayannealableenergy_after_packing(), finalize_after_minimizing(), finalize_total_energy(), and setup_for_derivatives().

void core::scoring::util_methods::DumpTrajectoryEnergy::finalize_after_minimizing ( core::pose::Pose pose) const
overridevirtual

Reset the state to IDLE.

Reimplemented from core::scoring::methods::EnergyMethod.

References call_count_, dump_on_every_nth_call_, dump_pose(), IDLE, MINIMIZING, and state_.

void core::scoring::util_methods::DumpTrajectoryEnergy::finalize_total_energy ( core::pose::Pose pose,
core::scoring::ScoreFunction const &  sfxn,
core::scoring::EnergyMap total_energy 
) const
overridevirtual

Dump out a pose whenever we evaluate the energy.

Reimplemented from core::scoring::methods::EnergyMethod.

References dump_pose(), SCORING, and state_.

void core::scoring::util_methods::DumpTrajectoryEnergy::indicate_required_context_graphs ( utility::vector1< bool > &  context_graphs_required) const
overridevirtual

DumpTrajectoryEnergy is context-independent and thus indicates that no context graphs need to be maintained by class Energies.

Implements core::scoring::methods::EnergyMethod.

void core::scoring::util_methods::DumpTrajectoryEnergy::set_up_residuearrayannealableenergy_for_packing ( core::pose::Pose pose,
core::pack::rotamer_set::RotamerSets const &  rotamersets,
core::scoring::ScoreFunction const &  sfxn 
)
overridevirtual

This is where the state_ moves to PACKING.

Reimplemented from core::scoring::annealing::ResidueArrayAnnealableEnergy.

References PACKING, and start_new_activity().

void core::scoring::util_methods::DumpTrajectoryEnergy::setup_for_derivatives ( pose::Pose pose,
ScoreFunction const &  sfxn 
) const
overridevirtual

This is where the minimizer frames are dumped.

Assumption: All minimizers must evaluate derivatives repeatedly while minimizing. Although these won't be equally spaced, dumping them is the best we can do without modifying the minimizers.

Reimplemented from core::scoring::methods::EnergyMethod.

References dump_pose().

void core::scoring::util_methods::DumpTrajectoryEnergy::setup_for_minimizing ( pose::Pose ,
ScoreFunction const &  ,
kinematics::MinimizerMapBase const &   
) const
overridevirtual

This is where the state_ moves to MINIMIZING.

Reimplemented from core::scoring::methods::EnergyMethod.

References MINIMIZING, and start_new_activity().

void core::scoring::util_methods::DumpTrajectoryEnergy::setup_for_scoring ( core::pose::Pose pose,
core::scoring::ScoreFunction const &  sfxn 
) const
overridevirtual

This is where the state_ moves to SCORING.

Note that we leave the state set to SCORING, since we might score many times. There is no switch to IDLE in finalize_total_energy(), deliberately.

Reimplemented from core::scoring::methods::EnergyMethod.

References call_count_, IDLE, SCORING, start_new_activity(), and state_.

void core::scoring::util_methods::DumpTrajectoryEnergy::start_new_activity ( DumpState  new_state) const
private

Perform initial setup related to an activity.

This ensure the switch is valid based on the current state_.

References call_count_, dump_as_gz_, dump_filename_, dump_prefix_, dumped_frames_, protocols::abinitio::filename(), IDLE, MINIMIZING, PACKING, SCORING, state_, and try_move_to_idle().

Referenced by set_up_residuearrayannealableenergy_for_packing(), setup_for_minimizing(), and setup_for_scoring().

void core::scoring::util_methods::DumpTrajectoryEnergy::try_move_to_idle ( ) const
private

Ensure that the previous activity has finished before starting a new one.

This function is to be called when starting a new activity to catch invalid states. This throws an exception when an invalid state is detected.

References IDLE, MINIMIZING, PACKING, SCORING, and state_.

Referenced by DumpTrajectoryEnergy(), and start_new_activity().

core::Size core::scoring::util_methods::DumpTrajectoryEnergy::version ( ) const
overridevirtual

DumpTrajectoryEnergy is version 2 right now.

Implements core::scoring::methods::EnergyMethod.

Member Data Documentation

core::Size core::scoring::util_methods::DumpTrajectoryEnergy::call_count_
mutableprivate

How many times has this function been called?

Used to determine when we should dump a pose.

Referenced by calculate_energy(), clean_up_residuearrayannealableenergy_after_packing(), dump_pose(), DumpTrajectoryEnergy(), finalize_after_minimizing(), setup_for_scoring(), and start_new_activity().

bool core::scoring::util_methods::DumpTrajectoryEnergy::dump_as_gz_
private

If true, output is g-zipped.

Referenced by DumpTrajectoryEnergy(), and start_new_activity().

std::string core::scoring::util_methods::DumpTrajectoryEnergy::dump_filename_
mutableprivate

The filename where frames are being dumped to.

Referenced by dump_pose(), DumpTrajectoryEnergy(), and start_new_activity().

core::Size core::scoring::util_methods::DumpTrajectoryEnergy::dump_on_every_nth_call_
private

How many function calls must elapse before we dump a pose?

Defaults to 1. Higher settings allow sparser trajectory sampling.

Referenced by calculate_energy(), clean_up_residuearrayannealableenergy_after_packing(), dump_pose(), DumpTrajectoryEnergy(), and finalize_after_minimizing().

std::string core::scoring::util_methods::DumpTrajectoryEnergy::dump_prefix_
private

Prefix for dump files.

Referenced by DumpTrajectoryEnergy(), and start_new_activity().

Size core::scoring::util_methods::DumpTrajectoryEnergy::dumped_frames_
mutableprivate

Number of dumped frames so far.

This is used to give the models numbers in the pdb

Referenced by dump_pose(), DumpTrajectoryEnergy(), and start_new_activity().

DumpState core::scoring::util_methods::DumpTrajectoryEnergy::state_
mutableprivate

The activity we are currently dumping.

One may set this manually. But moves to new activities should be done through start_new_activity()

Referenced by clean_up_residuearrayannealableenergy_after_packing(), dump_pose(), DumpTrajectoryEnergy(), finalize_after_minimizing(), finalize_total_energy(), setup_for_scoring(), start_new_activity(), and try_move_to_idle().


The documentation for this class was generated from the following files: