You are here: Home Research / Programming DSR


Small molecule refinement tool

Disordered Structure Refinement (DSR)

The refinement of highly disordered solvents and moieties with SHELXL is an often slow or even difficult task. Therefore these voids frequently are "squeezed out" of the X-ray data. This practice is often not necessary. To help with the routine work of refining disordered solvents the program DSR was developed in Python.




The program-package consists of a simple text-database with fragments of molecules and the DSR program itself. It acts as a preprocessor for SHELXL res-files. The user inserts a special command in the SHELXL .res file and the DSR program reads this information to place a molecular fragment with the desired atoms on the position of the target atoms or Q-peaks, respectively. Bond restraints are applied from the database to the fragment. DFIX restraints can be generated automatically, if desired. Ready to use fragments with senseful restraints can be imported from

Please report bugs or annoying problems to I can only fix bugs that are known to me. Also wishes for new fragments or program features are very welcome!

You may cite DSR (or 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)



You find a graphical user interface for DSR in ShelXle. It has almost the same features as DSR but is fully native integrated into the ShelXle workflow (Tools->DSR Plugin). Just select three source and three target atoms each and you can transfer the desired fragment into your structure. The edit window makes it easy to modify/create fragments. See a Youtube video how it works. You can of course always also use DSR on the command line.

Known bugs

In ShelXle, you might encounter the appearance of black or colored boxes instead of atom labels. This is a known bug in ShelXle. Sadly, I can not do anything against it. You can let the labels appear again if you change the label size by turning the mouse wheel.


User Manual:     DSR-manual.pdf

stable version:

Windows: DSR-setup-211.exe 23.05.2018
Linux: DSR-211-0.noarch.rpm
  dsr-211.deb 23.05.2018
  DSR-211.tar.gz 23.05.2018
Mac: DSR-211.dmg
All systems: previous versions    
Source code:      Github development platform  






Recent Changes:



  • You prefer Olex2? Then you might want to use the FragmentDB plugin. It is a port of DSR to Olex2.
  • You just need a parser for SHELX files? Then you might be interested in my ShelXFile project.


Virus Scanners

Some antivirus scanners don't seem to like DSR. If you have problems installing DSR, please let me know. Most antivirus vendors allow the correction of false-positive virus detections.



Do you like to contribute? You are very welcome! Fork my code at Github ( and send me pull requests, patches, feature requests, ideas ... Do not hesitate to ask how the code of DSR works! You don't have to be the best programmer in the world. You just need some Python knowledge.



You want to talk about DSR or FragmentDB? Join Slack about DSR.


Some molecular fragments are taken from the "Idealized Molecular Geometry Library" of Ilia A. Guzei 
(I. A. Guzei, J. Appl. Cryst. 2014, 47, 806-809).

DSR uses the following Python libraries:  

Fredrik Johansson mpmath: a Python library for arbitrary-precision floating-point arithmetic (version 0.18), December 2013,

A. Hagberg, D. Schult, P. Swart, NetworkX: package for the creation, manipulation, and study of complex networks (version 1.8.1) 2013


DSR is free software and licensed under the beerware license.