Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
protocols::simple_filters::SimpleMetricFilter Class Reference

A filter takes any SimpleMetric and applies a set cutoff to filter the model. Set the cutoff type to set the behavior of the metric. More...

#include <SimpleMetricFilter.hh>

Inheritance diagram for protocols::simple_filters::SimpleMetricFilter:
Inheritance graph
[legend]

Public Member Functions

 SimpleMetricFilter ()
 
 SimpleMetricFilter (core::simple_metrics::SimpleMetricCOP metric, comparison_type co_type)
 
 SimpleMetricFilter (core::simple_metrics::SimpleMetricCOP metric, comparison_type co_type, std::string composite_action)
 
 ~SimpleMetricFilter () override
 
bool apply (core::pose::Pose const &pose) const override
 returns true if the structure passes the filter, false otherwise More...
 
core::Real report_sm (core::pose::Pose const &pose) const override
 required for reporting score values More...
 
void set_simple_metric (core::simple_metrics::SimpleMetricCOP metric)
 Set the SimpleMetric that we will be using to filter. More...
 
void set_use_cached_data (bool use_cache, std::string prefix="", std::string suffix="")
 Set a boolean to attempt to find cached data matching the name/custom_type of the passed in simple_metric. Optionally pass any set prefix/suffix. More...
 
void set_fail_on_missing_cache (bool fail)
 If use_cache is set to false, do we fail if no data is found in the pose? Default True. More...
 
void set_cutoff (core::Real cutoff)
 Set the cutoff value for any RealMetric or CompositeRealMetric. More...
 
void set_match_string (std::string const &match_string)
 Set the match value for any StringMetric or CompositeStringMetric. More...
 
void set_comparison_type (comparison_type co_type)
 Sets the cutoff type - aka eq, ne, etc. Options are: eq, ne, lt, gt, lt_or_eq, gt_or_eq. More...
 
void set_composite_action (std::string const &composite_action)
 Set the action we take for a set CompositeMetric. More...
 
void set_use_sum_for_per_residue_real (bool use_sum_for_per_residue_real)
 Set the filter to use the SUM of values from a PerResidueRealMetric for filtering. This is instead of using the metric as a Composite Metric for each resnum. Default False. More...
 
void set_epsilon (core::Real epsilon)
 Set the sigfigs we will use in our comparisons. Default is .0001;. More...
 
std::string name () const override
 
void parse_my_tag (utility::tag::TagCOP tag, basic::datacache::DataMap &data) override
 parse XML tag (to use this Filter in Rosetta Scripts) More...
 
protocols::filters::FilterOP fresh_instance () const override
 required in the context of the parser/scripting scheme More...
 
protocols::filters::FilterOP clone () const override
 required in the context of the parser/scripting scheme More...
 
- Public Member Functions inherited from protocols::filters::Filter
 Filter ()
 
 Filter (std::string const &)
 
 Filter (Filter const &)
 
 ~Filter () override
 
virtual void report (std::ostream &, core::pose::Pose const &) const
 
virtual std::string get_type () const
 
std::string get_user_defined_name () const
 
void set_user_defined_name (std::string const &name)
 
virtual void clear ()
 used to clear internal variables if needed. Using fresh_instance is preferred since it's a pure virtual More...
 
virtual core::Real score (core::pose::Pose &pose)
 
virtual bool filter_provides_citation_info () const
 Does this filter 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 filter_is_unpublished () const
 Does this filter 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...
 

Static Public Member Functions

static std::string class_name ()
 
static void provide_xml_schema (utility::tag::XMLSchemaDefinition &xsd)
 

Private Member Functions

template<class T >
bool compare_composites (std::map< std::string, T > const &values) const
 Takes std::map of std::string - value and returns a boolean if it passes the filter. More...
 
template<class T >
bool compare_composites (std::map< core::Size, T > const &values) const
 Takes std::map of std::string - value and returns a boolean if it passes the filter. More...
 
bool compare_metric (core::Real value) const
 
bool compare_metric (std::string const &value) const
 

Private Attributes

core::simple_metrics::SimpleMetricCOP metric_ = nullptr
 
comparison_type type_ = bogus
 
