simple_metrics¶
- class pyrosetta.bindings.scores.simple_metrics.SimpleMetricCompositeRealDataAccessor(pose)¶
Bases:
SimpleMetricDataAccessorBase
Accessor wrapper for pose SimpleMetric composite real data.
- _CustomTypeMetric¶
alias of
CustomTypeMetric
- _abc_impl = <_abc._abc_data object>¶
- _clobber_warning(msg)¶
Issue a ClobberWarning warning with a message.
- _custom_type_metrics = {'bool': CustomTypeMetric(type=<class 'bool'>, prefix='[CustomBooleanValueMetric]', encode_func=<class 'str'>, decode_func=<function PoseScoreSerializerBase.bool_from_str>), 'bytes': CustomTypeMetric(type=<class 'bytes'>, prefix='[CustomBinaryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64>, decode_func=<function PoseScoreSerializerBase.from_base64>), 'int': CustomTypeMetric(type=<class 'int'>, prefix='[CustomDiscreteValueMetric]', encode_func=<class 'str'>, decode_func=<class 'int'>), 'object': CustomTypeMetric(type=<class 'object'>, prefix='[CustomArbitraryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64_pickle>, decode_func=<function PoseScoreSerializerBase.from_base64_pickle>)}¶
- _format_metric(raw_data, as_dict=False)¶
- _get_sm_data_dict(attributes)¶
- _has_reserved_custom_metric_keys()¶
- _maybe_delete_keys_from_sm_data(keys=None, attributes=None)¶
Cache, clear, and restore all SimpleMetric data except the provided keys in the provided SimpleMetricDataAccessor attributes. This is necessary to delete one or more keys, since clear_sm_data clears all SimpleMetric data.
- _maybe_delete_reserved_keys_from_sm_data()¶
CustomRealValueMetric and CustomStringValueMetric can save the extra default keys “custom_real_valued_metric” or “custom_string_valued_metric” because pose.cache.metrics does not set a ‘custom_type’ parameter when setting SimpleMetric data. This method aims to delete these extra default keys if they were created and we can delete them.
- _repr_pretty_(p, cycle)¶
IPython-display representation.
- property _reserved¶
Reserved scoretype keys that cannot be set or deleted.
- property _reserved_custom_metric_keys¶
Reserved scoretype keys for SimpleMetrics that cannot be set or deleted.
- _reserved_custom_metric_keys_warning()¶
Warn that reserved custom metric keys were added to the data cache.
- _reserved_types = (<class 'str'>, <class 'float'>)¶
- property _sm_data_accessor_attrs¶
Supported SimpleMetricDataAccessor attributes to reset after clear_sm_data.
- property _unsupported_sm_data_accessor_attrs¶
Unsupported SimpleMetricDataAccessor attributes that cannot be reset after clear_sm_data.
- _validate_del(key)¶
Validate that a key can be deleted.
- _validate_set(key)¶
Validate that a key can be set.
- property all¶
- apply(metric, key, value)¶
Apply a SimpleMetric with a key/value pair to the pose.
- static bool_from_str(value)¶
- clear() None. Remove all items from D. ¶
- format_composite_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_composite_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- format_per_residue_probabilities(raw_data)¶
Format per-residue probabilities metrics as nested dictionaries.
The default output format from ScoreMap.add_arbitrary_string_data_from_pose sets values as str objects:
{‘my_metric_1’: ‘ALA:0.0125,ASN:0.000000,…’, ‘my_metric_2’: …}`
Here, we reformat the values into separate dict objects where keys are str objects and values are float objects:
{‘my_metric_1’: {‘ALA’: 0.0125, ‘ASN’: 0.0, …}, ‘my_metric_2’: …}
- format_per_residue_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_per_residue_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- static from_base64(value)¶
- static from_base64_pickle(value)¶
- static from_pickle(value)¶
- get(k[, d]) D[k] if k in D, else d. d defaults to None. ¶
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- static maybe_decode(value)¶
Deserialize the input value if it’s serialized.
- static maybe_encode(value)¶
Serialize the input value into a str object if it’s not a str or float object.
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair ¶
as a 2-tuple; but raise KeyError if D is empty.
- pose¶
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D ¶
- static to_base64(value)¶
- static to_base64_pickle(value)¶
- static to_pickle(value)¶
- update([E, ]**F) None. Update D from mapping/iterable E and F. ¶
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values ¶
- class pyrosetta.bindings.scores.simple_metrics.SimpleMetricCompositeStringDataAccessor(pose)¶
Bases:
SimpleMetricDataAccessorBase
Accessor wrapper for pose SimpleMetric composite string data.
- _CustomTypeMetric¶
alias of
CustomTypeMetric
- _abc_impl = <_abc._abc_data object>¶
- _clobber_warning(msg)¶
Issue a ClobberWarning warning with a message.
- _custom_type_metrics = {'bool': CustomTypeMetric(type=<class 'bool'>, prefix='[CustomBooleanValueMetric]', encode_func=<class 'str'>, decode_func=<function PoseScoreSerializerBase.bool_from_str>), 'bytes': CustomTypeMetric(type=<class 'bytes'>, prefix='[CustomBinaryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64>, decode_func=<function PoseScoreSerializerBase.from_base64>), 'int': CustomTypeMetric(type=<class 'int'>, prefix='[CustomDiscreteValueMetric]', encode_func=<class 'str'>, decode_func=<class 'int'>), 'object': CustomTypeMetric(type=<class 'object'>, prefix='[CustomArbitraryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64_pickle>, decode_func=<function PoseScoreSerializerBase.from_base64_pickle>)}¶
- _format_metric(raw_data, as_dict=False)¶
- _get_sm_data_dict(attributes)¶
- _has_reserved_custom_metric_keys()¶
- _maybe_delete_keys_from_sm_data(keys=None, attributes=None)¶
Cache, clear, and restore all SimpleMetric data except the provided keys in the provided SimpleMetricDataAccessor attributes. This is necessary to delete one or more keys, since clear_sm_data clears all SimpleMetric data.
- _maybe_delete_reserved_keys_from_sm_data()¶
CustomRealValueMetric and CustomStringValueMetric can save the extra default keys “custom_real_valued_metric” or “custom_string_valued_metric” because pose.cache.metrics does not set a ‘custom_type’ parameter when setting SimpleMetric data. This method aims to delete these extra default keys if they were created and we can delete them.
- _repr_pretty_(p, cycle)¶
IPython-display representation.
- property _reserved¶
Reserved scoretype keys that cannot be set or deleted.
- property _reserved_custom_metric_keys¶
Reserved scoretype keys for SimpleMetrics that cannot be set or deleted.
- _reserved_custom_metric_keys_warning()¶
Warn that reserved custom metric keys were added to the data cache.
- _reserved_types = (<class 'str'>, <class 'float'>)¶
- property _sm_data_accessor_attrs¶
Supported SimpleMetricDataAccessor attributes to reset after clear_sm_data.
- property _unsupported_sm_data_accessor_attrs¶
Unsupported SimpleMetricDataAccessor attributes that cannot be reset after clear_sm_data.
- _validate_del(key)¶
Validate that a key can be deleted.
- _validate_set(key)¶
Validate that a key can be set.
- property all¶
- apply(metric, key, value)¶
Apply a SimpleMetric with a key/value pair to the pose.
- static bool_from_str(value)¶
- clear() None. Remove all items from D. ¶
- format_composite_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_composite_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- format_per_residue_probabilities(raw_data)¶
Format per-residue probabilities metrics as nested dictionaries.
The default output format from ScoreMap.add_arbitrary_string_data_from_pose sets values as str objects:
{‘my_metric_1’: ‘ALA:0.0125,ASN:0.000000,…’, ‘my_metric_2’: …}`
Here, we reformat the values into separate dict objects where keys are str objects and values are float objects:
{‘my_metric_1’: {‘ALA’: 0.0125, ‘ASN’: 0.0, …}, ‘my_metric_2’: …}
- format_per_residue_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_per_residue_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- static from_base64(value)¶
- static from_base64_pickle(value)¶
- static from_pickle(value)¶
- get(k[, d]) D[k] if k in D, else d. d defaults to None. ¶
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- static maybe_decode(value)¶
Deserialize the input value if it’s serialized.
- static maybe_encode(value)¶
Serialize the input value into a str object if it’s not a str or float object.
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair ¶
as a 2-tuple; but raise KeyError if D is empty.
- pose¶
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D ¶
- static to_base64(value)¶
- static to_base64_pickle(value)¶
- static to_pickle(value)¶
- update([E, ]**F) None. Update D from mapping/iterable E and F. ¶
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values ¶
- class pyrosetta.bindings.scores.simple_metrics.SimpleMetricDataAccessor(pose)¶
Bases:
SimpleMetricDataAccessorBase
Accessor wrapper for pose SimpleMetric data.
- _CustomTypeMetric¶
alias of
CustomTypeMetric
- _abc_impl = <_abc._abc_data object>¶
- _clobber_warning(msg)¶
Issue a ClobberWarning warning with a message.
- _custom_type_metrics = {'bool': CustomTypeMetric(type=<class 'bool'>, prefix='[CustomBooleanValueMetric]', encode_func=<class 'str'>, decode_func=<function PoseScoreSerializerBase.bool_from_str>), 'bytes': CustomTypeMetric(type=<class 'bytes'>, prefix='[CustomBinaryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64>, decode_func=<function PoseScoreSerializerBase.from_base64>), 'int': CustomTypeMetric(type=<class 'int'>, prefix='[CustomDiscreteValueMetric]', encode_func=<class 'str'>, decode_func=<class 'int'>), 'object': CustomTypeMetric(type=<class 'object'>, prefix='[CustomArbitraryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64_pickle>, decode_func=<function PoseScoreSerializerBase.from_base64_pickle>)}¶
- _format_metric(raw_data, as_dict=False)¶
- _get_sm_data_dict(attributes)¶
- _has_reserved_custom_metric_keys()¶
- _maybe_delete_keys_from_sm_data(keys=None, attributes=None)¶
Cache, clear, and restore all SimpleMetric data except the provided keys in the provided SimpleMetricDataAccessor attributes. This is necessary to delete one or more keys, since clear_sm_data clears all SimpleMetric data.
- _maybe_delete_reserved_keys_from_sm_data()¶
CustomRealValueMetric and CustomStringValueMetric can save the extra default keys “custom_real_valued_metric” or “custom_string_valued_metric” because pose.cache.metrics does not set a ‘custom_type’ parameter when setting SimpleMetric data. This method aims to delete these extra default keys if they were created and we can delete them.
- _repr_pretty_(p, cycle)¶
IPython-display representation.
- property _reserved¶
Reserved scoretype keys that cannot be set or deleted.
- property _reserved_custom_metric_keys¶
Reserved scoretype keys for SimpleMetrics that cannot be set or deleted.
- _reserved_custom_metric_keys_warning()¶
Warn that reserved custom metric keys were added to the data cache.
- _reserved_types = (<class 'str'>, <class 'float'>)¶
- property _sm_data_accessor_attrs¶
Supported SimpleMetricDataAccessor attributes to reset after clear_sm_data.
- property _unsupported_sm_data_accessor_attrs¶
Unsupported SimpleMetricDataAccessor attributes that cannot be reset after clear_sm_data.
- _validate_del(key)¶
Validate that a key can be deleted.
- _validate_set(key)¶
Validate that a key can be set.
- property all¶
Get all SimpleMetric data (with clobber warnings).
- This method aims to mimic data override precedences used in the legacy pose.scores dictionary:
pose.energies().active_total_energies()
ScoreMap.get_arbitrary_score_data_from_pose(pose)
ScoreMap.get_arbitrary_string_data_from_pose(pose)
- Data override precedences as defined in ScoreMap::add_arbitrary_score_data_from_pose:
Per-residue real metrics
Composite real metrics
Real metrics
- Data override precedences as defined in ScoreMap::add_arbitrary_string_data_from_pose:
Per-residue probabilities metrics
Per-residue string metrics
Composite string metrics
String metrics
- apply(metric, key, value)¶
Apply a SimpleMetric with a key/value pair to the pose.
- static bool_from_str(value)¶
- clear()¶
Clear pose SimpleMetric data.
- property composite_real¶
- property composite_string¶
- format_composite_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_composite_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- format_per_residue_probabilities(raw_data)¶
Format per-residue probabilities metrics as nested dictionaries.
The default output format from ScoreMap.add_arbitrary_string_data_from_pose sets values as str objects:
{‘my_metric_1’: ‘ALA:0.0125,ASN:0.000000,…’, ‘my_metric_2’: …}`
Here, we reformat the values into separate dict objects where keys are str objects and values are float objects:
{‘my_metric_1’: {‘ALA’: 0.0125, ‘ASN’: 0.0, …}, ‘my_metric_2’: …}
- format_per_residue_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_per_residue_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- static from_base64(value)¶
- static from_base64_pickle(value)¶
- static from_pickle(value)¶
- get(k[, d]) D[k] if k in D, else d. d defaults to None. ¶
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- static maybe_decode(value)¶
Deserialize the input value if it’s serialized.
- static maybe_encode(value)¶
Serialize the input value into a str object if it’s not a str or float object.
- property per_residue_probabilities¶
- property per_residue_real¶
- property per_residue_string¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair ¶
as a 2-tuple; but raise KeyError if D is empty.
- pose¶
- property real¶
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D ¶
- property string¶
- static to_base64(value)¶
- static to_base64_pickle(value)¶
- static to_pickle(value)¶
- update([E, ]**F) None. Update D from mapping/iterable E and F. ¶
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values ¶
- class pyrosetta.bindings.scores.simple_metrics.SimpleMetricDataAccessorBase(pose)¶
Bases:
PoseCacheAccessorBase
,MutableMapping
Base methods for accessor wrapper for pose SimpleMetric data.
- _CustomTypeMetric¶
alias of
CustomTypeMetric
- _abc_impl = <_abc._abc_data object>¶
- _clobber_warning(msg)¶
Issue a ClobberWarning warning with a message.
- _custom_type_metrics = {'bool': CustomTypeMetric(type=<class 'bool'>, prefix='[CustomBooleanValueMetric]', encode_func=<class 'str'>, decode_func=<function PoseScoreSerializerBase.bool_from_str>), 'bytes': CustomTypeMetric(type=<class 'bytes'>, prefix='[CustomBinaryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64>, decode_func=<function PoseScoreSerializerBase.from_base64>), 'int': CustomTypeMetric(type=<class 'int'>, prefix='[CustomDiscreteValueMetric]', encode_func=<class 'str'>, decode_func=<class 'int'>), 'object': CustomTypeMetric(type=<class 'object'>, prefix='[CustomArbitraryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64_pickle>, decode_func=<function PoseScoreSerializerBase.from_base64_pickle>)}¶
- _format_metric(raw_data, as_dict=False)¶
- _get_sm_data_dict(attributes)¶
- _has_reserved_custom_metric_keys()¶
- _maybe_delete_keys_from_sm_data(keys=None, attributes=None)¶
Cache, clear, and restore all SimpleMetric data except the provided keys in the provided SimpleMetricDataAccessor attributes. This is necessary to delete one or more keys, since clear_sm_data clears all SimpleMetric data.
- _maybe_delete_reserved_keys_from_sm_data()¶
CustomRealValueMetric and CustomStringValueMetric can save the extra default keys “custom_real_valued_metric” or “custom_string_valued_metric” because pose.cache.metrics does not set a ‘custom_type’ parameter when setting SimpleMetric data. This method aims to delete these extra default keys if they were created and we can delete them.
- _repr_pretty_(p, cycle)¶
IPython-display representation.
- property _reserved¶
Reserved scoretype keys that cannot be set or deleted.
- property _reserved_custom_metric_keys¶
Reserved scoretype keys for SimpleMetrics that cannot be set or deleted.
- _reserved_custom_metric_keys_warning()¶
Warn that reserved custom metric keys were added to the data cache.
- _reserved_types = (<class 'str'>, <class 'float'>)¶
- property _sm_data_accessor_attrs¶
Supported SimpleMetricDataAccessor attributes to reset after clear_sm_data.
- property _unsupported_sm_data_accessor_attrs¶
Unsupported SimpleMetricDataAccessor attributes that cannot be reset after clear_sm_data.
- _validate_del(key)¶
Validate that a key can be deleted.
- _validate_set(key)¶
Validate that a key can be set.
- apply(metric, key, value)¶
Apply a SimpleMetric with a key/value pair to the pose.
- static bool_from_str(value)¶
- clear() None. Remove all items from D. ¶
- format_composite_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_composite_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- format_per_residue_probabilities(raw_data)¶
Format per-residue probabilities metrics as nested dictionaries.
The default output format from ScoreMap.add_arbitrary_string_data_from_pose sets values as str objects:
{‘my_metric_1’: ‘ALA:0.0125,ASN:0.000000,…’, ‘my_metric_2’: …}`
Here, we reformat the values into separate dict objects where keys are str objects and values are float objects:
{‘my_metric_1’: {‘ALA’: 0.0125, ‘ASN’: 0.0, …}, ‘my_metric_2’: …}
- format_per_residue_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_per_residue_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- static from_base64(value)¶
- static from_base64_pickle(value)¶
- static from_pickle(value)¶
- get(k[, d]) D[k] if k in D, else d. d defaults to None. ¶
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- static maybe_decode(value)¶
Deserialize the input value if it’s serialized.
- static maybe_encode(value)¶
Serialize the input value into a str object if it’s not a str or float object.
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair ¶
as a 2-tuple; but raise KeyError if D is empty.
- pose¶
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D ¶
- static to_base64(value)¶
- static to_base64_pickle(value)¶
- static to_pickle(value)¶
- update([E, ]**F) None. Update D from mapping/iterable E and F. ¶
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values ¶
- class pyrosetta.bindings.scores.simple_metrics.SimpleMetricPerResidueProbabilitiesDataAccessor(pose)¶
Bases:
SimpleMetricDataAccessorBase
Accessor wrapper for pose SimpleMetric per-residue probabilities data.
- _CustomTypeMetric¶
alias of
CustomTypeMetric
- _abc_impl = <_abc._abc_data object>¶
- _clobber_warning(msg)¶
Issue a ClobberWarning warning with a message.
- _custom_type_metrics = {'bool': CustomTypeMetric(type=<class 'bool'>, prefix='[CustomBooleanValueMetric]', encode_func=<class 'str'>, decode_func=<function PoseScoreSerializerBase.bool_from_str>), 'bytes': CustomTypeMetric(type=<class 'bytes'>, prefix='[CustomBinaryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64>, decode_func=<function PoseScoreSerializerBase.from_base64>), 'int': CustomTypeMetric(type=<class 'int'>, prefix='[CustomDiscreteValueMetric]', encode_func=<class 'str'>, decode_func=<class 'int'>), 'object': CustomTypeMetric(type=<class 'object'>, prefix='[CustomArbitraryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64_pickle>, decode_func=<function PoseScoreSerializerBase.from_base64_pickle>)}¶
- _format_metric(raw_data, as_dict=False)¶
- _get_sm_data_dict(attributes)¶
- _has_reserved_custom_metric_keys()¶
- _maybe_delete_keys_from_sm_data(keys=None, attributes=None)¶
Cache, clear, and restore all SimpleMetric data except the provided keys in the provided SimpleMetricDataAccessor attributes. This is necessary to delete one or more keys, since clear_sm_data clears all SimpleMetric data.
- _maybe_delete_reserved_keys_from_sm_data()¶
CustomRealValueMetric and CustomStringValueMetric can save the extra default keys “custom_real_valued_metric” or “custom_string_valued_metric” because pose.cache.metrics does not set a ‘custom_type’ parameter when setting SimpleMetric data. This method aims to delete these extra default keys if they were created and we can delete them.
- _repr_pretty_(p, cycle)¶
IPython-display representation.
- property _reserved¶
Reserved scoretype keys that cannot be set or deleted.
- property _reserved_custom_metric_keys¶
Reserved scoretype keys for SimpleMetrics that cannot be set or deleted.
- _reserved_custom_metric_keys_warning()¶
Warn that reserved custom metric keys were added to the data cache.
- _reserved_types = (<class 'str'>, <class 'float'>)¶
- property _sm_data_accessor_attrs¶
Supported SimpleMetricDataAccessor attributes to reset after clear_sm_data.
- property _unsupported_sm_data_accessor_attrs¶
Unsupported SimpleMetricDataAccessor attributes that cannot be reset after clear_sm_data.
- _validate_del(key)¶
Validate that a key can be deleted.
- _validate_set(key)¶
Validate that a key can be set.
- property all¶
- apply(metric, key, value)¶
Apply a SimpleMetric with a key/value pair to the pose.
- static bool_from_str(value)¶
- clear() None. Remove all items from D. ¶
- format_composite_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_composite_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- format_per_residue_probabilities(raw_data)¶
Format per-residue probabilities metrics as nested dictionaries.
The default output format from ScoreMap.add_arbitrary_string_data_from_pose sets values as str objects:
{‘my_metric_1’: ‘ALA:0.0125,ASN:0.000000,…’, ‘my_metric_2’: …}`
Here, we reformat the values into separate dict objects where keys are str objects and values are float objects:
{‘my_metric_1’: {‘ALA’: 0.0125, ‘ASN’: 0.0, …}, ‘my_metric_2’: …}
- format_per_residue_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_per_residue_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- static from_base64(value)¶
- static from_base64_pickle(value)¶
- static from_pickle(value)¶
- get(k[, d]) D[k] if k in D, else d. d defaults to None. ¶
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- static maybe_decode(value)¶
Deserialize the input value if it’s serialized.
- static maybe_encode(value)¶
Serialize the input value into a str object if it’s not a str or float object.
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair ¶
as a 2-tuple; but raise KeyError if D is empty.
- pose¶
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D ¶
- static to_base64(value)¶
- static to_base64_pickle(value)¶
- static to_pickle(value)¶
- update([E, ]**F) None. Update D from mapping/iterable E and F. ¶
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values ¶
- class pyrosetta.bindings.scores.simple_metrics.SimpleMetricPerResidueRealDataAccessor(pose)¶
Bases:
SimpleMetricDataAccessorBase
Accessor wrapper for pose SimpleMetric per-residue real data.
- _CustomTypeMetric¶
alias of
CustomTypeMetric
- _abc_impl = <_abc._abc_data object>¶
- _clobber_warning(msg)¶
Issue a ClobberWarning warning with a message.
- _custom_type_metrics = {'bool': CustomTypeMetric(type=<class 'bool'>, prefix='[CustomBooleanValueMetric]', encode_func=<class 'str'>, decode_func=<function PoseScoreSerializerBase.bool_from_str>), 'bytes': CustomTypeMetric(type=<class 'bytes'>, prefix='[CustomBinaryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64>, decode_func=<function PoseScoreSerializerBase.from_base64>), 'int': CustomTypeMetric(type=<class 'int'>, prefix='[CustomDiscreteValueMetric]', encode_func=<class 'str'>, decode_func=<class 'int'>), 'object': CustomTypeMetric(type=<class 'object'>, prefix='[CustomArbitraryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64_pickle>, decode_func=<function PoseScoreSerializerBase.from_base64_pickle>)}¶
- _format_metric(raw_data, as_dict=False)¶
- _get_sm_data_dict(attributes)¶
- _has_reserved_custom_metric_keys()¶
- _maybe_delete_keys_from_sm_data(keys=None, attributes=None)¶
Cache, clear, and restore all SimpleMetric data except the provided keys in the provided SimpleMetricDataAccessor attributes. This is necessary to delete one or more keys, since clear_sm_data clears all SimpleMetric data.
- _maybe_delete_reserved_keys_from_sm_data()¶
CustomRealValueMetric and CustomStringValueMetric can save the extra default keys “custom_real_valued_metric” or “custom_string_valued_metric” because pose.cache.metrics does not set a ‘custom_type’ parameter when setting SimpleMetric data. This method aims to delete these extra default keys if they were created and we can delete them.
- _repr_pretty_(p, cycle)¶
IPython-display representation.
- property _reserved¶
Reserved scoretype keys that cannot be set or deleted.
- property _reserved_custom_metric_keys¶
Reserved scoretype keys for SimpleMetrics that cannot be set or deleted.
- _reserved_custom_metric_keys_warning()¶
Warn that reserved custom metric keys were added to the data cache.
- _reserved_types = (<class 'str'>, <class 'float'>)¶
- property _sm_data_accessor_attrs¶
Supported SimpleMetricDataAccessor attributes to reset after clear_sm_data.
- property _unsupported_sm_data_accessor_attrs¶
Unsupported SimpleMetricDataAccessor attributes that cannot be reset after clear_sm_data.
- _validate_del(key)¶
Validate that a key can be deleted.
- _validate_set(key)¶
Validate that a key can be set.
- property all¶
- apply(metric, key, value)¶
Apply a SimpleMetric with a key/value pair to the pose.
- static bool_from_str(value)¶
- clear() None. Remove all items from D. ¶
- format_composite_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_composite_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- format_per_residue_probabilities(raw_data)¶
Format per-residue probabilities metrics as nested dictionaries.
The default output format from ScoreMap.add_arbitrary_string_data_from_pose sets values as str objects:
{‘my_metric_1’: ‘ALA:0.0125,ASN:0.000000,…’, ‘my_metric_2’: …}`
Here, we reformat the values into separate dict objects where keys are str objects and values are float objects:
{‘my_metric_1’: {‘ALA’: 0.0125, ‘ASN’: 0.0, …}, ‘my_metric_2’: …}
- format_per_residue_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_per_residue_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- static from_base64(value)¶
- static from_base64_pickle(value)¶
- static from_pickle(value)¶
- get(k[, d]) D[k] if k in D, else d. d defaults to None. ¶
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- static maybe_decode(value)¶
Deserialize the input value if it’s serialized.
- static maybe_encode(value)¶
Serialize the input value into a str object if it’s not a str or float object.
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair ¶
as a 2-tuple; but raise KeyError if D is empty.
- pose¶
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D ¶
- static to_base64(value)¶
- static to_base64_pickle(value)¶
- static to_pickle(value)¶
- update([E, ]**F) None. Update D from mapping/iterable E and F. ¶
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values ¶
- class pyrosetta.bindings.scores.simple_metrics.SimpleMetricPerResidueStringDataAccessor(pose)¶
Bases:
SimpleMetricDataAccessorBase
Accessor wrapper for pose SimpleMetric per-residue string data.
- _CustomTypeMetric¶
alias of
CustomTypeMetric
- _abc_impl = <_abc._abc_data object>¶
- _clobber_warning(msg)¶
Issue a ClobberWarning warning with a message.
- _custom_type_metrics = {'bool': CustomTypeMetric(type=<class 'bool'>, prefix='[CustomBooleanValueMetric]', encode_func=<class 'str'>, decode_func=<function PoseScoreSerializerBase.bool_from_str>), 'bytes': CustomTypeMetric(type=<class 'bytes'>, prefix='[CustomBinaryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64>, decode_func=<function PoseScoreSerializerBase.from_base64>), 'int': CustomTypeMetric(type=<class 'int'>, prefix='[CustomDiscreteValueMetric]', encode_func=<class 'str'>, decode_func=<class 'int'>), 'object': CustomTypeMetric(type=<class 'object'>, prefix='[CustomArbitraryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64_pickle>, decode_func=<function PoseScoreSerializerBase.from_base64_pickle>)}¶
- _format_metric(raw_data, as_dict=False)¶
- _get_sm_data_dict(attributes)¶
- _has_reserved_custom_metric_keys()¶
- _maybe_delete_keys_from_sm_data(keys=None, attributes=None)¶
Cache, clear, and restore all SimpleMetric data except the provided keys in the provided SimpleMetricDataAccessor attributes. This is necessary to delete one or more keys, since clear_sm_data clears all SimpleMetric data.
- _maybe_delete_reserved_keys_from_sm_data()¶
CustomRealValueMetric and CustomStringValueMetric can save the extra default keys “custom_real_valued_metric” or “custom_string_valued_metric” because pose.cache.metrics does not set a ‘custom_type’ parameter when setting SimpleMetric data. This method aims to delete these extra default keys if they were created and we can delete them.
- _repr_pretty_(p, cycle)¶
IPython-display representation.
- property _reserved¶
Reserved scoretype keys that cannot be set or deleted.
- property _reserved_custom_metric_keys¶
Reserved scoretype keys for SimpleMetrics that cannot be set or deleted.
- _reserved_custom_metric_keys_warning()¶
Warn that reserved custom metric keys were added to the data cache.
- _reserved_types = (<class 'str'>, <class 'float'>)¶
- property _sm_data_accessor_attrs¶
Supported SimpleMetricDataAccessor attributes to reset after clear_sm_data.
- property _unsupported_sm_data_accessor_attrs¶
Unsupported SimpleMetricDataAccessor attributes that cannot be reset after clear_sm_data.
- _validate_del(key)¶
Validate that a key can be deleted.
- _validate_set(key)¶
Validate that a key can be set.
- property all¶
- apply(metric, key, value)¶
Apply a SimpleMetric with a key/value pair to the pose.
- static bool_from_str(value)¶
- clear() None. Remove all items from D. ¶
- format_composite_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_composite_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- format_per_residue_probabilities(raw_data)¶
Format per-residue probabilities metrics as nested dictionaries.
The default output format from ScoreMap.add_arbitrary_string_data_from_pose sets values as str objects:
{‘my_metric_1’: ‘ALA:0.0125,ASN:0.000000,…’, ‘my_metric_2’: …}`
Here, we reformat the values into separate dict objects where keys are str objects and values are float objects:
{‘my_metric_1’: {‘ALA’: 0.0125, ‘ASN’: 0.0, …}, ‘my_metric_2’: …}
- format_per_residue_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_per_residue_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- static from_base64(value)¶
- static from_base64_pickle(value)¶
- static from_pickle(value)¶
- get(k[, d]) D[k] if k in D, else d. d defaults to None. ¶
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- static maybe_decode(value)¶
Deserialize the input value if it’s serialized.
- static maybe_encode(value)¶
Serialize the input value into a str object if it’s not a str or float object.
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair ¶
as a 2-tuple; but raise KeyError if D is empty.
- pose¶
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D ¶
- static to_base64(value)¶
- static to_base64_pickle(value)¶
- static to_pickle(value)¶
- update([E, ]**F) None. Update D from mapping/iterable E and F. ¶
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values ¶
- class pyrosetta.bindings.scores.simple_metrics.SimpleMetricRealDataAccessor(pose)¶
Bases:
SimpleMetricDataAccessorBase
Accessor wrapper for pose SimpleMetric real data.
- _CustomTypeMetric¶
alias of
CustomTypeMetric
- _abc_impl = <_abc._abc_data object>¶
- _clobber_warning(msg)¶
Issue a ClobberWarning warning with a message.
- _custom_type_metrics = {'bool': CustomTypeMetric(type=<class 'bool'>, prefix='[CustomBooleanValueMetric]', encode_func=<class 'str'>, decode_func=<function PoseScoreSerializerBase.bool_from_str>), 'bytes': CustomTypeMetric(type=<class 'bytes'>, prefix='[CustomBinaryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64>, decode_func=<function PoseScoreSerializerBase.from_base64>), 'int': CustomTypeMetric(type=<class 'int'>, prefix='[CustomDiscreteValueMetric]', encode_func=<class 'str'>, decode_func=<class 'int'>), 'object': CustomTypeMetric(type=<class 'object'>, prefix='[CustomArbitraryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64_pickle>, decode_func=<function PoseScoreSerializerBase.from_base64_pickle>)}¶
- _format_metric(raw_data, as_dict=False)¶
- _get_sm_data_dict(attributes)¶
- _has_reserved_custom_metric_keys()¶
- _maybe_delete_keys_from_sm_data(keys=None, attributes=None)¶
Cache, clear, and restore all SimpleMetric data except the provided keys in the provided SimpleMetricDataAccessor attributes. This is necessary to delete one or more keys, since clear_sm_data clears all SimpleMetric data.
- _maybe_delete_reserved_keys_from_sm_data()¶
CustomRealValueMetric and CustomStringValueMetric can save the extra default keys “custom_real_valued_metric” or “custom_string_valued_metric” because pose.cache.metrics does not set a ‘custom_type’ parameter when setting SimpleMetric data. This method aims to delete these extra default keys if they were created and we can delete them.
- _repr_pretty_(p, cycle)¶
IPython-display representation.
- property _reserved¶
Reserved scoretype keys that cannot be set or deleted.
- property _reserved_custom_metric_keys¶
Reserved scoretype keys for SimpleMetrics that cannot be set or deleted.
- _reserved_custom_metric_keys_warning()¶
Warn that reserved custom metric keys were added to the data cache.
- _reserved_types = (<class 'str'>, <class 'float'>)¶
- property _sm_data_accessor_attrs¶
Supported SimpleMetricDataAccessor attributes to reset after clear_sm_data.
- property _unsupported_sm_data_accessor_attrs¶
Unsupported SimpleMetricDataAccessor attributes that cannot be reset after clear_sm_data.
- _validate_del(key)¶
Validate that a key can be deleted.
- _validate_set(key)¶
Validate that a key can be set.
- property all¶
- apply(metric, key, value)¶
Apply a SimpleMetric with a key/value pair to the pose.
- static bool_from_str(value)¶
- clear() None. Remove all items from D. ¶
- format_composite_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_composite_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- format_per_residue_probabilities(raw_data)¶
Format per-residue probabilities metrics as nested dictionaries.
The default output format from ScoreMap.add_arbitrary_string_data_from_pose sets values as str objects:
{‘my_metric_1’: ‘ALA:0.0125,ASN:0.000000,…’, ‘my_metric_2’: …}`
Here, we reformat the values into separate dict objects where keys are str objects and values are float objects:
{‘my_metric_1’: {‘ALA’: 0.0125, ‘ASN’: 0.0, …}, ‘my_metric_2’: …}
- format_per_residue_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_per_residue_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- static from_base64(value)¶
- static from_base64_pickle(value)¶
- static from_pickle(value)¶
- get(k[, d]) D[k] if k in D, else d. d defaults to None. ¶
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- static maybe_decode(value)¶
Deserialize the input value if it’s serialized.
- static maybe_encode(value)¶
Serialize the input value into a str object if it’s not a str or float object.
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair ¶
as a 2-tuple; but raise KeyError if D is empty.
- pose¶
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D ¶
- static to_base64(value)¶
- static to_base64_pickle(value)¶
- static to_pickle(value)¶
- update([E, ]**F) None. Update D from mapping/iterable E and F. ¶
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values ¶
- class pyrosetta.bindings.scores.simple_metrics.SimpleMetricStringDataAccessor(pose)¶
Bases:
SimpleMetricDataAccessorBase
Accessor wrapper for pose SimpleMetric string data.
- _CustomTypeMetric¶
alias of
CustomTypeMetric
- _abc_impl = <_abc._abc_data object>¶
- _clobber_warning(msg)¶
Issue a ClobberWarning warning with a message.
- _custom_type_metrics = {'bool': CustomTypeMetric(type=<class 'bool'>, prefix='[CustomBooleanValueMetric]', encode_func=<class 'str'>, decode_func=<function PoseScoreSerializerBase.bool_from_str>), 'bytes': CustomTypeMetric(type=<class 'bytes'>, prefix='[CustomBinaryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64>, decode_func=<function PoseScoreSerializerBase.from_base64>), 'int': CustomTypeMetric(type=<class 'int'>, prefix='[CustomDiscreteValueMetric]', encode_func=<class 'str'>, decode_func=<class 'int'>), 'object': CustomTypeMetric(type=<class 'object'>, prefix='[CustomArbitraryValueMetric]', encode_func=<function PoseScoreSerializerBase.to_base64_pickle>, decode_func=<function PoseScoreSerializerBase.from_base64_pickle>)}¶
- _format_metric(raw_data, as_dict=False)¶
- _get_sm_data_dict(attributes)¶
- _has_reserved_custom_metric_keys()¶
- _maybe_delete_keys_from_sm_data(keys=None, attributes=None)¶
Cache, clear, and restore all SimpleMetric data except the provided keys in the provided SimpleMetricDataAccessor attributes. This is necessary to delete one or more keys, since clear_sm_data clears all SimpleMetric data.
- _maybe_delete_reserved_keys_from_sm_data()¶
CustomRealValueMetric and CustomStringValueMetric can save the extra default keys “custom_real_valued_metric” or “custom_string_valued_metric” because pose.cache.metrics does not set a ‘custom_type’ parameter when setting SimpleMetric data. This method aims to delete these extra default keys if they were created and we can delete them.
- _repr_pretty_(p, cycle)¶
IPython-display representation.
- property _reserved¶
Reserved scoretype keys that cannot be set or deleted.
- property _reserved_custom_metric_keys¶
Reserved scoretype keys for SimpleMetrics that cannot be set or deleted.
- _reserved_custom_metric_keys_warning()¶
Warn that reserved custom metric keys were added to the data cache.
- _reserved_types = (<class 'str'>, <class 'float'>)¶
- property _sm_data_accessor_attrs¶
Supported SimpleMetricDataAccessor attributes to reset after clear_sm_data.
- property _unsupported_sm_data_accessor_attrs¶
Unsupported SimpleMetricDataAccessor attributes that cannot be reset after clear_sm_data.
- _validate_del(key)¶
Validate that a key can be deleted.
- _validate_set(key)¶
Validate that a key can be set.
- property all¶
- apply(metric, key, value)¶
Apply a SimpleMetric with a key/value pair to the pose.
- static bool_from_str(value)¶
- clear() None. Remove all items from D. ¶
- format_composite_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_composite_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- format_per_residue_probabilities(raw_data)¶
Format per-residue probabilities metrics as nested dictionaries.
The default output format from ScoreMap.add_arbitrary_string_data_from_pose sets values as str objects:
{‘my_metric_1’: ‘ALA:0.0125,ASN:0.000000,…’, ‘my_metric_2’: …}`
Here, we reformat the values into separate dict objects where keys are str objects and values are float objects:
{‘my_metric_1’: {‘ALA’: 0.0125, ‘ASN’: 0.0, …}, ‘my_metric_2’: …}
- format_per_residue_real(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_score_data_from_pose.
- format_per_residue_string(raw_data)¶
Mimics formatting in ScoreMap.add_arbitrary_string_data_from_pose.
- static from_base64(value)¶
- static from_base64_pickle(value)¶
- static from_pickle(value)¶
- get(k[, d]) D[k] if k in D, else d. d defaults to None. ¶
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- static maybe_decode(value)¶
Deserialize the input value if it’s serialized.
- static maybe_encode(value)¶
Serialize the input value into a str object if it’s not a str or float object.
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair ¶
as a 2-tuple; but raise KeyError if D is empty.
- pose¶
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D ¶
- static to_base64(value)¶
- static to_base64_pickle(value)¶
- static to_pickle(value)¶
- update([E, ]**F) None. Update D from mapping/iterable E and F. ¶
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values ¶