Rosetta  2021.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Private Attributes | List of all members
protocols::frag_picker::scores::FragmentScoreManager Class Reference

holds particular score components, weights and calculates the total score for a fragment candidate More...

#include <FragmentScoreManager.hh>

Inheritance diagram for protocols::frag_picker::scores::FragmentScoreManager:
Inheritance graph
[legend]

Public Member Functions

 ~FragmentScoreManager () override
 Automatically generated virtual destructor for class deriving directly from VirtualBase. More...
 
 FragmentScoreManager ()
 creates an empty manager More...
 
FragmentScoreMapOP create_empty_map ()
 creates an empty score map More...
 
void add_scoring_method (FragmentScoringMethodOP, core::Real)
 registers a new scoring method in this manager More...
 
core::Size count_components ()
 says how many scoring methods have already been registered More...
 
FragmentScoringMethodOP get_component (core::Size index)
 Returns a desired scoring method. More...
 
utility::vector1< core::Realget_weights ()
 returns a vector of weights that are used to compute the total score More...
 
FragmentScoringMethodOP get_component_by_name (std::string score_name)
 Returns a desired scoring method from its name rather than index. More...
 
void show_scoring_methods (std::ostream &out)
 prints a nice table showing the registered scores More...
 
core::Real total_score (FragmentScoreMapOP)
 calculates the total score More...
 
virtual bool score_fragment_from_cache (FragmentCandidateOP, FragmentScoreMapOP)
 calculates all the small scores for a given fragment More...
 
virtual bool score_fragment (FragmentCandidateOP, FragmentScoreMapOP)
 calculates all the small scores for a given fragment More...
 
void use_late_scoring_for_zeros (const bool if_true)
 those score metohods that have weight = 0.0 will be computed after the fragments are picked More...
 
bool if_late_scoring_for_zeros ()
 says if late scoring is used or not More...
 
bool score_zero_scores (FragmentCandidateOP, FragmentScoreMapOP)
 calculates all these small scores for a given fragment whose weight is 0.0 More...
 
void register_score_maker (MakeFragmentScoringMethodOP)
 registers a maker object that will be used to create a scoring method object More...
 
void create_scoring_method (std::string const &, core::Size, core::Real, core::Real, bool, FragmentPickerOP, std::string)
 creates a new scoring method object More...
 
void create_scores (std::string const &, FragmentPickerOP)
 reads a config file and creates scoring methods More...
 
void do_caching (VallChunkOP chunk)
 calls do_caching() for each FragmentScoringMethod object, if it is possible More...
 
void clean_up ()
 calls clean_up() for each FragmentScoringMethod object, if it is possible More...
 
void set_width (FragmentScoringMethodOP which_score, core::Size width)
 sets up a new number of characters spend to print fragment score value More...
 
void set_precision (FragmentScoringMethodOP which_score, core::Size precision)
 sets up a new precision used to print fragment score value More...
 
virtual void describe_fragments (utility::vector1< std::pair< FragmentCandidateOP, scores::FragmentScoreMapOP > > const &, std::ostream &)
 prints a flat table with all scores for all the fragments in a given vector More...
 

Public Attributes

core::Size default_width_
 default width used to print a score value, equal to 6 More...
 
core::Size default_precision_
 default precision used to print a score value, equal to 1 More...
 

Static Public Attributes

static const core::Size TOTAL_PRECISION = 3
 precision used to display the total score for each fragment More...
 

Protected Attributes

utility::vector1
< FragmentScoringMethodOP
scores_
 
std::map
< FragmentScoringMethodOP,
core::Size
width_
 
std::map
< FragmentScoringMethodOP,
core::Size
precision_
 

Private Attributes

utility::vector1< core::Realscore_weights_
 
std::map< std::string,
MakeFragmentScoringMethodOP
registered_makers_
 
bool zeros_score_later_
 

Detailed Description

holds particular score components, weights and calculates the total score for a fragment candidate

a fragment picker object needs exactly one fragment manager to pick fragments. Adding new scoring methods is supposed to be done FragmentPicker, which calls proper method from this class.

Constructor & Destructor Documentation

