Rosetta
|
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>
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... | |
![]() | |
Filter () | |
Filter (std::string 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 void | provide_citation_info (basic::citation_manager::CitationCollectionList &) const |
Provide citations to the passed CitationCollectionList Subclasses should add the info for themselves and any other classes they use. 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 | |
![]() | |
std::string | scorename_ |
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()
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 | ||
) |
References metric_, set_comparison_type(), and set_composite_action().
|
override |
|
overridevirtual |
returns true if the structure passes the filter, false otherwise
Implements protocols::filters::Filter.
References cache_prefix_, cache_suffix_, core::simple_metrics::CompositeRealMetric::cached_calculate(), core::simple_metrics::CompositeStringMetric::cached_calculate(), core::simple_metrics::RealMetric::cached_calculate(), core::simple_metrics::StringMetric::cached_calculate(), core::simple_metrics::PerResidueRealMetric::cached_calculate(), core::simple_metrics::PerResidueStringMetric::cached_calculate(), compare_composites(), compare_metric(), fail_on_missing_cache_, metric_, core::simple_metrics::metrics::sum, sum_per_residue_real_metric_, core::id::to_string(), protocols::simple_filters::TR(), and use_cache_.
|
static |
Referenced by protocols::simple_filters::SimpleMetricFilterCreator::keyname(), name(), and provide_xml_schema().
|
overridevirtual |
required in the context of the parser/scripting scheme
Implements protocols::filters::Filter.
|
private |
Takes std::map of std::string - value and returns a boolean if it passes the filter.
References compare_metric(), composite_action_, cutoff_, metric_, core::id::to_string(), and protocols::simple_filters::TR().
|
private |
Takes std::map of std::string - value and returns a boolean if it passes the filter.
References compare_metric(), composite_action_, cutoff_, metric_, and protocols::simple_filters::TR().
Referenced by apply().
|
private |
References protocols::simple_filters::bogus, cutoff_, epsilon_, protocols::simple_filters::eq, protocols::simple_filters::gt, protocols::simple_filters::gt_or_eq, protocols::simple_filters::lt, protocols::simple_filters::lt_or_eq, metric_, protocols::simple_filters::ne, protocols::simple_filters::TR(), and type_.
Referenced by apply(), and compare_composites().
|
private |
|
overridevirtual |
required in the context of the parser/scripting scheme
Implements protocols::filters::Filter.
|
overridevirtual |
Reimplemented from protocols::filters::Filter.
References class_name().
|
overridevirtual |
parse XML tag (to use this Filter in Rosetta Scripts)
Reimplemented from protocols::filters::Filter.
References epsilon_, fail_on_missing_cache_, core::simple_metrics::get_metric_from_datamap_and_subtags(), protocols::simple_filters::get_string_comparison_type_map(), set_comparison_type(), set_composite_action(), set_cutoff(), set_epsilon(), set_fail_on_missing_cache(), set_match_string(), set_simple_metric(), set_use_cached_data(), set_use_sum_for_per_residue_real(), and sum_per_residue_real_metric_.
|
static |
|
overridevirtual |
required for reporting score values
Reimplemented from protocols::filters::Filter.
References cache_prefix_, cache_suffix_, core::simple_metrics::RealMetric::cached_calculate(), fail_on_missing_cache_, metric_, protocols::simple_filters::TR(), and use_cache_.
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().
|
private |
Referenced by apply(), report_sm(), and set_use_cached_data().
|
private |
Referenced by apply(), report_sm(), and set_use_cached_data().
|
private |
Referenced by compare_composites(), and set_composite_action().
|
private |
Referenced by compare_composites(), compare_metric(), and set_cutoff().
|
private |
Referenced by compare_metric(), parse_my_tag(), and set_epsilon().
|
private |
Referenced by apply(), parse_my_tag(), report_sm(), and set_fail_on_missing_cache().
|
private |
Referenced by compare_metric(), and set_match_string().
|
private |
Referenced by apply(), compare_composites(), compare_metric(), report_sm(), set_simple_metric(), and SimpleMetricFilter().
|
private |
Referenced by apply(), parse_my_tag(), and set_use_sum_for_per_residue_real().
|
private |
Referenced by compare_metric(), and set_comparison_type().
|
private |
Referenced by apply(), report_sm(), and set_use_cached_data().