12
$\begingroup$

When I open a CIF file of a crystal structure in a typical molecular editor like Avogadro, then I just see a few symmetry-unique atoms scattered around the unit cell. But I don't see the full molecule with all its bonds. What is the easiest way to extract one individual molecular image with all its bonds from a cif file?

The two problems are:

  1. Some atoms are not shown at all if they are not symmetry-unique.
  2. Even if all the atoms are shown, then chemical bonds may go between the images in different unit cells, so that bonds are not properly displayed within the unit cell.

Let me show a screenshot below:

Avogadro screenshot

What I would like to happen is that the part with the orange atoms is moved up one unit cell, so that the carbon atoms attach to the blue nitrogen atoms shown at the top. Similarly all the scattered hydrogens have to be moved to different unit cells so that they attach to the atoms properly. This is clearly not a trivial task but it is something that would be needed whenever a CIF file is opened.

$\endgroup$
  • 1
    $\begingroup$ Could you give a link to the CIF file (if it's publicly available)? $\endgroup$ – marcin Jul 22 '20 at 9:54
10
$\begingroup$

This is due to an unfortunate code-change in some versions of Open Babel. AFAIK, versions 3.0 and later have a heuristic to detect if the CIF contains a molecule, or is a traditional solid-state crystal structure (e.g., NaCl, YBCO, etc.). These versions are used by the latest development versions of Avogadro (1.93 / 1.94 at the moment).

Based on your screenshot, it looks like you're using Avogadro 1.x. There isn't a great way to back-fix this, since I'm not maintaining that code. (I'd much rather just get 2.0 finished and out the door.)

There are two work-arounds:

  • Convert with Open Babel (e.g., CML, MDL, etc.) and read in that
  • Use "fill unit cell" to get all atoms, and build a super-cell if needed.

The patch is here #1823, although it would probably be a pain to apply the patch, rebuild Avogadro 1.x with the older versions of Open Babel it uses, etc.

$\endgroup$
9
$\begingroup$

A command line package I use very often to convert between structure formats (and other things) is c2x. You can download the code from their website, and a quick "c2x --formats" suggests that it supports both cif files and xyz files.

$\endgroup$
  • 1
    $\begingroup$ Thanks! I guess this is similar to OpenBabel. What I am wondering is which programs have the specific capability of locating one molecule in a CIF file even if it is distributed among different unit cells in the crystal structure. $\endgroup$ – Felix Jul 21 '20 at 15:54
8
$\begingroup$

I tried out a few programs. It seems like Jmol and Molden do resolve the CIF structure and directly show me one molecule with all its bonds without requiring any further input.

Other programs like Avogadro or a command-line conversion with OpenBabel just produce the raw data of atoms scattered in the unit cell.

$\endgroup$
7
$\begingroup$

If you're not tethered to Avogadro

You can use Mercury to change the system size by going to calculate, packing, and adjusting the cell size.

$\endgroup$
5
$\begingroup$

If one has access to CCDC's Mercury app, the unique molecules (Z') can be easily written as mol2 or xyz files by the Save As option.

Of course, this requires completely written CIF file (with metadata). Often times, some codes lazily output all coordinates in the unit cell.

$\endgroup$
  • $\begingroup$ gogo: Our % answered as fallen below 90%, can you turn this comment into an answer please? $\endgroup$ – Nike Dattani Jul 28 '20 at 0:38
  • 1
    $\begingroup$ Updated the answer, Nike. $\endgroup$ – gogo Aug 12 '20 at 3:07
4
$\begingroup$

In the case of Avogadro, the process is really straightforward. Go to

File -> Save As

In the pop-up window, you can save the data as .xyz or .mol (among many others) types.

$\endgroup$
  • 2
    $\begingroup$ Hi, thanks for the quick reply! My problem is: Avogadro just shows me a few symmetry-unique atoms scattered around the unit cell. If I save this as xyz, then I still only have the symmetry unique atoms and I don't see the molecule with all its proper bonds. $\endgroup$ – Felix Jul 21 '20 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.