|
Rosetta
|

Public Member Functions | |
| def | __init__ (self, pose) |
| def | extra (self) |
| def | metrics (self) |
| def | energies (self) |
| def | all_scores (self) |
| def | all_keys (self) |
| def | assert_unique_keys (self) |
| def | all (self) |
| def | __getitem__ (self, key) |
| def | __setitem__ (self, key, value) |
| def | __delitem__ (self, key) |
| def | clear (self) |
Public Member Functions inherited from pyrosetta.bindings.scores.base.PoseCacheAccessorBase | |
| def | apply (self, metric, key, value) |
| def | __len__ (self) |
| def | __iter__ (self) |
| def | __str__ (self) |
Static Private Attributes | |
| tuple | __slots__ = ("pose",) |
Additional Inherited Members | |
Static Public Member Functions inherited from pyrosetta.bindings.scores.serialization.PoseScoreSerializer | |
| def | maybe_encode (value) |
| def | maybe_decode (value) |
Static Public Member Functions inherited from pyrosetta.bindings.scores.serialization.PoseScoreSerializerBase | |
| def | to_pickle (value) |
| def | from_pickle (value) |
| def | to_base64 (value) |
| def | from_base64 (value) |
| def | to_base64_pickle (value) |
| def | from_base64_pickle (value) |
| def | bool_from_str (value) |
Public Attributes inherited from pyrosetta.bindings.scores.base.PoseCacheAccessorBase | |
| pose | |
| custom_real_value_metric | |
| custom_string_value_metric | |
Accessor wrapper for pose energies, SimpleMetrics data, and arbitrary extra score data.
The `Pose.cache` dictionary has a nested namespace structure wherein each layer has the ability to access,
set, and delete pose score data, with the outermost layers providing warnings if data from the innermost layers
get clobbered once combined. The `Pose.cache` dictionary also uses serialization to dynamically store/retrieve
arbitrary python objects to/from base64-encoded pickled byte streams, and stores/retrieves `float` and `str`
objects without serialization.
Examples:
Get score dictionaries:
- Return nested, read-only dictionaries of all cached score data:
`pose.cache.all_scores`
- Return a flattened, read-only dictionary of all cached score data (with clobber warnings):
`pose.cache`
- Return a flattened, read-only dictionary of all SimpleMetric data (with clobber warnings):
`pose.cache.metrics`
- Return a flattened, read-only dictionary of all arbitrary extra float and extra string score data (with clobber warnings):
`pose.cache.extra`
- Return a read-only dictionary of active total energies:
`pose.cache.energies`
Get a score value:
- Return the value of a key from any `pose.cache.extra`, `pose.cache.metrics`, or `pose.cache.energies` dictionary
(from lowest to highest precedence, respectively, with clobber warnings):
`pose.cache["key"]`
From arbitrary extra score data:
- Return the value of a key from arbitrary extra float or extra string score data (with clobber warnings):
`pose.cache.extra["key"]`
- Return the value of a key from arbitrary extra float score data:
`pose.cache.extra.real["key"]`
- Return the value of a key from arbitrary extra string score data:
`pose.cache.extra.string["key"]`
From SimpleMetric data:
- Return the value of a key from any SimpleMetric data (with clobber warnings):
`pose.cache.metrics["key"]`
- Return the value of a key from SimpleMetric real metric data:
`pose.cache.metrics.real["key"]`
- Return the value of a key from SimpleMetric string metric data:
`pose.cache.metrics.string["key"]`
- Return the value of a key from SimpleMetric composite real metric data:
`pose.cache.metrics.composite_real["key"]`
- Return the value of a key from SimpleMetric composite string metric data:
`pose.cache.metrics.composite_string["key"]`
- Return the value of a key from SimpleMetric per-residue real metric data:
`pose.cache.metrics.per_residue_real["key"]`
- Return the value of a key from SimpleMetric per-residue string metric data:
`pose.cache.metrics.per_residue_string["key"]`
- Return the value of a key from SimpleMetric per-residue probabilities metric data:
`pose.cache.metrics.per_residue_probabilities["key"]`
From active total energies:
- Return the value of a key from any active energy scoretype in the pose:
`pose.cache.energies["key"]`
Set a score value:
To SimpleMetric data:
- Set a key/value pair as a `CustomRealValueMetric` or `CustomStringValueMetric` with automatic type checking:
`pose.cache["key"] = value`
`pose.cache.metrics["key"] = value`
- Set a key/value pair as a `CustomRealValueMetric`:
`pose.cache.metrics.real["key"] = value`
- Set a key/value pair as a `CustomStringValueMetric`:
`pose.cache.metrics.string["key"] = value`
To arbitrary extra score data:
- Set a key/value pair as an arbitrary extra float or string score with automatic type checking:
`pose.cache.extra["key"]`
- Set a key/value pair as an arbitrary extra real score:
`pose.cache.extra.real["key"]`
- Set a key/value pair as an arbitrary extra string score:
`pose.cache.extra.string["key"]`
Delete data:
- Clear all cached score data:
`pose.cache.clear()`
- Clear all SimpleMetric data:
`pose.cache.metrics.clear()`
- Clear all arbitrary extra float and string score data:
`pose.cache.extra.clear()`
- Clear a single key/value pair:
`pose.cache.pop("key")`
`pose.cache.metrics.pop("key")`
`pose.cache.metrics.real.pop("key")`
`pose.cache.metrics.string.pop("key")`
`pose.cache.extra.pop("key")`
@klimaj
| def pyrosetta.bindings.scores.core.PoseCacheAccessor.__init__ | ( | self, | |
| pose | |||
| ) |
Reimplemented from pyrosetta.bindings.scores.base.PoseCacheAccessorBase.
Referenced by pyrosetta.distributed.tasks.taskbase.TaskBase.__setstate__().
| def pyrosetta.bindings.scores.core.PoseCacheAccessor.__delitem__ | ( | self, | |
| key | |||
| ) |
Delete an item from the pose scores cache. This method first looks for the key in SimpleMetric data, then if not present it looks for the key in arbitrary extra float data and arbitrary extra string data. Use `pose.cache.extra.pop(key)` to explicitly delete an item from the arbitrary extra float data or arbitrary extra string data. Use `pose.cache.metrics.pop(key)` to explicitly delete an item from SimpleMetric data.
References pyrosetta.bindings.scores.base.PoseCacheAccessorBase._maybe_delete_keys_from_sm_data(), pyrosetta.bindings.scores.base.PoseCacheAccessorBase._validate_del(), pyrosetta.bindings.scores.core.PoseCacheAccessor.metrics(), PDB_IOBenchmark.pose, ScoreBenchmark.pose, ShearMoverBenchmark.pose, SmallMoverBenchmark.pose, SamplingManager.pose, apps::pilot::KicSandbox.pose, PoseAndData.pose, PoseWrap.pose, MatchBase.pose, MatchLig.pose, SlideTask.pose(), HIT.pose, WorkDat.pose, pyrosetta.bindings.pose.PoseResidueAccessor.pose, pyrosetta.bindings.pose.PoseResidueLabelAccessor.pose, pyrosetta.bindings.pose.PoseScoreAccessor.pose, pyrosetta.bindings.scores.base.PoseCacheAccessorBase.pose, ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget.pose(), pyrosetta.distributed.packed_pose.core.PackedPose.pose(), pyrosetta.tests.bindings.core.test_pose.TestPoseCacheAccessor.pose, test.T010_LoadPDB.LoadPDBTest.pose, and test.T300_PyJobDistributor.TestPyJobDistributor.pose.
Referenced by pyrosetta.bindings.pose.PoseScoreAccessor.__setitem__().
| def pyrosetta.bindings.scores.core.PoseCacheAccessor.__getitem__ | ( | self, | |
| key | |||
| ) |
References pyrosetta.bindings.pose.PoseScoreAccessor.all(), pyrosetta.bindings.scores.core.PoseCacheAccessor.all(), pyrosetta.bindings.scores.energies.EnergiesAccessor.all(), pyrosetta.bindings.scores.extra_scores.ExtraFloatScoresDataAccessor.all(), pyrosetta.bindings.scores.extra_scores.ExtraStringScoresDataAccessor.all(), pyrosetta.bindings.scores.extra_scores.ExtraScoresAccessor.all(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricStringDataAccessor.all(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricRealDataAccessor.all(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricCompositeStringDataAccessor.all(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricCompositeRealDataAccessor.all(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricPerResidueStringDataAccessor.all(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricPerResidueRealDataAccessor.all(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricPerResidueProbabilitiesDataAccessor.all(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricDataAccessor.all(), ui::task::Node.all, and pyrosetta.bindings.scores.serialization.PoseScoreSerializer.maybe_decode().
| def pyrosetta.bindings.scores.core.PoseCacheAccessor.__setitem__ | ( | self, | |
| key, | |||
| value | |||
| ) |
Save a key and value to SimpleMetric data by default.
To save a key and value to arbitrary extra scores, use:
`Pose.cache.extra[key] = value`
References pyrosetta.bindings.scores.core.PoseCacheAccessor.metrics().
| def pyrosetta.bindings.scores.core.PoseCacheAccessor.all | ( | self | ) |
Get all cached score data.
This method aims to mimic data override precedences used in the legacy `pose.scores` dictionary:
1. `pose.energies().active_total_energies()`
2. `ScoreMap.get_arbitrary_score_data_from_pose(pose)`
3. `ScoreMap.get_arbitrary_string_data_from_pose(pose)`
Data override precedences as defined in `ScoreMap::add_arbitrary_score_data_from_pose`:
1. SimpleMetric data
2. Arbitrary extra float scores
Data override precedences as defined in `ScoreMap::add_arbitrary_string_data_from_pose`:
1. SimpleMetric data
2. Arbitrary extra string scores
References pyrosetta.bindings.scores.base.PoseCacheAccessorBase._clobber_warning(), pyrosetta.bindings.pose.PoseScoreAccessor.energies(), pyrosetta.bindings.scores.core.PoseCacheAccessor.energies(), pyrosetta.io.silent_file_map.SilentFileMap.energies(), pyrosetta.bindings.pose.PoseScoreAccessor.extra(), pyrosetta.bindings.scores.core.PoseCacheAccessor.extra(), pyrosetta.tests.distributed.test_dask.format, and pyrosetta.bindings.scores.core.PoseCacheAccessor.metrics().
Referenced by pyrosetta.bindings.pose.PoseScoreAccessor.__getitem__(), pyrosetta.bindings.scores.core.PoseCacheAccessor.__getitem__(), pyrosetta.bindings.scores.energies.EnergiesAccessor.__getitem__(), pyrosetta.bindings.scores.extra_scores.ExtraScoresAccessorBase.__getitem__(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricDataAccessorBase.__getitem__(), pyrosetta.bindings.pose.PoseScoreAccessor.__iter__(), pyrosetta.bindings.scores.base.PoseCacheAccessorBase.__iter__(), pyrosetta.bindings.pose.PoseScoreAccessor.__len__(), pyrosetta.bindings.scores.base.PoseCacheAccessorBase.__len__(), pyrosetta.bindings.scores.extra_scores.ExtraScoresAccessorBase.clear(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricDataAccessorBase.clear(), pyrosetta.bindings.scores.simple_metrics.SimpleMetricStringDataAccessor.clear(), and pyrosetta.bindings.scores.simple_metrics.SimpleMetricRealDataAccessor.clear().
| def pyrosetta.bindings.scores.core.PoseCacheAccessor.all_keys | ( | self | ) |
Return a tuple of all score data keys.
References pyrosetta.bindings.scores.core.PoseCacheAccessor.all_scores().
Referenced by pyrosetta.bindings.scores.core.PoseCacheAccessor.assert_unique_keys().
| def pyrosetta.bindings.scores.core.PoseCacheAccessor.all_scores | ( | self | ) |
Return a nested dictionary of all score data.
References pyrosetta.bindings.pose.PoseScoreAccessor.energies(), pyrosetta.bindings.scores.core.PoseCacheAccessor.energies(), pyrosetta.io.silent_file_map.SilentFileMap.energies(), pyrosetta.bindings.pose.PoseScoreAccessor.extra(), pyrosetta.bindings.scores.core.PoseCacheAccessor.extra(), and pyrosetta.bindings.scores.core.PoseCacheAccessor.metrics().
Referenced by pyrosetta.bindings.scores.core.PoseCacheAccessor.all_keys().
| def pyrosetta.bindings.scores.core.PoseCacheAccessor.assert_unique_keys | ( | self | ) |
Assert that `Pose.cache.all_keys` returns all unique keys.
References pyrosetta.bindings.scores.core.PoseCacheAccessor.all_keys(), pyrosetta.tests.distributed.test_dask.format, ObjexxFCL.len(), print(), and set().
| def pyrosetta.bindings.scores.core.PoseCacheAccessor.clear | ( | self | ) |
Clear pose energies, extra scores, and SimpleMetric data.
References pyrosetta.bindings.scores.core.PoseCacheAccessor.energies(), PDB_IOBenchmark.pose, ScoreBenchmark.pose, ShearMoverBenchmark.pose, SmallMoverBenchmark.pose, SamplingManager.pose, apps::pilot::KicSandbox.pose, PoseAndData.pose, PoseWrap.pose, MatchBase.pose, MatchLig.pose, SlideTask.pose(), HIT.pose, WorkDat.pose, pyrosetta.bindings.pose.PoseResidueAccessor.pose, pyrosetta.bindings.pose.PoseResidueLabelAccessor.pose, pyrosetta.bindings.pose.PoseScoreAccessor.pose, pyrosetta.bindings.scores.base.PoseCacheAccessorBase.pose, ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget.pose(), pyrosetta.distributed.packed_pose.core.PackedPose.pose(), pyrosetta.tests.bindings.core.test_pose.TestPoseCacheAccessor.pose, test.T010_LoadPDB.LoadPDBTest.pose, and test.T300_PyJobDistributor.TestPyJobDistributor.pose.
Referenced by pyrosetta.bindings.pose.ResidueLabelAccessor.discard().
| def pyrosetta.bindings.scores.core.PoseCacheAccessor.energies | ( | self | ) |
References PDB_IOBenchmark.pose, ScoreBenchmark.pose, ShearMoverBenchmark.pose, SmallMoverBenchmark.pose, SamplingManager.pose, apps::pilot::KicSandbox.pose, PoseAndData.pose, PoseWrap.pose, MatchBase.pose, MatchLig.pose, SlideTask.pose(), HIT.pose, WorkDat.pose, pyrosetta.bindings.pose.PoseResidueAccessor.pose, pyrosetta.bindings.pose.PoseResidueLabelAccessor.pose, pyrosetta.bindings.pose.PoseScoreAccessor.pose, pyrosetta.bindings.scores.base.PoseCacheAccessorBase.pose, ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget.pose(), pyrosetta.distributed.packed_pose.core.PackedPose.pose(), pyrosetta.tests.bindings.core.test_pose.TestPoseCacheAccessor.pose, test.T010_LoadPDB.LoadPDBTest.pose, and test.T300_PyJobDistributor.TestPyJobDistributor.pose.
Referenced by pyrosetta.bindings.scores.core.PoseCacheAccessor.all(), pyrosetta.bindings.scores.core.PoseCacheAccessor.all_scores(), and pyrosetta.bindings.scores.core.PoseCacheAccessor.clear().
| def pyrosetta.bindings.scores.core.PoseCacheAccessor.extra | ( | self | ) |
References PDB_IOBenchmark.pose, ScoreBenchmark.pose, ShearMoverBenchmark.pose, SmallMoverBenchmark.pose, SamplingManager.pose, apps::pilot::KicSandbox.pose, PoseAndData.pose, PoseWrap.pose, MatchBase.pose, MatchLig.pose, SlideTask.pose(), HIT.pose, WorkDat.pose, pyrosetta.bindings.pose.PoseResidueAccessor.pose, pyrosetta.bindings.pose.PoseResidueLabelAccessor.pose, pyrosetta.bindings.pose.PoseScoreAccessor.pose, pyrosetta.bindings.scores.base.PoseCacheAccessorBase.pose, ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget.pose(), pyrosetta.distributed.packed_pose.core.PackedPose.pose(), pyrosetta.tests.bindings.core.test_pose.TestPoseCacheAccessor.pose, test.T010_LoadPDB.LoadPDBTest.pose, and test.T300_PyJobDistributor.TestPyJobDistributor.pose.
Referenced by pyrosetta.bindings.scores.core.PoseCacheAccessor.all(), and pyrosetta.bindings.scores.core.PoseCacheAccessor.all_scores().
| def pyrosetta.bindings.scores.core.PoseCacheAccessor.metrics | ( | self | ) |
References PDB_IOBenchmark.pose, ScoreBenchmark.pose, ShearMoverBenchmark.pose, SmallMoverBenchmark.pose, SamplingManager.pose, apps::pilot::KicSandbox.pose, PoseAndData.pose, PoseWrap.pose, MatchBase.pose, MatchLig.pose, SlideTask.pose(), HIT.pose, WorkDat.pose, pyrosetta.bindings.pose.PoseResidueAccessor.pose, pyrosetta.bindings.pose.PoseResidueLabelAccessor.pose, pyrosetta.bindings.pose.PoseScoreAccessor.pose, pyrosetta.bindings.scores.base.PoseCacheAccessorBase.pose, ui::ui_core::pose_draw::SimplePoseDrawOpenGLWidget.pose(), pyrosetta.distributed.packed_pose.core.PackedPose.pose(), pyrosetta.tests.bindings.core.test_pose.TestPoseCacheAccessor.pose, test.T010_LoadPDB.LoadPDBTest.pose, and test.T300_PyJobDistributor.TestPyJobDistributor.pose.
Referenced by pyrosetta.bindings.scores.core.PoseCacheAccessor.__delitem__(), pyrosetta.bindings.scores.core.PoseCacheAccessor.__setitem__(), pyrosetta.bindings.scores.core.PoseCacheAccessor.all(), and pyrosetta.bindings.scores.core.PoseCacheAccessor.all_scores().
|
staticprivate |