Rugnux live: the uploaded model is refined after placement; refined scores, model, maps and blobs in the status, the viewer and the hero

The live run refines a placed model as `rugnux` does (ProcessConfig::refine), after every decision
and before the end message; a cut before it starts leaves it out, as the model. The writer still
gets the placed model; the refined one stays with the broker.

API (broker/jfjoch_api.yaml):
- rugnux_live_model.refinement (rugnux_live_refinement): performed, reason, on_gpu, seconds, r_work,
  r_free, rmsd_bonds_A, rmsd_angles_deg, blob_count, blobs (at most 50, rugnux_live_blob: kind, x, y,
  z, peak_sigma, volume_A3, nearest_atom, nearest_atom_distance_A)
- rugnux_live_status.refined_model
- /rugnux/model.cif and /rugnux/map.ccp4 take stage=placed|refined, by default the refined model
  where there is one; the anomalous map stays on the placed model's phases (the refined
  coefficients carry none).
Regenerated broker/gen, frontend/src/client, redoc, and the python client docs (which also brings
the hero fields and rugnux_live_model it was missing).

Frontend: the model card keeps its green/red and gets "R-free 0.xx (refined)" as its context line,
"refining..." while the step runs; the model section adds refined R-free and blob tiles; Mol*
shows the refined model and maps, with the blobs as small spheres coloured by reading (switch, off
at first). The Refinement step is in the timeline like any other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu
(cherry picked from commit 3b47fb9a53b7dfad1c1ed289e169094c8d3d9d3e)
This commit is contained in:
leonarski_f committed 2026-10-26 01:38:25 +01:00
1 parent 7bf906e4a2
commit baec34685d
36 files changed
+1664 -74

No files matched your search

