Cctbx.xfel GUI/Merging Stats tab: Difference between revisions

From cctbx_xfel
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 15: Line 15:
* '''Multiplicity''' (red) and '''Merged I/sigI''' (purple) on the right axis.
* '''Multiplicity''' (red) and '''Merged I/sigI''' (purple) on the right axis.


With '''All''' versions selected, the plot shows how the merge improves with data: overall CC1/2 and overall multiplicity against the number of images, and resolution against the number of images, one point per version. This is the plot to watch during collection to decide when enough data have been collected.
With '''All''' versions selected, the plot shows how the merge improves with data: overall CC1/2 and overall multiplicity against the number of images, and resolution against the number of images, one point per version. This is the plot to watch during collection to decide when enough data have been collected. A dataset whose [[cctbx.xfel GUI/Datasets tab#Merging schedule|merging schedule]] is ''Merge after every run'' has one version per run, which makes this plot a run-by-run record.


The statistics are scraped from the merging log (the <code>*main*</code> file in the version folder), so they match the tables printed there. Nothing is shown for a version whose merge has not yet written its tables.
They are the same numbers as the tables in the merging log. Nothing is shown for a version whose merge has not yet written its tables.


== Cosym embedding page ==
== Cosym embedding page ==
When the merging stage ran <code>modify_cosym</code> to resolve an indexing ambiguity, it writes an embedding plot: each lattice is a point, and a successful resolution shows as well-separated clusters, one per indexing mode. A single blob means cosym could not separate the modes (too little signal in common between images, or no real ambiguity) and the merged data may be degraded by mis-indexed lattices. This page shows the plot for a single selected version; a selector appears when the job wrote more than one (one per plotting rank). The page explains when no plot is available.
When the merging stage ran <code>modify_cosym</code> to resolve an indexing ambiguity, it writes an embedding plot: each lattice is a point, and a successful resolution shows as well-separated clusters, one per indexing mode. A single blob means cosym could not separate the modes (too little signal in common between images, or no real ambiguity) and the merged data may be degraded by mis-indexed lattices. This page shows the plot for a single selected version; a selector appears when the job wrote more than one. The page explains when no plot is available.


== Detector drift page ==
== Detector drift page ==
Line 39: Line 39:
|}
|}


Reading every chunk's refined experiments is slow, so the results are cached per chunk in the dataset's folder (<code><dataset name>/drift_cache_v<NNN>_*.pkl</code>) and only new chunks are read on later refreshes; the plot is only computed while this page is showing. The line above the figure reports how many chunks were read and, if any could not be, the first reason.
The first display of a version can take a while, since every run's refined experiments are read; later refreshes are quick. The line above the figure reports how many chunks were read and, if any could not be, the first reason.


== Tips ==
== Tips ==
* Compare versions, or two datasets merged with different settings, by switching the selection; the plot is redrawn at the panel size, so enlarge the window for more detail.
* Compare versions, or two datasets merged with different settings, by switching the selection; the plot is redrawn at the panel size, so enlarge the window for more detail.
* If CC1/2 or completeness is poor in the outer shells, lower the resolution in the dataset's shared parameters (which creates no new version by itself; a new version is merged when further runs finish, or restart the merging job from the [[cctbx.xfel GUI/Jobs tab|Jobs tab]]).
* If CC1/2 or completeness is poor in the outer shells, lower the resolution limit in the dataset's shared parameters. That changes the scaling and merging stages, so with the dataset active the job sentinel re-runs scaling for every run (ensemble refinement is reused) and merges a new version when they finish. Changing only the merging stage's own parameters, through its ''Edit PHIL'', merges a new version at once from the existing scaling results. Earlier versions are kept.

Latest revision as of 19:24, 2 November 2026

The Merging stats tab shows the merging statistics of each version of a dataset, read from the merging job's log, the cosym embedding plot when the merge resolved an indexing ambiguity, and the drift of the detector geometry and unit cell over the runs behind a version. The Merging Stats Sentinel re-reads the logs every 5 seconds while the tab is showing and Auto update is ticked, so a merge that is still running fills in as it goes.

Back to cctbx.xfel GUI.

Selecting a dataset

  • Select dataset: the list of datasets; Active only (ticked by default) hides inactive ones.
  • Dataset version: All or a single version number. Only versions built with the dataset's current pipeline are listed; a version made with a stage the dataset no longer has is hidden.
  • Auto update: untick to stop the sentinel and freeze the plots, for example to zoom into the drift plot with its toolbar without it being redrawn.

Statistics page

For a single version, the plot shows the statistics by resolution shell, with resolution along the x axis:

  • % accepted (orange): the fraction of lattices accepted into each resolution shell,
  • Completeness (green) and CC1/2 (blue), as percentages on the left axis,
  • Multiplicity (red) and Merged I/sigI (purple) on the right axis.

With All versions selected, the plot shows how the merge improves with data: overall CC1/2 and overall multiplicity against the number of images, and resolution against the number of images, one point per version. This is the plot to watch during collection to decide when enough data have been collected. A dataset whose merging schedule is Merge after every run has one version per run, which makes this plot a run-by-run record.

They are the same numbers as the tables in the merging log. Nothing is shown for a version whose merge has not yet written its tables.

Cosym embedding page

When the merging stage ran modify_cosym to resolve an indexing ambiguity, it writes an embedding plot: each lattice is a point, and a successful resolution shows as well-separated clusters, one per indexing mode. A single blob means cosym could not separate the modes (too little signal in common between images, or no real ambiguity) and the merged data may be degraded by mis-indexed lattices. This page shows the plot for a single selected version; a selector appears when the job wrote more than one. The page explains when no plot is available.

Detector drift page

This page shows the figure of cctbx.xfel.drift for the selected version: the detector origin and the unit cell lengths as a function of run and chunk (the pieces ensemble refinement splits each run into), read from the refined experiments the ensemble refinement stage wrote for every run behind the version. Bars along the top give the number of reflections and experiments in each chunk. A drifting origin or cell between runs is a sign that the geometry should be re-refined, or that runs should be split into separate run blocks. With All versions selected the latest version is shown. The page needs an ensemble refinement stage in the pipeline; without one it says so.

Control Meaning
Origin Which detector origin to plot per chunk: first (the first experiment's), average (reflection-weighted), distribution (the whole spread as a heat map), or the same three for the centre of mass of the panels (panel_com_...).
Color by What colours the points: run, run group, chunk, task, trial or dataset version (merge).
Unit cell The reflection-weighted average cell lengths per chunk, or their whole distribution as a heat map.
Uncertainties Error bars on the origin from the mean difference between observed and predicted reflection positions. Roughly doubles the reading time.
Reject outliers Drop a chunk's cells whose a, b or c lies more than 1.5 inter-quartile ranges beyond the quartiles within that chunk before averaging or plotting. Off by default.

The first display of a version can take a while, since every run's refined experiments are read; later refreshes are quick. The line above the figure reports how many chunks were read and, if any could not be, the first reason.

Tips

  • Compare versions, or two datasets merged with different settings, by switching the selection; the plot is redrawn at the panel size, so enlarge the window for more detail.
  • If CC1/2 or completeness is poor in the outer shells, lower the resolution limit in the dataset's shared parameters. That changes the scaling and merging stages, so with the dataset active the job sentinel re-runs scaling for every run (ensemble refinement is reused) and merges a new version when they finish. Changing only the merging stage's own parameters, through its Edit PHIL, merges a new version at once from the existing scaling results. Earlier versions are kept.