First steps in XP
 

The RES file
There are two types of text files used during the SHELXL/XP refinement process, both of which are very similar - mainly containing refinement instruction lines and the structural model in form of atom lines. The INS file is used by SHELXL and therefore explained in detail later, whereas the RES file, which is produced by SHELXS and SHELXL, always contains the most recent model, either of the refinement or the raw model suggestion resulting from the solution try. (See flowchart scheme in the introductory chapter). There is one important additional feature of the RES file not found in the INS file: the newly determined difference electron density peaks, being possible atoms, are listed at the end of the file. 
At the beginning of the refinement procedure, atoms have been assigned to none or almost none of those peaks yet, so they are called 'Q', symbolizing a still unknown atom type. 

The RES file created during the structure solution (attempt) is called momo-new.res for the tutorial structure. If you like, you can view this file using nedit. 
However, the instructions in the first part of it are not needed now (they will be copied to the next INS file later) and information about the peak positions is also displayed inside XP, so there is no need to look at the file now. As far as the parameters in the atom lines are relevant to the refinement, they are also discussed later in the SHELXL chapter.

Using XP
It is almost impossible to identify a three-dimensional structure just by looking at the atom coordinates x,y and z. A graphical view at the model is much easier, especially if it is possible to rotate such a 3D-model projection on the screen. The interpretation is even more simplified if connections are drawn between those (possibly atomic) peak positions, that have a distance suited for a chemical bond. The one purpose of the program XP therefore is the graphical visualization of structure solution and refinement models, helping the user with the chemical interpretation. The other task is the editing of the model, i.e. the assignment of atom types to identified peaks and the removal of wrong peaks. 

XP is started with the command xp namexp momo-new in your case. It reads RES files as default, but it can also read INS files, if the extension .ins is also given. 
XP is not run in the terminal, but with its own window, like XPREP before. First you get some introductory text: 
 
 
XP is controlled using a certain syntax of commands typed after a command prompt (similar to Linux). The commands are always four letters long and some of them require additional parameters. The most frequently used commands are explained in the following text anyway, but if you should need more detailed information, type help to get a list of all commands available. Then, help [command] displays the corresponding explanations.

Coordinates, distances and connectivity

The first XP command is usually fmol.
Fmol builds a connectivity table for the atom and peak positions read in with the actual file. This means that connections between positions closer than a certain value are defined automatically and will be drawn as bonds in the display later. Example: Q1 is assumed to be bound to Q6, Q13, Q45 und Q48, because it is close enough to them. Note that there is no limit to prevent peaks too close to each other for being bonded chemically (say less than 0.7 A) from getting connected. 
 

 
Another comment on coordinates and distances: Distances are of course calculated in a rectangular (i.e. cartesian) coordinate system, using the unit Angstrom. (This is crystallography-specific, chemists are rather used to the SI unit picometer). The crystallograhic coordinate system however is defined by the unit cell, which is not rectangular for triclinic, monoclinic and trigonal/hexagonal space groups. The fractional coordinates used in crystallography refer to the cell edges, e.g. x = 0.5 means half of edge a. If the space group has got orthogonal axes like in our case (orthorhombic), you just multiply this fraction with the length of the cell axis to obtain the cartesian value, e.g. 5 A for the upper example if the cell edge a is 10 A long. For non-rectangular space groups, a more complicated matrix has to be used to transform the coordinates. 
To get information about Q's and atoms, type info.
 
 
All positions of the asymmetric unit are listed, if no arguments are given to info. There are no atoms yet, but only Q peaks. As you can see, the fractional cell coordinates x, y and z are specified. The peaks are numbered according to their heights, which are given in the last column. It is justified to assume that the highest electron density peaks belong to those atoms with the most electrons. Note that the peak list is not neccessarily sorted by number/height. 

Viewing the model

For the bond model defined with fmol, an interactive projection is started typing the command proj


 
Graphics are displayed in a separate window. Here you see the asymmetric unit of the structure with all peaks and their bonds, drawn in green (the default peak color). On the right hand side, there is a button menu. Clicking on the appropriate button you can rotate the molecule around three orthogonal axes, display the peak names (label) or show a stereo projection of the model, for the use of simple two-colored 3D-glasses. With the help of the graphical model, you have to recognize something like a chemical molecule - or at least parts of it - a task, for which some fantasy may be needed. Luckily, the structure is the expected one in our case and with the view adjusted the same way as in the picture, you see two stuctural units that resemble the expected two molecules. At least for the left one a five-membered ring with a long side chain is clearly visible. There seem to be also some peaks that make no chemical sense, thus leading to strange bonds. Remember that this raw model has not yet been refined at all and the difference electron density is not defined very accurately at this early stage, so you can't expect a perfect structure. 

