![]() |
Rosetta
2021.16
|
A singleton class for managing relax scripts, to ensure that they are loaded once and only once from disk. More...
#include <RelaxScriptManager.hh>

Public Member Functions | |
| RelaxScriptFileContents const & | get_relax_script (std::string const &filename, core::scoring::ScoreFunctionCOP const &mover_sfxn, bool const dualspace) const |
| Get a relax script. Load it from disk if it has not already been loaded. More... | |
Private Member Functions | |
| RelaxScriptManager () | |
| Empty constructor. More... | |
| RelaxScriptManager (RelaxScriptManager const &)=delete | |
| Explicitly deleted copy constructor. More... | |
| RelaxScriptManager | operator= (RelaxScriptManager const &)=delete |
| Explicitly deleted assignment operator. More... | |
| RelaxScriptFileContentsOP | create_relax_script_instance (std::string const &script_file, std::string const &nearest_sfxn_name, bool const dualspace) const |
| Create an instance of a RelaxScriptFileContents object, by owning pointer. More... | |
| std::string | script_file_path (std::string const &script_file, std::string const &nearest_sfxn_name, bool const dualspace) const |
| Get the full script file path from the script name. More... | |
| std::string | get_nearest_sfxn_if_in_database (std::string const &script_file, core::scoring::ScoreFunctionCOP mover_sfxn) const |
| Get the database scorefunction that is closest to the current one, if the relax script is a database relax script that specifies a scorefunction. More... | |
| void | initialize_relax_scripts_in_database () const |
| Read the list of relax scripts from the database. More... | |
| std::string | determine_closest_scorefunction (core::scoring::ScoreFunction const &target, utility::vector1< std::string > const &names_of_candidates) const |
| Given a scorefunction and a list of candidate scorefunctions, determine the closest one. More... | |
Static Private Member Functions | |
| static void | handle_script_file_with_period (std::string const &script_file, std::string::size_type position_of_first_period) |
| Check whether (a) there is a period in the script file name, and, if so, (b) whether the base name exists in the database. If (a) is true, throw an error message, where the text depends on whether (b) is true. More... | |
| static core::Real | sfxn_distance_squared (core::scoring::EnergyMap const &target_weights, core::scoring::EnergyMap const &candidate_weights) |
| Get the difference between two EnergyMaps. More... | |
| static EnergyMapContainerCOP | create_energy_map_instance (std::string const &filename) |
| Create an instance of an EnergyMapContainer. Needed for threadsafe lazy loading. More... | |
Private Attributes | |
| std::map< std::tuple < std::string, std::string, bool > , RelaxScriptFileContentsOP > | filename_to_filecontents_map_ |
| A map of filename to file contents. More... | |
| utility::vector1 < DatabaseRelaxScript > | relax_scripts_in_database_ |
| cached data from database/sampling/relax_scripts/index.dat More... | |
| std::map< std::string, EnergyMapContainerCOP > | energy_maps_map_ |
Friends | |
| class | utility::SingletonBase< RelaxScriptManager > |
A singleton class for managing relax scripts, to ensure that they are loaded once and only once from disk.
|
private |
Empty constructor.
|
privatedelete |
Explicitly deleted copy constructor.
|
staticprivate |
Create an instance of an EnergyMapContainer. Needed for threadsafe lazy loading.
Peforms onetime read from disk.
Referenced by determine_closest_scorefunction().
|
private |
Create an instance of a RelaxScriptFileContents object, by owning pointer.
Needed for threadsafe creation. Loads data from disk. NOT for repeated calls!
References script_file_path(), and protocols::relax::TR().
Referenced by get_relax_script().
|
private |
Given a scorefunction and a list of candidate scorefunctions, determine the closest one.
Performs onetime read from disk.
References create_energy_map_instance(), energy_maps_map_, protocols::hybridization::score, sfxn_distance_squared(), protocols::relax::TR(), and core::scoring::ScoreFunction::weights().
Referenced by get_nearest_sfxn_if_in_database().
|
private |
Get the database scorefunction that is closest to the current one, if the relax script is a database relax script that specifies a scorefunction.
Performs onetime read from disk.
References determine_closest_scorefunction(), core::scoring::get_score_function(), and relax_scripts_in_database_.
Referenced by get_relax_script().
| RelaxScriptFileContents const & protocols::relax::RelaxScriptManager::get_relax_script | ( | std::string const & | filename, |
| core::scoring::ScoreFunctionCOP const & | mover_sfxn, | ||
| bool const | dualspace | ||
| ) | const |
Get a relax script. Load it from disk if it has not already been loaded.
Threadsafe and lazily loaded. Requires the FastRelax or FastDesign mover's scorefunction to be provided.
References create_relax_script_instance(), filename_to_filecontents_map_, get_nearest_sfxn_if_in_database(), core::scoring::get_score_function(), and initialize_relax_scripts_in_database().
|
staticprivate |
Check whether (a) there is a period in the script file name, and, if so, (b) whether the base name exists in the database. If (a) is true, throw an error message, where the text depends on whether (b) is true.
PERFORMS DISK READ.
Referenced by script_file_path().
|
private |
Read the list of relax scripts from the database.
Performs onetime read from disk.
PEFRORMS DISK READ.
References protocols::abinitio::filename(), relax_scripts_in_database_, and protocols::relax::TR().
Referenced by get_relax_script().
|
privatedelete |
Explicitly deleted assignment operator.
|
private |
Get the full script file path from the script name.
PEFRORMS DISK READ.
References protocols::pack_daemon::error_message, handle_script_file_with_period(), and protocols::relax::TR().
Referenced by create_relax_script_instance().
|
staticprivate |
Get the difference between two EnergyMaps.
References core::scoring::fa_atr, and core::scoring::n_score_types.
Referenced by determine_closest_scorefunction().
|
friend |
|
mutableprivate |
Referenced by determine_closest_scorefunction().
|
mutableprivate |
A map of filename to file contents.
Referenced by get_relax_script().
|
mutableprivate |
cached data from database/sampling/relax_scripts/index.dat
Referenced by get_nearest_sfxn_if_in_database(), and initialize_relax_scripts_in_database().
1.8.7