Streamlining the RosettaScripts Interface: SimpleMetrics in protocols
~ contributed by Dr. Rocco Moretti
SimpleMetrics in protocols
By Dr. Rocco Moretti, Associate Professor, Meiler Lab, Vanderbilt
SimpleMetrics are a flexible way to perform analysis on your structures. They are a much cleaner way of performing such an analysis when compared to the previous approach of commandeering the reporting functionality of RosettaScripts Filters. However, the initial implementation required that any SimpleMetric be accessed through the RunSimpleMetrics mover. This meant that using SimpleMetrics was sometimes more laborious than using an equivalent Filter, due to Filters being accessible directly from the PROTOCOLS section of the RosettaScripts XML.
To make SimpleMetrics easier to use, a `metrics` attribute was added to the `Add` tags in the PROTOCOLS section. This way, adding a SimpleMetric report as a stage in the protocol is as easy as adding an additional Mover or Filter. One consideration in this implementation is how to determine the name under which the reported metric appears in the scorefile. The RunSimpleMetrics mover has a multi-featured ability to control how the metrics are named. In line with the simplified specification, a simplified naming approach was taken. By default, the scorefile header name is simply the same as the `name` attribute of the SimpleMetric itself (that is, the same name you pass to the `metrics` attribute to identify which SimpleMetric to use). However, to accommodate the common use case of applying a single SimpleMetric multiple times at different points in the protocol, a `labels` attribute is also provided, allowing you to specify, for example, both `pre_relax_energy` and `post_relax_energy` with the same SimpleMetrics object. For full flexibility and backwards compatibility, both the RunSimpleMetrics mover and the streamlined implementations are available for use.
(Stay tuned for the next blog on this topic: RosettaScripts Type-hinting in VS Code By Dr. Vikram Mulligan)