# Difference between revisions of "XDSGUI"

XDSGUI is a GUI (graphical user interface) for XDS that is supposed to help both novice and experienced users. It graphically displays the ASCII and cbf files that XDS writes, and can run useful shell commands with a simple mouse click. The design goal of the program is to enable XDS data processing without the commandline, and to supply additional graphical information, in a simple, user-modifiable and user-extensible way.

## How to use the GUI

The program may be used to analyze graphically any existing directory with files earlier written by XDS, or may be used to create these files. It should be started in a terminal window, which will later show the output of the programs that are run (XDS, pointless, XDSCONV, ...).

The user is supposed to use the tabs on the top, from left to right. Thus, one starts with the choice of the processing directory (Projects tab), and then advances to the Frame tab to display a raw dataframe or a .cbf file written by XDS or a .pck file written by XDSSTAT. Within the Frame tab, XDS.INP may be generated; for this to work, a raw dataframe has to be displayed. While still in the Frame tab, untrusted (shaded) areas may be marked with the mouse which will write the appropriate lines to XDS.INP; ORGX ORGY may be corrected if necessary, and the INCLUDE_RESOLUTION_RANGE, EXCLUDE_RESOLUTION_RANGE and TRUSTED_REGION adjusted as required. The latter operations are interactive in the sense that the user modifies the values in the XDS.INP tab, and then checks the result in the Frame tab. In other words, the user moves back and forth between the Frame and the XDS.INP tabs.

After finally moving to the XDS.INP tab, other parameters can be adjusted by the user, and finally XDS may be run by clicking a button. The resulting output files from XDS will then be displayed in the next tabs.

After finishing this first round of processing, the TOOLS tab may be used, which - among other things - offers those three options that I found most useful to optimize the data processing. After choosing (by mouse click) one of these three options, the user should go back to the XDS.INP tab, specify JOBS=DEFPIX INTEGRATE CORRECT, and run XDS again. Ideally, each of the three options should be tried separately, and its effect should be compared with the previous processing to verify that it really improved the processed data - use ISa to decide whether the processing has improved! Those options that improve ISa can then be used in combination.

After CORRECT, the data may be analyzed using the XDSSTAT tab, and the resulting XDS_ASCII.HKL may be converted to e.g. MTZ, using the XDSCONV tab.

## Tabs

The main window of XDSgui has the following sub-windows organized as tabs:

### Projects

stores names of directories which contain files from XDS processing. If none of these is selected, the current directory is used. A new directory may be created. The list of project directories is saved to ~/.xds-gui .

### Frame

to display existing 2-dimensional data frames, or to start XDS data processing by displaying a raw data frame. In the latter case, the "generate XDS.INP" button runs the generate_XDS.INP script to create a first XDS.INP from the header of the raw data frame that is being displayed. (Note: this button needs to be used only once per dataset, all later changes to XDS.INP are done by different means - manual or scripted) The blue circle(s) delineate(s) the area(s) of the detector within TRUSTED_REGION; the green circles correspond to INCLUDE_RESOLUTION_RANGE, and the red hatched regions correspond to EXCLUDE_RESOLUTION_RANGEs. The locations of the circles are not as accurate as those that XDS uses internally, because a simplified formula (and only values from XDS.INP, not the refined ones from XPARM.XDS) is used to calculate the resolution; this e.g. does not take care of detector swingout or otherwise skew geometry.

Untrusted areas can be specified by the user, using two (UNTRUSTED_ELLIPSE; UNTRUSTED_RECTANGLE) or four (UNTRUSTED QUADRILATERAL) right mouse clicks. The resulting areas are shown with red outline, and the keyword/parameter pairs are shown in the XDS.INP tab. Step-by-step:

• "Load" a raw frame or a CBF file (e.g. FRAME.cbf) to have it displayed. The pane can be "dragged" with the left mouse button; the mouse wheel zooms. The parameters in the XDS.INP tab are taken for resolution calculations (i.e. the frame header is not being interpreted in any way).
• if XDS.INP does not yet exist, click "generate XDS.INP" (this will read the header). Check the XDS.INP tab afterwards but then go back to the Frame tab. Note that the current generate_XDS.INP works well for Pilatus, ADSC, MarCCD and some Rigaku detectors; for other kinds of detectors the values marked XXX in XDS.INP have to be filled in manually.
• left-click on "Untrusted areas" -> a pulldown menu appears
• left-click on (say) "Untrusted Rectangle (2 clicks)"
• move mouse pointer to one corner of desired rectangle and right-click.
• move mouse pointer (... a changing rectangle appears ...) to opposite corner and right-click: the rectangle is now fixed, and the UNTRUSTED_RECTANGLE keyword together with its parameters appears in XDS.INP tab, in red letters (you do not have to activate the XDS.INP tab to check it, but of course you could).
• with two more right-clicks you get another rectangle, and so on
• you can choose "Untrusted Ellipse (2 clicks)" or "Untrusted Quadrilateral (4 clicks)" and these work in exactly the same way

Unfortunately this interactive mode of establishing untrusted areas does not currently work well over a ssh (or NXclient) connection, probably because the lines/circles are re-drawn at high frequency. So it is recommended to run the program locally.

### XDS.INP