protocols::frag_picker::scores::FragmentScoreManager::~FragmentScoreManager ( )
overridedefault

Automatically generated virtual destructor for class deriving directly from VirtualBase.

Auto-generated virtual destructor

protocols::frag_picker::scores::FragmentScoreManager::FragmentScoreManager ( )

creates an empty manager

References default_precision_, default_width_, register_score_maker(), and zeros_score_later_.

Member Function Documentation

void protocols::frag_picker::scores::FragmentScoreManager::add_scoring_method ( FragmentScoringMethodOP  scoring_term,
core::Real  weight 
)

registers a new scoring method in this manager

References default_precision_, default_width_, precision_, score_weights_, scores_, protocols::frag_picker::scores::sort_scores(), and width_.

Referenced by create_scoring_method().

void protocols::frag_picker::scores::FragmentScoreManager::clean_up ( )

calls clean_up() for each FragmentScoringMethod object, if it is possible

FragmentPicker calls this method when a given chunk has been processed

References protocols::frag_picker::scores::CachingScoringMethod::clean_up(), protocols::hybridization::score, and scores_.

core::Size protocols::frag_picker::scores::FragmentScoreManager::count_components ( )
inline

says how many scoring methods have already been registered

References scores_.

FragmentScoreMapOP protocols::frag_picker::scores::FragmentScoreManager::create_empty_map ( )

creates an empty score map

this is the recommended way to create FragmentScoreMap objects since FragmentScoreManager knows exactly what is the correct size of the map i.e. how many scoring terms have been registered.

References score_weights_.

void protocols::frag_picker::scores::FragmentScoreManager::create_scores ( std::string const &  file_name,
FragmentPickerOP  picker 
)

reads a config file and creates scoring methods

References create_scoring_method().

void protocols::frag_picker::scores::FragmentScoreManager::create_scoring_method ( std::string const &  score_name,
core::Size  priority,
core::Real  weight,
core::Real  lowest,
bool  use_lowest,
FragmentPickerOP  picker,
std::string  config_line 
)

creates a new scoring method object

References add_scoring_method(), and registered_makers_.

Referenced by create_scores().

void protocols::frag_picker::scores::FragmentScoreManager::describe_fragments ( utility::vector1< std::pair< FragmentCandidateOP, scores::FragmentScoreMapOP > > const &  pairs,
std::ostream &  out 
)
virtual
void protocols::frag_picker::scores::FragmentScoreManager::do_caching ( VallChunkOP  chunk)

calls do_caching() for each FragmentScoringMethod object, if it is possible

FragmentPicker calls this method when a new chunk is to be processed

References protocols::frag_picker::scores::CachingScoringMethod::do_caching(), protocols::hybridization::score, score_weights_, scores_, and zeros_score_later_.

FragmentScoringMethodOP protocols::frag_picker::scores::FragmentScoreManager::get_component ( core::Size  index)
inline

Returns a desired scoring method.

Allowed index values are [1,count_components()]

References scores_.

FragmentScoringMethodOP protocols::frag_picker::scores::FragmentScoreManager::get_component_by_name ( std::string  score_name)
inline

Returns a desired scoring method from its name rather than index.

Allowed inputs include the name of any scoring method as defined by get_score_name().

References core::conformation::membrane::out, and scores_.

utility::vector1<core::Real> protocols::frag_picker::scores::FragmentScoreManager::get_weights ( )
inline

returns a vector of weights that are used to compute the total score

References score_weights_.

bool protocols::frag_picker::scores::FragmentScoreManager::if_late_scoring_for_zeros ( )
inline

says if late scoring is used or not

late scoring means that some scores (those with weight=0, such as crmsd) are evaluated only for the selected fragments rather than for all the candidates

References zeros_score_later_.

void protocols::frag_picker::scores::FragmentScoreManager::register_score_maker ( MakeFragmentScoringMethodOP  scoring_term_maker)

registers a maker object that will be used to create a scoring method object

References registered_makers_.

Referenced by FragmentScoreManager().

bool protocols::frag_picker::scores::FragmentScoreManager::score_fragment ( FragmentCandidateOP  candidate,
FragmentScoreMapOP  empty_map 
)
virtual

