cctbx.xfel GUI/Run Stats tab

From cctbx_xfel
Jump to navigation Jump to search

The Run Stats tab is the live view of how processing is going. It has two views, chosen with the Show selector: Per shot plots every image of the selected runs (strong spots, whether it indexed, resolution, photon energy) with running hit and indexing rates, and is the view to keep open during data collection; Per run plots one point per run (hit, indexing, high quality and solvent rates, and frames) with a table of the counts, and is the view for an overview of a whole experiment. The plot is redrawn every 5 seconds while Auto update is ticked.

Back to cctbx.xfel GUI.

Selecting what to plot

The Statistics Options box on the lower left:

  • Trial: which trial's results to show. The list includes every trial; pick None to clear the plot.
  • Selected runs: tick the runs to plot. The list contains every run in the trial's run blocks, and runs are plotted in run order. Ticking runs by hand turns off the two automatic selections below.
  • Auto plot last five runs: keep showing the five most recent runs in the trial, following along as new runs arrive. This is the normal setting during collection. The checklist is ticked to match.
  • Auto plot entire experiment: select every run in the trial. In the per-shot view this uses a compact three-panel form (no per-run annotations or energy panel); for a long experiment the Per run view is the better overview.
  • Hide options collapses the options and image lists to give the plot the whole window.
  • Auto update: untick to freeze the plot, for example to zoom in with the matplotlib toolbar without the view being reset.
  • Show: Per shot or Per run (see below). Show table (per run only) shows or hides the table of counts under the plot.

The threshold fields take effect when you press Enter or move to another field. A value that is not a number (or not a whole number, where one is needed) is refused with a message and the previous value is kept:

Field Default Used for
High resolution limit 2.0 Å An indexed image counts as high quality if its high-resolution bin (where I/σ(I) drops below the I/σ(I) cutoff) reaches this resolution. The orange line in panel 3 and the parenthesised counts in panel 4 use it.
# multiples threshold 2 An image with at least this many lattices counts as a multi-lattice hit (pink line).
two theta ratio cutoff 1 An image whose radial-average ratio at the run block's two 2θ angles exceeds this counts as a solvent hit (green line), that is, a shot that hit the liquid stream or drop whether or not it contained a crystal.
# strong spots cutoff 16 An image with at least this many strong spots counts as a crystal hit. Also defines which images go into the two image lists below.
I/sig(I) cutoff 1 Defines the high-resolution bin of each indexed image.
# images to dump 10 How many images to convert and open from each list (LCLS XTC processing only).

Per-shot view

The x axis is the image timestamp, with runs laid end to end and separated by vertical lines. Each run is labelled at the top with its tags and its job status, coloured blue for DONE, green for running or queued, red for failed and black if no job was found.

  1. Strong spots: one point per image, the number of strong spots found. Blue points indexed, grey points did not. The y axis is clipped at 5000.
  2. Rates (running averages over a window of images): blue is the percentage of images that indexed, pink the percentage with multiple lattices, and green (right axis) the percentage of solvent hits.
  3. Resolution: orange points give each indexed image's high-resolution bin in Å; the orange line (right axis) is the percentage of images whose resolution reaches the high resolution limit.
  4. Energy: the photon energy of each image in eV, with a text summary per run: run number; images collected / crystal hits; images indexed (indexed to the resolution limit); percentage solvent hits / crystal hits; percentage indexed (to the resolution limit).

The Large text toolbar button enlarges the markers and labels.

Clicking on the plot

At LCLS, clicking on a point in the strong spots or resolution panel opens that image in the DIALS image viewer, with its strong spots and, if it indexed, its indexed reflections overlaid. The viewer stays open and loads a new image on each click. The matplotlib toolbar's zoom and pan modes must be off for clicks to be interpreted this way.

Per-run view

With Show set to Per run, each selected run is one point, so a whole experiment of hundreds of runs fits on the screen and stays quick to refresh.

  • The upper panel plots four rates as a percentage of the run's frames: hits (images with at least # strong spots cutoff spots), indexed, high quality (indexed to the high resolution limit) and solvent (the solvent hit criterion). The lines use the same colours as the per-shot view.
  • The lower panel is a bar of frames per run, coloured by job status: grey for finished, yellow for running or queued, red for failed. Runs that are not finished are labelled with their status.
  • With Show table ticked, a table under the plot lists the counts per run (frames, hits, solvent, indexed, lattices, high quality, with percentages, and the job status) and a total row. Select cells, rows or columns and press Ctrl+C to copy them as tab-separated text, ready to paste into a spreadsheet; Ctrl+A selects all.

Selecting many runs for the first time fills the view in a few runs at a time: runs not yet shown appear as gaps in the lines and blank rows in the table, a note in the plot says how many are still to come, and the total row says how many runs it covers. Later refreshes are quick, since finished runs are not re-read. The same counts are printed on the command line by xfel.print_run_stats trial=N.

Image lists (LCLS XTC processing)

When the processing back end is cctbx.xfel.xtc_process, two lists appear on the right:

  • Strongest Indexed Images: images that indexed and have at least # strong spots cutoff spots, with their file paths. Open images opens the first # images to dump of them in dials.image_viewer with their indexed reflections (converting them from the XTC stream first if they were not dumped).
  • Strong Images that Didn't Index: images with many strong spots that failed to index, the ones to look at when the indexing rate is lower than the hit rate suggests it should be. Dump images extracts them from the XTC stream with cctbx.xfel.xtc_dump into the job's all/ folder and opens them in the image viewer.

Both commands run in the background; their output appears in the terminal. With the standard cctbx.xfel.process back end these lists are hidden; use the Dump all images to disk option in LCLS options and look in the all/ folder instead.

Typical use

  • During collection: select the current trial, press Auto plot last five runs, and watch the hit rate (grey and blue points, green line) to judge sample delivery, and the indexing rate (blue line) and resolution (orange) to judge data quality.
  • Reviewing an experiment: switch to Per run, press Auto plot entire experiment, and look for runs whose hit or indexing rate stands out; copy the table into a spreadsheet for the record.
  • Tuning spot finding: create a trial with Index off, and compare the strong-spot counts of a few runs between trials with different spot finding thresholds. Then open the strongest images to confirm that the spots found are real.
  • Diagnosing indexing: if many images have plenty of strong spots but did not index (grey points high in panel 1), check the unit cell and space group in the trial, the detector distance and beam centre in the run block, and look at a few of those images.