this shows the current XDS.INP file. Coloured items correspond to the circles of the FRAME tab. Changes can be made with a simple editor, and the new version can be saved. A run of xds_par can be started (and killed).
The XDS.INP tab is directly connected with the FRAME tab; changing a value in the XDS.INP tab results in immediate change in the FRAME tab. This means that e.g. an UNTRUSTED area that was positioned wrongly can be edited or simply removed in the XDS.INP tab.
The origin of XDS.INP does not matter - it may e.g. be derived from a detector template, or written by the beamline software, or obtained by clicking the "generate_XDS.INP" button in the FRAME tab.

### DEFPIX

each tab shows its .LP file, respectively.

### INTEGRATE

shows INTEGRATE.LP on the left side. During the INTEGRATE step, the temporary files are displayed. On the right side, plots of the tabular quantities given for each frame, or for each batch of data are shown. For the refined quantities, only the changes are plotted. THE SIGMAB (beam divergence E.S.D.) and SIGMAR (mosaicity) plots show these quantities estimated from each frame (blue), refined for each batch (green) and averaged over the whole dataset (red horizontal line).
The border between the left and right side of the window may be adjusted with the mouse.

### CORRECT

shows CORRECT.LP on the left, and plots of tabular quantities on the right. The upper line in the I/sigma (unmerged data) plot gives $\displaystyle{ {I/Sigma(I)}^{asymptotic} }$ ([Diederichs, Acta Cryst. (2010). D66, 733-740 http://dx.doi.org/10.1107/S0907444910014836]). The three lines in the Chi^2 plot are the Chi^2 values obtained during scaling, for the ABSORP, MODPIX and DECAY corrections, respectively.
In the lower plots, the colored lines correspond to the nine resolution shells for which values are found in the tables.
The border between the left and right side of the window may be adjusted with the mouse.

### TOOLS

offers possibilities for running short scripts.

Several such scripts are pre-defined; the user may create her own scripts. If scripts are modified, they are saved to ~/.xds-gui . The names of the buttons (e.g. "User defined command 1") can be changed by editing ~/.xds-gui .

### Installation

The current version of the program can be downloaded, by academic users, for Linux 64bit (compiled on RHEL6), 32bit (compiled on RHEL6), 64bit (compiled on RHEL5, statically linked with Qt), 32bit (compiled on RHEL5, statically linked with Qt), or Mac (works on OSX 10.6 and up). Industrial users of XDS: pls contact me directly.

In case of Linux, after downloading the binary file, its name should be changed to "xdsgui" and then be made executable ("chmod a+x xdsgui"). The binary may then be copied into e.g. the directory /usr/local/bin by the administrator, or to the $HOME/bin directory by the user. Any other directory should be suitable as long as it is in your$PATH.

In case of a Mac, the DMG file may be installed in the usual way, by double-clicking it and dragging the icon into the Applications folder. It is advantageous to place a symbolic link, like

ln -s /Applications/xdsgui.app/Contents/MacOS/xdsgui /usr/local/bin/xdsgui


and to start the GUI from a terminal window, by typing xdsgui. In a similar way, XDS-viewer should be put into the $PATH under the name xds-viewer, e.g. using ln -s /Applications/XDS-Viewer.app/Contents/MacOS/xds-viewer-bin /usr/local/bin/xds-viewer  ## Known bugs, problems and workarounds 1. Question concerning TOOLS: "Show frame..." on Mac: it creates everything shown in the commandline but it seem to us that everything runs in the background. Therefore xds-viewer does not open anywhere as it is not seen. Also, it would be great if this image together with the predictions would be re-directed to the FRAME tab. Answer: On Linux, the xds-viewer window is brought to the foreground automatically, whereas on the Mac this does not seem to happen. However, an icon for xds-viewer appears in the dock (on the right) and I can double-click it to see the xds-viewer window. I have no idea how to bring xds-viewer to the foreground automatically, and I need input from people who know Macs and tell me how to do it (on the commandline!). The reason why we do not open automatically in the FRAME tab is that one can have several xds-viewer windows open at the same time, and compare the patterns. As a workaround, you can manually open the resulting temp/FRAME_$X.cbf in the FRAME tab.
2. Another question concerning TOOLS: "Further analyses" on Mac: again pointless runs nicely but there is no output for the user.
Answer: Could it be that you started xdsgui by double-clicking its icon in the Finder? In that case, there is no output visible, because there is no console. Unfortunately, for all the Tools, the output is in the console window where xdsgui was started. We will try to find out how to open a window where the output is then shown. Thus, currently the workaround for this problem is to start xdsgui in a console window.
3. generate_XDS.INP does not seem to like spaces in file/directory names. While frame names rarely have a space in them, directories might, e.g. if an external disk has the label "John's USB disk" then this would be mounted on Linux as /media/John's USB disk/ and that would result in a error message from generate_XDS.INP . The workaround is to use a symlink on a different harddisk.

If you find a bug, please send email to Kay dot Diederichs at uni-konstanz dot de , ideally with enough information/data to reproduce the bug.

## News

program update June 19: Fixes for TRUSTED_REGION on Pilatus, and for XDSCONV tab (thanks Folmer!).

program update July 5: INTEGRATE plot showing crystal rotation; several bugfixes. Commandline name is now xdsgui.