+3
View File
@@ -231,6 +231,9 @@ Class | Method | HTTP request | Description
- [RoiCircleList](docs/RoiCircleList.md)
- [RoiDefinitions](docs/RoiDefinitions.md)
- [RotationAxis](docs/RotationAxis.md)
- [RugnuxLiveBlob](docs/RugnuxLiveBlob.md)
- [RugnuxLiveModel](docs/RugnuxLiveModel.md)
- [RugnuxLiveRefinement](docs/RugnuxLiveRefinement.md)
- [RugnuxLiveStatus](docs/RugnuxLiveStatus.md)
- [RugnuxLiveStep](docs/RugnuxLiveStep.md)
- [RugnuxSettings](docs/RugnuxSettings.md)
+19 -9
View File
@@ -4076,14 +4076,16 @@ This endpoint does not need any parameter.
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **rugnux_map_ccp4_get**
> bytearray rugnux_map_ccp4_get(type=type)
> bytearray rugnux_map_ccp4_get(type=type, stage=stage)
Get an electron-density map of the last rugnux live run
The map of the placed model (`/rugnux/model.cif`) in CCP4 format (mode 2, float), made from the map
coefficients written to `_maps.mtz` (FWT/PHWT, DELFWT/PHDELWT, ANOM/PHANOM). It covers one unit cell centred on the model - along an axis where
the model reaches further than the cell, the model plus 5 A instead - sampled every d_min/3; the mean and
RMS in its header are those of the unit cell, so contour levels in sigma are the usual ones.
RMS in its header are those of the unit cell, so contour levels in sigma are the usual ones. Where the run
refined the model, the 2mFo-DFc and mFo-DFc maps are the refined model's unless asked for `stage=placed`;
the anomalous map stays on the placed model's phases.
### Example
@@ -4116,10 +4118,11 @@ with jfjoch_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = jfjoch_client.DefaultApi(api_client)
type = 2fofc # str | `2fofc`: the 2mFo-DFc map; `fofc`: the mFo-DFc difference map; `anom`: the anomalous difference map, (F(+) - F(-)) on the model phases less 90 degrees, where the merge kept the Bijvoet pairs (`anomalous_map` in `/rugnux/status`) (optional) (default to 2fofc)
stage = 'stage_example' # str | `placed`: the model as placed; `refined`: the model refined (`refined_model` in `/rugnux/status`). Default: the refined model where there is one, otherwise the placed one. (optional)
try:
# Get an electron-density map of the last rugnux live run
api_response = api_instance.rugnux_map_ccp4_get(type=type)
api_response = api_instance.rugnux_map_ccp4_get(type=type, stage=stage)
print("The response of DefaultApi->rugnux_map_ccp4_get:\n")
pprint(api_response)
except Exception as e:
@@ -4134,6 +4137,7 @@ with jfjoch_client.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**type** | **str**| &#x60;2fofc&#x60;: the 2mFo-DFc map; &#x60;fofc&#x60;: the mFo-DFc difference map; &#x60;anom&#x60;: the anomalous difference map, (F(+) - F(-)) on the model phases less 90 degrees, where the merge kept the Bijvoet pairs (&#x60;anomalous_map&#x60; in &#x60;/rugnux/status&#x60;) | [optional] [default to 2fofc]
**stage** | **str**| &#x60;placed&#x60;: the model as placed; &#x60;refined&#x60;: the model refined (&#x60;refined_model&#x60; in &#x60;/rugnux/status&#x60;). Default: the refined model where there is one, otherwise the placed one. | [optional]
### Return type
@@ -4153,20 +4157,21 @@ Name | Type | Description | Notes
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Map | - |
**400** | Unknown map type | - |
**400** | Unknown map type or stage | - |
**401** | The current dataset is protected and no valid bearer token was presented. | - |
**404** | The last rugnux live run placed no model or made no maps, or (&#x60;anom&#x60;) has no Bijvoet pairs | - |
**404** | The last rugnux live run placed no model or made no maps, or (&#x60;anom&#x60;) has no Bijvoet pairs, or (&#x60;stage&#x3D;refined&#x60;) refined none | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **rugnux_model_cif_get**
> bytearray rugnux_model_cif_get()
> bytearray rugnux_model_cif_get(stage=stage)
Get the model as placed by the last rugnux live run
The model placed against the data by molecular replacement or validation, as mmCIF - the same text as the
`_model.cif` file written beside the data: the data's cell and space group, with the input model's own
metadata (entities, sequences, references, authors, software) kept. Kept as long as `/rugnux/status`.
Where the run refined the model, the refined model unless asked for `stage=placed`.
### Example
@@ -4198,10 +4203,11 @@ configuration = jfjoch_client.Configuration(
with jfjoch_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = jfjoch_client.DefaultApi(api_client)
stage = 'stage_example' # str | `placed`: the model as placed; `refined`: the model refined (`refined_model` in `/rugnux/status`). Default: the refined model where there is one, otherwise the placed one. (optional)
try:
# Get the model as placed by the last rugnux live run
api_response = api_instance.rugnux_model_cif_get()
api_response = api_instance.rugnux_model_cif_get(stage=stage)
print("The response of DefaultApi->rugnux_model_cif_get:\n")
pprint(api_response)
except Exception as e:
@@ -4212,7 +4218,10 @@ with jfjoch_client.ApiClient(configuration) as api_client:
### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**stage** | **str**| &#x60;placed&#x60;: the model as placed; &#x60;refined&#x60;: the model refined (&#x60;refined_model&#x60; in &#x60;/rugnux/status&#x60;). Default: the refined model where there is one, otherwise the placed one. | [optional]
### Return type
@@ -4232,8 +4241,9 @@ This endpoint does not need any parameter.
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Placed model | - |
**400** | Unknown stage | - |
**401** | The current dataset is protected and no valid bearer token was presented. | - |
**404** | The last rugnux live run placed no model | - |
**404** | The last rugnux live run placed no model, or (&#x60;stage&#x3D;refined&#x60;) refined none | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+37
View File
@@ -0,0 +1,37 @@
# RugnuxLiveBlob
A blob of positive mFo-DFc density the refined model leaves unexplained, with its likely reading: a rule on what is measured, to point a person at the density - not an identification.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**kind** | **str** | |
**x** | **float** | Centroid, Cartesian Angstrom, in the frame of the refined model (&#x60;/rugnux/model.cif&#x60;) |
**y** | **float** | |
**z** | **float** | |
**peak_sigma** | **float** | The highest point, in map sigma |
**volume_a3** | **float** | Volume above 3 sigma, in cubic Angstrom |
**nearest_atom** | **str** | e.g. \&quot;OG1 THR A42\&quot; |
**nearest_atom_distance_a** | **float** | |
## Example
```python
from jfjoch_client.models.rugnux_live_blob import RugnuxLiveBlob
# TODO update the JSON string below
json = "{}"
# create an instance of RugnuxLiveBlob from a JSON string
rugnux_live_blob_instance = RugnuxLiveBlob.from_json(json)
# print the JSON string representation of the object
print(RugnuxLiveBlob.to_json())
# convert the object into a dict
rugnux_live_blob_dict = rugnux_live_blob_instance.to_dict()
# create an instance of RugnuxLiveBlob from a dict
rugnux_live_blob_from_dict = RugnuxLiveBlob.from_dict(rugnux_live_blob_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,50 @@
# RugnuxLiveModel
What the run made of the model it was given, as the report's MODEL VALIDATION section states it. The R-factors here are those of the placed model with its own coordinates and B factors; what refinement made of it is in `refinement`. A value that is absent was not computed - the model was not placed, or not by molecular replacement.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**placement** | **str** | RIGID_BODY (the model fits where it is), MR (molecular replacement placed it) or NOT_PLACED |
**model_name** | **str** | |
**predicted** | **bool** | Searched for as a predicted model |
**reason** | **str** | Why the model could not be searched for or validated; empty otherwise |
**r_work** | **float** | | [optional]
**r_free** | **float** | | [optional]
**cc_model** | **float** | Correlation of the merged intensities with the placed model&#39;s, over all reflections | [optional]
**fit_sigma** | **float** | How far R-work stands below that of the same model in random orientations, in standard deviations | [optional]
**map_atom_sigma** | **float** | Mean 2mFo-DFc value at the atom centres, in map sigma | [optional]
**rigid_body_angle_deg** | **float** | | [optional]
**rigid_body_shift_a** | **float** | | [optional]
**mr_decision** | **str** | Molecular replacement&#39;s decision (AGREES, ENANTIOMORPH, SPACE_GROUP, TWIN_SUBGROUP, or why it placed nothing); empty where it did not run |
**mr_space_group** | **str** | The group molecular replacement placed the model in; empty where it placed none |
**copies** | **int** | Copies placed by molecular replacement | [optional]
**tf_z** | **float** | Translation-function Z-score, the highest of the copies&#39; | [optional]
**rf_z** | **float** | Rotation-function Z-score of the first copy&#39;s orientation | [optional]
**llg_z** | **float** | Likelihood Z-score after the rigid body, where a copy&#39;s translation function did not stand out | [optional]
**mr_d_min** | **float** | High-resolution limit of the molecular-replacement search, in Angstrom | [optional]
**anomalous_site** | **str** | Atom with the strongest anomalous difference density, e.g. \&quot;SG CYS A7\&quot;; empty where there is no anomalous map |
**anomalous_site_sigma** | **float** | Anomalous difference density at that atom, in map sigma | [optional]
**refinement** | [**RugnuxLiveRefinement**](RugnuxLiveRefinement.md) | | [optional]
## Example
```python
from jfjoch_client.models.rugnux_live_model import RugnuxLiveModel
# TODO update the JSON string below
json = "{}"
# create an instance of RugnuxLiveModel from a JSON string
rugnux_live_model_instance = RugnuxLiveModel.from_json(json)
# print the JSON string representation of the object
print(RugnuxLiveModel.to_json())
# convert the object into a dict
rugnux_live_model_dict = rugnux_live_model_instance.to_dict()
# create an instance of RugnuxLiveModel from a dict
rugnux_live_model_from_dict = RugnuxLiveModel.from_dict(rugnux_live_model_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,39 @@
# RugnuxLiveRefinement
The placed model refined against the merge it was placed on, as the report's REFINE_ keys state it. Set where a placed model was refined or its refinement failed; absent where the model was not placed, or refinement is off (it runs only with a GPU in live mode).
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**performed** | **bool** | Refinement ran to the end; false with &#x60;reason&#x60; where it failed |
**reason** | **str** | Why refinement did not run to the end; empty otherwise |
**on_gpu** | **bool** | |
**seconds** | **float** | Wall time of the refinement |
**r_work** | **float** | R-work of the refined model (after the restrained stage, else after the rigid body and grouped B) | [optional]
**r_free** | **float** | R-free of the refined model, on the same reflections as &#x60;r_work&#x60; | [optional]
**rmsd_bonds_a** | **float** | RMS deviation of the bond lengths from the dictionary, where the restrained stage ran | [optional]
**rmsd_angles_deg** | **float** | RMS deviation of the bond angles from the dictionary, where the restrained stage ran | [optional]
**blob_count** | **int** | Unexplained blobs of the refined model&#39;s mFo-DFc map (above 3 sigma, peaking above 4) |
**blobs** | [**List[RugnuxLiveBlob]**](RugnuxLiveBlob.md) | The strongest blobs, at most 50, strongest first |
## Example
```python
from jfjoch_client.models.rugnux_live_refinement import RugnuxLiveRefinement
# TODO update the JSON string below
json = "{}"
# create an instance of RugnuxLiveRefinement from a JSON string
rugnux_live_refinement_instance = RugnuxLiveRefinement.from_json(json)
# print the JSON string representation of the object
print(RugnuxLiveRefinement.to_json())
# convert the object into a dict
rugnux_live_refinement_dict = rugnux_live_refinement_instance.to_dict()
# create an instance of RugnuxLiveRefinement from a dict
rugnux_live_refinement_from_dict = RugnuxLiveRefinement.from_dict(rugnux_live_refinement_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -8,7 +8,13 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**state** | **str** | |
**placed_model** | **bool** | The run placed the model: it can be fetched from &#x60;/rugnux/model.cif&#x60; and its maps from &#x60;/rugnux/map.ccp4&#x60;. |
**refined_model** | **bool** | The run refined the placed model: &#x60;/rugnux/model.cif&#x60; and &#x60;/rugnux/map.ccp4&#x60; serve the refined model and its maps unless asked for &#x60;stage&#x3D;placed&#x60;. |
**anomalous_map** | **bool** | The merge kept the Bijvoet pairs, so with the placed model there is an anomalous difference map (&#x60;/rugnux/map.ccp4?type&#x3D;anom&#x60;). |
**anomalous_signal** | **bool** | The merged data carry usable anomalous signal (the summary&#39;s \&quot;Anomalous\&quot; row says so) |
**model** | [**RugnuxLiveModel**](RugnuxLiveModel.md) | | [optional]
**space_group** | **str** | Space group of the result (the summary&#39;s \&quot;Space group\&quot; row); absent until the run is over | [optional]
**d_min** | **float** | High-resolution limit of the merge, in Angstrom; absent until the run is over, or without a merge | [optional]
**isa** | **float** | ISa of the error model; absent until the run is over, or where it was not determined | [optional]
**probe** | **str** | Answer of the early lattice probe on the first 60 degrees; empty until it answers |
**probe_s** | **float** | When the probe answered, since the first image | [optional]
**start_to_first_image_s** | **float** | From the START message to the first image; set once the first image arrives | [optional]