FragmentDB is a fragment database and fitting procedure for Olex2

The success of DSR let me develop a plugin to Olex2 taking advantage of the Olex2 GUI and the simplicity of model building using DSR.

You may cite FragmentDB as

D. Kratzert, I. Krossing, J. Appl. Cryst. 2018, 51, 928-934. doi: 10.1107/S1600576718004508 (direct download)


D. Kratzert, J.J. Holstein, I. Krossing, J. Appl. Cryst. 2015, 48, 933-938. doi:10.1107/S1600576715005580 (download)

FragmentDB was an extension module of Olex2 in version 1.2. Since Olex2 version 1.3, it is an integral part of Olex2 in the Tools menu:

FragmentDB program main window

The FragmentDB is a collection of over 80 molecular fragments in a SQLite database including restraints and a convenient method to fit them in Olex2.

The list of most disagreeable restraints shows all restraints that might be suspicious or wrong. Correction can be made by clicking the "edit" link bringing up an edit window with the relevant atoms and restraints.

Fragment Chooser

Choose the desired fragment from the list in the drop-down menu.


Do an fuzzy search with a partial name by hitting enter key.
For example a search for cf3 finds all the fragments containing cf3 in their name and similar.
The search results in a shortened drop down menu.


The reset button restores the full fragment list after a search.

User Defined Database

The main database is write protected, but you can add and change as many fragments you like. They will be stored in a separate database.Fragments created or changed by the user will get a *user* at the end of their names.

Fragment Picture

A picture of each fragment is displayed. User defined fragments only have pictures if the user provided one.
Click on the picture to display a magnified version of the picture.

Define Properties

Define PART, free variables (FVAR) and the occupancy. A free variable of 3 and an occupancy of 1 means 31.0 in SHELXL notation. -31.0 On the other hand is set with a free variable of -3. The corresponding free variable is assigned automatically.
All parameters will be displayed simultaneously through atomic labels.

Residue Definition

Disable or enable putting the fitted fragment into a residue. The residue number is chosen automatically.
The residue class has to start with a letter and can be up to four characters. Usually, the class provided by the database is sufficient.

You may also add a "SIMU 0.04 0.08 1.0" to restrain atoms in close proximity caused by disorder.

Calculate DFIX

The supplied fragment normally has predefined restraints like SADI, FLAT and others. DFIX Generates DFIX/DANG restraints from the geometry of the fragment and replaces the predefined restraints.


Inverts the coordinates of the fragment. Useful to fit the inverted geometry of the fragment.


The button Fit! starts the fit of the Fragment into the structure.

No Restraints

No restraints will be applied to the fitting fragment.

Replace Mode

If enabled, all atoms inside PART 0 lying in a radius of 1.22A around the atoms of the fitted fragment will be deleted. This is particular useful to replace atoms of a disordered structure just solved using SHELXT.

Edit window:

FragmentDB Edit window

New Fragments can be added to the database using the "Edit" window. It accepts either Atom coordinates as text from other sources or directly from selected atoms inOlex2.

Change Picture

Select a picture for the fragment. Use at least 600dpi pictures.


Save a style file for chemdraw to draw molecular pictures that look the same as the predefined.


Name of the fragment

Unit cell

Cell parameters of the structure, where the fragment comes from. Use 1 1 1 90 90 90 for cartesian coordinates. The cell constants and the coordinates are converted into Cartesian coordinates during the adding to the database.

Use selected atoms

Uses the selected atoms for the Atoms field and creates a picture from the fragment.


Insert atoms here like O2 8 1.3984 -0.3778 0.4922. You can also directly copy atoms from SHELX files or copy coordiinates from Avogadro.


Type any SHELX compatible restraint here (except SAME). The length of a line is unlimited.


Define the residue class of the fragment (up to four characters, the first has to be a letter).


Define the origin of the fragment.


FragmentDB is free software and licensed under the beerware license.