cctbx.xfel GUI/Unit Cell tab
The Unit Cell tab plots histograms of the unit cell parameters of every indexed lattice in a trial, so that you can check that indexing is finding the expected cell, compare samples or conditions, spot polymorphs, and define unit cell clusters for the scaling stage of a dataset to filter on. The plot is redrawn every 15 seconds by the Unit Cell Sentinel while Auto update is ticked.
Back to cctbx.xfel GUI.
Selecting lattices by tag
The tab compares tag sets. Each tag set is a selection of runs from one trial, and each gets its own colour in the histograms.
- Choose the Trial. The Available tags list fills with the tags carried by that trial's runs.
- Tick one or more tags and choose union (runs carrying any of the tags) or intersection (runs carrying all of them). Ticking no tags selects every run in the trial (the set then shows as a blank entry in the list).
- Press Add selection. The set appears in Tag sets to display, named after its tags with (u) or (i) for the mode when there is more than one tag.
- Repeat for further sets, for example one per sample. To drop a set, tick it and press Remove selection; Reset selections clears them all.
Histogram mode
With Plot clusters unticked, the plot shows a histogram for each of a, b, c, α, β and γ for each tag set, with the legend giving the number of lattices and the mean and standard deviation of each parameter.
- Reject outliers: drop lattices whose parameters fall outside 1.5 times the inter-quartile range before plotting, so that a few mis-indexed images do not stretch the axes.
- The matplotlib toolbar zooms and saves the figure, and Large text on the toolbar enlarges the labels.
Cluster mode
With Plot clusters ticked (available only when the uc_metrics package is installed), the lattices of the first tag set are clustered with DBSCAN in the space of a chosen set of cell parameters, the feature vector. The plot shows the clusters projected onto each pair of features, a report of the clusters along the bottom, and beside the projections either a probability plot or a volume histogram (see the options below). Its title names the features used.
The trial's space group decides which parameters are free to vary: by default the clustering uses a, b, c for orthorhombic and lower symmetry, a, c for tetragonal, hexagonal and rhombohedral on hexagonal axes, and a, α on rhombohedral axes. Cubic cells have only one free parameter and cannot be clustered. The space group comes from the trial's indexing parameters, so set one in the trial. The features return to these defaults whenever a trial with a different space group is selected.
- Reject outliers controls whether the cells the clustering left unassigned are drawn, and whether they set the range of the volume histogram.
Cluster options
Options... next to Plot clusters opens the Cluster options dialog:
- Cluster epsilon (default 0.8): the DBSCAN neighbourhood distance. Smaller values give tighter, more numerous clusters.
- Feature vector: tick boxes for a, b, c, α, β and γ. Parameters the space group fixes are greyed out; at least two must be ticked. Add an angle when two populations differ mainly in it, for example two monoclinic forms with different β.
- Plot all pairs of features: with more than three features, draw a corner plot of every pair. Otherwise the plot shows the first three features only, and says so in its title.
- Beside the projections: a Probability plot of each cluster's Mahalanobis distances against a normal distribution (a straight line means a well-formed cluster), or a Cell volume histogram with one step per cluster in the cluster's colour, which is the quickest way to see how the clusters differ in size.
Each clustering writes a covariance file, cluster/cluster_<tag set name>.pickle in the output folder, describing the Gaussian mixture components found (component 0 is the largest). The scaling stage of a dataset can filter lattices with this file (Filter by unit-cell cluster in the Datasets tab), accepting only lattices within a chosen Mahalanobis distance of a chosen component. This is the way to merge only one polymorph when a sample indexes as a mixture.
Tips
- A multi-modal histogram for a single sample usually means a mixture of crystal forms, or an indexing ambiguity producing permuted axes. Try cluster mode, or tighten the unit cell in the trial.
- Compare samples by adding one tag set per sample tag: differences in mean cell between conditions show up directly.
- Large trials can take a while to redraw; untick Auto update once the plot is as you want it.