Selecting, deleting and modifying peaks or atoms
All commands affecting atoms and peaks in some way can be applied to limited selections of them. This is done in several ways: Target 'objects' can be explicitly named, e.g. info q1 c4 o7. A range of atoms can be given, e.g. info c4 to c11 or the Dollar-sign $ can be used to select all peaks or atoms of one type, e.g. info $ q. The less parameter is a negative selector, expressions given after 'less' are excluded from selection. 

To decide, which of the Qs of our model should be deleted, the peaks are sorted due to their height. Use the command sort, then show again the atom/peak table, using the info command in the form: info $q
 
 
Looking at the height column, you should notice a 'jumping' decrease starting with Q39 (93.98 -> 44.93). This means that the remaining Qs up to Q52 are likely to have no chemical significance. Note that before the first refinement step, hydrogen atoms usually cannot be distinguished from noise. 
To have a preview on the model without the weak Qs, use a selective proj command: Type proj less q39 to q52
 
 
The model looks much clearer now. There are indeed two molecules present in the asymmetric unit, and they even seem to be quite complete. Having excluded the weak Qs, also the strange bonds have disappeared. 
Now the weak Qs are deleted with the command kill q39 to q52. This means that they are irreversibly removed from the fmol list (and not only temporarily excluded from the display). To get them back, you would have to re-load the RES file and repeat the fmol command. 
Our model looks almost acceptable, except that the correct element types have not yet been assigned to the respective peaks. Doing this is essential to define appropriate atomic scattering factors, which are needed together with the atom coordinates in order to calculate structure factors for the refinement (see next chapter). Identifying the right atom types at the appropriate position may be difficult and need some trials in case of a really unknown structure, in particular when different (similar) chemical possibilities exist. Comparing atomic valences with the given model connectivity and the present bond lengths with theoretical ones is always helpful in that respect. For the tutorial, the task is much easier due to the fact that we actually know the chemical identity of each peak position.

To rename peaks or atoms (thus assigning a new element type) the commands pick or name are used. Using the first one is more convenient if you want to edit a lot of atoms at once, because a graphical session with less typing is then started. However, the model display cannot be rotated during the editing process. Therefore it is very helpful to arrange the model orientaton in a way that no atoms are hidden behind others.
Type mpln to set a favourable orientation of the model automatically. Then, type pick to start editing. 
 
 
The Q's will be edited one after another from the highest to the lowest number. The old names are displayed in a red box in the bottom righthand corner of the edit window. In addition, the currently active Q is ... To rename it, just type the new atom name, e.g. C15 to define a carbon atom. After ending the new label with enter (and also after deleting or skipping the current atom) the selection switches to the next Q. Pressing the space bar will skip the active Q and keep its original label. Pressing the enter key alone will delete the Q. Pressing the backspace key will return to the previous Q, even if it has been deleted before. Important: The escape key quits the pick session without keeping any changes done. To save all modifications so far and exit the process at the current state, use the slash key (/). After the last selection possible, the pick process is ended automatically. Note that the available edit keys are also listed in the yellow top bar. In the upper picture, some atoms have already been assigned. As shown in the yellow bottom bar, the currently active peak is Q21, which is the central side chain position of the left molecule (see labels). It will be labeled C15. Note that also the distances to the neighbouring peaks Q16 and Q18 are listed in the bottom bar. 1.54 A is, by the way, the theoretical C-C single bond length. 
Rename all Q's, so that the result looks like the model in the following picture: 
 

 
We have followed no special conventions while giving the labels. First the ring, then the hydroxycarbonyl sidechain and finally the alkyl sidechain have been numbered. The second (righthand) molecule has got the same numbering, but the labels end with an apostroph. If you compare this model with the final ball-stick model presented in the introductory chapter you might notice that not only the hydrogen atoms are missing (they will be set later), but also that C6 / C6' should rather be carbonyl oxygen atoms. You will see later, for what (didactical) purpose these atoms have been wrongly assigned.

Saving the updated model to a new INS file
Once you have modeled the structure as far as possible, the changes have to be written to a new INS file for the SHELXL refinement. 

Saving the current XP model to an INS file is done with file name, in our case file momo-new-1, the new file will then have the full name momo-new-1.ins. Important: No Q's may be in the fmol list, otherwise they would also be written to the file and appear as wrong peaks in the next RES file. The name of the (most recent) RES file - momo-new.res - has to be given to copy its crystallographic parameters and refinement instructions to the INS file. 
 
 
A word about the use of file names during the refinement: In order to have a record of every step done, it is worth keeping all intermediate files. Therefore, each new INS file after a XP session gets a higher number, starting with momo-new-1 for the first SHELXL job to be run. Both the file names mentioned in the refinement chapter and the files saved in the results folder (./save), are consistent with this strategy. For the experienced SHELXTL user, this may not be necessary. A constant filename is normally used, thus updating the files by overwriting them. 
Now, exit XP with quit and continue with the last (and longest) tutorial chapter about structure refinement