calculates all the small scores for a given fragment

results are properly stored inside a FragmentScoreMap object

Reimplemented in protocols::frag_picker::scores::PValuedFragmentScoreManager.

References protocols::hybridization::score, score_weights_, scores_, and zeros_score_later_.

Referenced by protocols::frag_picker::scores::PValuedFragmentScoreManager::score_fragment().

bool protocols::frag_picker::scores::FragmentScoreManager::score_fragment_from_cache ( FragmentCandidateOP  candidate,
FragmentScoreMapOP  empty_map 
)
virtual

calculates all the small scores for a given fragment

results are properly stored inside a FragmentScoreMap object

Reimplemented in protocols::frag_picker::scores::PValuedFragmentScoreManager.

References protocols::hybridization::score, score_weights_, scores_, and zeros_score_later_.

Referenced by protocols::frag_picker::scores::PValuedFragmentScoreManager::score_fragment_from_cache().

bool protocols::frag_picker::scores::FragmentScoreManager::score_zero_scores ( FragmentCandidateOP  candidate,
FragmentScoreMapOP  empty_map 
)

calculates all these small scores for a given fragment whose weight is 0.0

When use_late_scoring_for_zeros() was used to set the flag to true, all fragment scoring methods neglects zero-weighted scores. These will be evaluated by this function, that may be called after fragments are picked. This way some time consuming computations (e.g. crmsd for fragments) may be computed only for the selected fragments rather than for all of them

References score_weights_, and scores_.

void protocols::frag_picker::scores::FragmentScoreManager::set_precision ( FragmentScoringMethodOP  which_score,
core::Size  precision 
)
inline

sets up a new precision used to print fragment score value

References core::io::raw_data::precision(), and precision_.

void protocols::frag_picker::scores::FragmentScoreManager::set_width ( FragmentScoringMethodOP  which_score,
core::Size  width 
)
inline

sets up a new number of characters spend to print fragment score value

References width_.

void protocols::frag_picker::scores::FragmentScoreManager::show_scoring_methods ( std::ostream &  out)

prints a nice table showing the registered scores

the table shows also the order in which the scores are evaluated

References score_weights_, and scores_.

core::Real protocols::frag_picker::scores::FragmentScoreManager::total_score ( FragmentScoreMapOP  f)
void protocols::frag_picker::scores::FragmentScoreManager::use_late_scoring_for_zeros ( const bool  if_true)
inline

those score metohods that have weight = 0.0 will be computed after the fragments are picked

if weight for a score is 0.0 than it does not affect the total score and thus has no effect on fragments sorting, quota, etc. Such scores may be computed after fragment picking is finished

References zeros_score_later_.

Member Data Documentation

core::Size protocols::frag_picker::scores::FragmentScoreManager::default_precision_

default precision used to print a score value, equal to 1

Referenced by add_scoring_method(), and FragmentScoreManager().

core::Size protocols::frag_picker::scores::FragmentScoreManager::default_width_

default width used to print a score value, equal to 6

Referenced by add_scoring_method(), and FragmentScoreManager().

std::map<FragmentScoringMethodOP, core::Size> protocols::frag_picker::scores::FragmentScoreManager::precision_
protected
std::map<std::string, MakeFragmentScoringMethodOP> protocols::frag_picker::scores::FragmentScoreManager::registered_makers_
private
utility::vector1<core::Real> protocols::frag_picker::scores::FragmentScoreManager::score_weights_
private
utility::vector1<FragmentScoringMethodOP> protocols::frag_picker::scores::FragmentScoreManager::scores_
protected
const core::Size protocols::frag_picker::scores::FragmentScoreManager::TOTAL_PRECISION = 3
static

precision used to display the total score for each fragment

Referenced by protocols::frag_picker::scores::PValuedFragmentScoreManager::describe_fragments(), and describe_fragments().

std::map<FragmentScoringMethodOP, core::Size> protocols::frag_picker::scores::FragmentScoreManager::width_
protected
bool protocols::frag_picker::scores::FragmentScoreManager::zeros_score_later_
private

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