core::Real cutoff_ = 0
 
std::string match_ = ""
 
core::Real epsilon_ = .0001
 
std::string composite_action_ = ""
 
bool sum_per_residue_real_metric_ = false
 
bool use_cache_ = false
 
std::string cache_prefix_ = ""
 
std::string cache_suffix_ = ""
 
bool fail_on_missing_cache_ = true
 

Additional Inherited Members

- Protected Attributes inherited from protocols::filters::Filter
std::string scorename_
 

Detailed Description

A filter takes any SimpleMetric and applies a set cutoff to filter the model. Set the cutoff type to set the behavior of the metric.

Compares metric_value to cutoff_value or match_value

match_value is used for strings, cutoff is used for numbers.

So, if comparison_type is set to eq, if metric_value eq the cutoff_value we return true.

RMSD example: set to lt, and the filter will pass with a metric value anything less than the cuttoff.

CompositeMetrics take an extra parameter, composite_action. Composite action can be "any", "all", or any specific composite metric value you want to match on.

Any: If any match the set criteria, we return true All: If all match the set criteria, we return true etc: If the particular metric of the composite metric (ex fa_rep for the CompositeEnergyMetric), matches the criteria, we return true.

See Methods: set_comparison_type(), set_composite_action(), set_cutoff_value(), set_match_string()

Constructor & Destructor Documentation

protocols::simple_filters::SimpleMetricFilter::SimpleMetricFilter ( )
protocols::simple_filters::SimpleMetricFilter::SimpleMetricFilter ( core::simple_metrics::SimpleMetricCOP  metric,
comparison_type  co_type 
)

References metric_, and set_comparison_type().

protocols::simple_filters::SimpleMetricFilter::SimpleMetricFilter ( core::simple_metrics::SimpleMetricCOP  metric,
comparison_type  co_type,
std::string  composite_action 
)
protocols::simple_filters::SimpleMetricFilter::~SimpleMetricFilter ( )
override

Member Function Documentation

bool protocols::simple_filters::SimpleMetricFilter::apply ( core::pose::Pose const &  pose) const
overridevirtual
std::string protocols::simple_filters::SimpleMetricFilter::class_name ( )
static
protocols::filters::FilterOP protocols::simple_filters::SimpleMetricFilter::clone ( ) const
overridevirtual

required in the context of the parser/scripting scheme

Implements protocols::filters::Filter.

template<class T >
bool protocols::simple_filters::SimpleMetricFilter::compare_composites ( std::map< std::string, T > const &  values) const
private

Takes std::map of std::string - value and returns a boolean if it passes the filter.

References compare_metric(), composite_action_, cutoff_, and protocols::simple_filters::TR().

Referenced by apply().

template<class T >
bool protocols::simple_filters::SimpleMetricFilter::compare_composites ( std::map< core::Size, T > const &  values) const
private

Takes std::map of std::string - value and returns a boolean if it passes the filter.

References compare_metric(), composite_action_, cutoff_, core::id::to_string(), and protocols::simple_filters::TR().

bool protocols::simple_filters::SimpleMetricFilter::compare_metric ( core::Real  value) const
private
bool protocols::simple_filters::SimpleMetricFilter::compare_metric ( std::string const &  value) const
private
protocols::filters::FilterOP protocols::simple_filters::SimpleMetricFilter::fresh_instance ( ) const
overridevirtual

required in the context of the parser/scripting scheme

Implements protocols::filters::Filter.

std::string protocols::simple_filters::SimpleMetricFilter::name ( ) const
overridevirtual

Reimplemented from protocols::filters::Filter.

References class_name().

void protocols::simple_filters::SimpleMetricFilter::parse_my_tag ( utility::tag::TagCOP  tag,
basic::datacache::DataMap &  data 
)
overridevirtual
void protocols::simple_filters::SimpleMetricFilter::provide_xml_schema ( utility::tag::XMLSchemaDefinition &  xsd)
static
core::Real protocols::simple_filters::SimpleMetricFilter::report_sm ( core::pose::Pose const &  pose) const
overridevirtual
void protocols::simple_filters::SimpleMetricFilter::set_comparison_type ( comparison_type  co_type)

