ADD5a. Defining a Rigid Body

ADD5a. Defining a Rigid Body

Introduction to rigid bodies in TOPAS

TOPAS allows for the description of molecular fragments as rigid bodies, which can then be translated and rotated within the unit cell. In the case where a molecular geometry is well defined and known, the use of rigid bodies can dramatically improve the quality of a refinement over the free refinement of x, y and z coordinates for each atom. There are two main ways in which molecular fragments can be described in TOPAS; point_for_site and z_matrix.

point_for_site

point_for_site allow fragments described in Cartesian coordinates to be moved around within a unit cell. This can work well where there is a very fixed geometry that you need to move within a unit cell. However, refining things like bond lengths are not easy to do. We will not address point_for_site further in this tutorial, but more details can be found in the 'Rigid bodies and bond length restraints' section of the TOPAS Technical Reference manual.

z_matrix

A more flexible way of describing molecules using more chemically descriptive internal coordinates for the molecular is to use z_matrix. This allows for the description of a molecule in terms of its bond lengths and angles. The lengths and angles can be parameters which form part of the refinement or used within penalties. While the use of z_matrix can take some time to get used to, it is ultimately a much more powerful method of describing and refining (flexible) rigid bodies.

The keyword rigid starts the definition of a rigid body in TOPAS. Each atom site that you want to include in the rigid body requires a z_matrix line to describe its position. For example, a simple tetrahedra is defined and described below:

rigid

This defines the start of a rigid body

   z_matrix C

The first site defines the origin of the rigid body. Translations will act directly on this point, and rotations will act around this point.

   z_matrix H1 C 1.0

The second site requires a distance to be defined (along positive the z-axis). This states that H1 is 1.0 Å away from atom C.

   z_matrix H2 C 1.0 H1 109.5

The third site requires a distance and an angle to be defined (in the x-z plane). This states that H2 is also 1.0 Å away from atom C, and the H2–C–H1 angle is 109.5°.

   z_matrix H3 C 1.0 H1 109.5 H2 120

The fourth and all subsequent sites also require a dihedral (torsion) angle to be defined. Here the angle between the planes defined by H3-C-H1 and H3-C-H2 is 120°.

   z_matrix H4 C 1.0 H1 109.5 H3 120

Note that this could equally be described as z_matrix H4 C 1.0 H1 109.5 H2 240.

As molecular become more complicated, in particular in the case of largely planar molecules, the requirement of a unique description of the dihedral angle between sites can become problematic. For this reason, it is common to use 'dummy atoms' to define a local axis system around which to describe the rigid body. These dummy atoms are sites with zero scattering from which the rigid body is defined.

Tutorial instructions

Theses PDF data of paracetamol were collected on the I15-1 XPDF beamline at Diamond. The structure of paracetamol can be found here.

VS Code’s rectangular selection tool is very helpful for this tutorial. Click on a point in the file that you want to edit, and then with Alt + Shift selected click a second point within the file. You will then be able to write over multiple lines at the same time. It is worth playing with this a bit now to save a lot of time later.

Fitting without the use of a rigid body

  1. Start a fresh PDF refinement using "para_100K_pdf.xy" as the filename (TOPAS_for_PDF > 1. PDF data > Select PDF Data File) and in VS Code save the file as 'para_100K_without_rigid.inp'.

  2. Enter a dQ damping with a value of 0.08 (TOPAS_for_PDF > 2. Instrumental parameters > dQ damping).

  3. Load structure from para.cif (TOPAS_for_PDF > 3. Phase information > 3b. add new phase from CIF > i. Read a .CIF File).

  4. Allow the lattice parameters to refine within the monoclinic symmetry. Use VS Code’s rectangular selection to add @ signs before the a, b and c lattice parameters at the same time (see the blue information panel above), and add a @ sign before the be lattice parameter too.

  5. Delete the beq 0.0789 for each atom, and instead add a beq_rcut_rlo_spherical peak shape with some reasonable starting values such as #rcut 3.0 and #rlo 10.0 (again use rectangular selection to do this for all atoms at the same time); we will look at different peak shape functions in more details later on in the tutorial (TOPAS_for_PDF > 3. Phase information > beq peak shape functions > beq spherical with min r and low r cutoffs).

  6. Add view_structure to open a structure viewer where you can watch the structure as the refinement progresses (TOPAS_for_PDF > 3. Phase information > 3b. add new phase from CIF > view_structure).

  7. Include output to CIF so you can compare the results in another software, e.g. VESTA, later (TOPAS_for_PDF > 3. Phase information > output CIF). Edit #filename.cif to be something sensible (just not the same name as the original .cif file!).

    1. VESTA can be downloaded from https://jp-minerals.org/vesta/en/download.html. You can choose the VESTA-win64 option, but if you don’t have admin privileges on your computer you can also downloaded the zip file version, extract it and run the .exe file contained within

  8. Allow all of the atomic coordinates to refine (place an @ sign after x, y and z in each site) and run the refinement in TOPAS, but when asked if you want to update the .inp file with the .out file at the end of the refinement click No. Use the structure viewer to look at how the atoms move during the refinement.

    1. How has the molecular geometry changed?

    2. Use a structure viewer (e.g. VESTA) to look  at the .cif file created, and compare it to the starting para.cif.

  9. You hopefully observed that the structure diverged quickly from the starting model, and now looks unrealistic. Let’s try slowing down the refinement a little by damping the updates after each refinement cycle, so that the atoms will more gently move away from their starting positions. Define a new macro called “Damp” by inserting this line at the top of your inp file:

macro Damp(DampFactor) { update = Val + (Change*(1/Exp(DampFactor/2))); }
  1. You have just created your very first macro to change TOPAS’s behavior! This small block of TOPAS macro code changes the update value for the parameter so that, on conclusion of one refinement cycle, the parameter is updated by only a small proportion of the calculated change from the optimisation. Doing this as a macro simply allows us to change the update keyword so of each atomic position parameter in a more tidy manner, rather than having a lot of code floating around. Add this damping to add the site x, y, z coordinates by adding Damp(5) to each of the coordinates, so each line looks like this (rectangular selection!):

    site C1 x @ 0.1286 Damp(5) y @ 0.1743 Damp(5) z @ -0.0080 Damp(5) occ C 1.0
  2. This Damp macro can help to keep atomic positions near their starting positions in the early stages of a refinement, but should be removed before finalising a refinement as it can prevent a refinement from converging.

  3. Change the filename for the output .cif to Out_CIF_STR("para_100K_without_rigid_damp.cif") so the previous one doesn't get overwritten.

  4. Re-refine the structure and use the structure viewer to look at how the atoms move during the refinement. Use a structure viewer (e.g. VESTA) to compare the output .cif files.