Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
core::simple_metrics::CompositeRealMetric Class Referenceabstract

A class that is derived to calculate a set of core::Real values. Apply(pose) method calculates this metric and adds it to the pose score for output. More...

#include <CompositeRealMetric.hh>

Inheritance diagram for core::simple_metrics::CompositeRealMetric:
Inheritance graph
[legend]

Public Member Functions

 CompositeRealMetric ()
 
 ~CompositeRealMetric () override
 
 CompositeRealMetric (CompositeRealMetric const &other)
 
void apply (pose::Pose &pose, std::string prefix="", std::string suffix="", bool override_existing_data=false) const override
 Calculate the metric and add it to the SimpleMetricData cache in the pose. labeled as prefix+metric+suffix. More...
 
virtual std::map< std::string,
core::Real
calculate (pose::Pose const &pose) const =0
 Calculate the metric. More...
 
std::map< std::string, core::Realcached_calculate (pose::Pose const &pose, bool use_cache, std::string prefix="", std::string suffix="", bool fail_on_missing_cache=true) const
 Grab the data from the pose if it exists or calculate the metric. More...
 
std::string name () const override=0
 Name of the class. More...
 
std::string metric () const override=0
 Name of the metric. More...
 
utility::vector1< std::string > get_metric_names () const override=0
 Get the submetric names that this Metric will calculate. More...
 
void parse_my_tag (utility::tag::TagCOP tag, basic::datacache::DataMap &data) override=0
 called by parse_my_tag – should not be used directly More...
 
SimpleMetricOP clone () const override=0
 
- Public Member Functions inherited from core::simple_metrics::SimpleMetric
 SimpleMetric (std::string const &simple_metric_type)
 
 ~SimpleMetric () override
 
 SimpleMetric (SimpleMetric const &other)
 
void set_custom_type (std::string const &custom_type)
 
std::string get_custom_type () const
 Additional setting to prefix/suffix. More...
 
virtual void parse_base_tag (utility::tag::TagCOP tag)
 Parse the base class tag. Keep required interface for parse_my_tag. More...
 
std::string simple_metric_type () const
 
std::string get_final_sm_type () const
 Get the final name of this metric including its simple_metric_type_ name and any set custom type. More...
 
virtual bool simple_metric_provides_citation_info () const
 Does this simple metric 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 simple_metric_is_unpublished () const
 Does this simple metric 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from core::simple_metrics::SimpleMetric
static
utility::tag::XMLSchemaComplexTypeGeneratorOP 
complex_type_generator_for_simple_metric (utility::tag::XMLSchemaDefinition &)
 

Detailed Description

A class that is derived to calculate a set of core::Real values. Apply(pose) method calculates this metric and adds it to the pose score for output.

Calculate(pose) method calculates core::Real values and returns them as a map<std::string, Real> Name:Value

Constructor & Destructor Documentation

core::simple_metrics::CompositeRealMetric::CompositeRealMetric ( )
core::simple_metrics::CompositeRealMetric::~CompositeRealMetric ( )
overridedefault
core::simple_metrics::CompositeRealMetric::CompositeRealMetric ( CompositeRealMetric const &  other)

Member Function Documentation

void core::simple_metrics::CompositeRealMetric::apply ( pose::Pose pose,
std::string  prefix = "",
std::string  suffix = "",
bool  override_existing_data = false 
) const
overridevirtual

Calculate the metric and add it to the SimpleMetricData cache in the pose. labeled as prefix+metric+suffix.

Data is output into the final score file, but can be accessed if needed through the cache.

Implements core::simple_metrics::SimpleMetric.

References calculate(), core::simple_metrics::SimpleMetric::get_final_sm_type(), core::simple_metrics::get_sm_data(), name(), and core::simple_metrics::throw_sm_override_error().

std::map< std::string, core::Real > core::simple_metrics::CompositeRealMetric::cached_calculate ( pose::Pose const &  pose,
bool  use_cache,
std::string  prefix = "",
std::string  suffix = "",
bool  fail_on_missing_cache = true 
) const

Grab the data from the pose if it exists or calculate the metric.

If use_cache is true, we will attempt to pull the data from the pose. If fail_on_missing_cache is true, we will fail, otherwise, we will calculate the metric.

This function is meant to support caching metrics, so values do not need to be calculated twice, for example in SimpleMetricFilter/Features or code-wise where data takes a while to calculate and can be reused.

References calculate(), core::simple_metrics::SimpleMetric::get_final_sm_type(), core::simple_metrics::get_sm_data(), core::simple_metrics::has_sm_data(), and name().

Referenced by protocols::simple_filters::SimpleMetricFilter::apply(), and protocols::features::SimpleMetricFeatures::report_general_features().

virtual std::map< std::string, core::Real > core::simple_metrics::CompositeRealMetric::calculate ( pose::Pose const &  pose) const
pure virtual

Calculate the metric.

Return by value as this function can not STORE the result, it only calculates. Store the result in the pose by using the apply method, which calls this method and stores the result in the pose as ExtraScoreValues.

Implemented in core::simple_metrics::TestCompositeRealMetric, core::simple_metrics::composite_metrics::ElectrostaticComplementarityMetric, and core::simple_metrics::composite_metrics::CompositeEnergyMetric.

Referenced by apply(), and cached_calculate().

SimpleMetricOP core::simple_metrics::CompositeRealMetric::clone ( ) const
overridepure virtual
utility::vector1< std::string > core::simple_metrics::CompositeRealMetric::get_metric_names ( ) const
overridepure virtual
std::string core::simple_metrics::CompositeRealMetric::metric ( ) const
overridepure virtual
std::string core::simple_metrics::CompositeRealMetric::name ( ) const
overridepure virtual
void core::simple_metrics::CompositeRealMetric::parse_my_tag ( utility::tag::TagCOP  tag,
basic::datacache::DataMap &  data 
)
overridepure virtual

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