Sets the cutoff type - aka eq, ne, etc. Options are: eq, ne, lt, gt, lt_or_eq, gt_or_eq.

If this is a StringMetric, only eq and ne are relevant here. IF value [comparison_type] cutoff_ return True.

References type_.

Referenced by parse_my_tag(), and SimpleMetricFilter().

void protocols::simple_filters::SimpleMetricFilter::set_composite_action ( std::string const &  composite_action)

Set the action we take for a set CompositeMetric.

Composite action can be "any", "all", or any specific composite metric value you want to match on. See Also: set_comparison_type(), set_cutoff

Any: If any match the set criteria, we return true All: If all match the set criteria, we return true etc: If the particular metric of the composite metric (ex fa_rep for the CompositeEnergyMetric), matches the criteria, we return true.

References composite_action_.

Referenced by parse_my_tag(), and SimpleMetricFilter().

void protocols::simple_filters::SimpleMetricFilter::set_cutoff ( core::Real  cutoff)

Set the cutoff value for any RealMetric or CompositeRealMetric.

Set the cutoff value.

References cutoff_.

Referenced by parse_my_tag().

void protocols::simple_filters::SimpleMetricFilter::set_epsilon ( core::Real  epsilon)

Set the sigfigs we will use in our comparisons. Default is .0001;.

Set the sigfigs we will use in our comparisons. Default is .0001.

References epsilon_.

Referenced by parse_my_tag().

void protocols::simple_filters::SimpleMetricFilter::set_fail_on_missing_cache ( bool  fail)

If use_cache is set to false, do we fail if no data is found in the pose? Default True.

References fail_on_missing_cache_.

Referenced by parse_my_tag().

void protocols::simple_filters::SimpleMetricFilter::set_match_string ( std::string const &  match_string)

Set the match value for any StringMetric or CompositeStringMetric.

References match_.

Referenced by parse_my_tag().

void protocols::simple_filters::SimpleMetricFilter::set_simple_metric ( core::simple_metrics::SimpleMetricCOP  metric)

Set the SimpleMetric that we will be using to filter.

Set the SimpleMetric (RealMetric) that we will be using to filter.

References metric_.

Referenced by parse_my_tag().

void protocols::simple_filters::SimpleMetricFilter::set_use_cached_data ( bool  use_cache,
std::string  prefix = "",
std::string  suffix = "" 
)

Set a boolean to attempt to find cached data matching the name/custom_type of the passed in simple_metric. Optionally pass any set prefix/suffix.

This will allow the filter to re-use previously calculated data.

References cache_prefix_, cache_suffix_, protocols::simple_filters::TR(), and use_cache_.

Referenced by parse_my_tag().

void protocols::simple_filters::SimpleMetricFilter::set_use_sum_for_per_residue_real ( bool  use_sum_for_per_residue_real)

Set the filter to use the SUM of values from a PerResidueRealMetric for filtering. This is instead of using the metric as a Composite Metric for each resnum. Default False.

References sum_per_residue_real_metric_.

Referenced by parse_my_tag().

Member Data Documentation

std::string protocols::simple_filters::SimpleMetricFilter::cache_prefix_ = ""
private
std::string protocols::simple_filters::SimpleMetricFilter::cache_suffix_ = ""
private
std::string protocols::simple_filters::SimpleMetricFilter::composite_action_ = ""
private
core::Real protocols::simple_filters::SimpleMetricFilter::cutoff_ = 0
private
core::Real protocols::simple_filters::SimpleMetricFilter::epsilon_ = .0001
private
bool protocols::simple_filters::SimpleMetricFilter::fail_on_missing_cache_ = true
private
std::string protocols::simple_filters::SimpleMetricFilter::match_ = ""
private

Referenced by compare_metric(), and set_match_string().

core::simple_metrics::SimpleMetricCOP protocols::simple_filters::SimpleMetricFilter::metric_ = nullptr
private
bool protocols::simple_filters::SimpleMetricFilter::sum_per_residue_real_metric_ = false
private
comparison_type protocols::simple_filters::SimpleMetricFilter::type_ = bogus
private
bool protocols::simple_filters::SimpleMetricFilter::use_cache_ = false
private

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