I am trying to use a program such as Vesta or Avogadro to build a super cell from a .cif file for a molecular crystal. In neither program can I seem to figure out how to order the output of the coordinates. For example, I would like atom1-molecule1, atom2-molecule1, atom3-molecule1, followed by atom1-molecule2, atom2-molecule2, atom3-molecule2, etc., but I cannot seem to do so. How do I do this? It seems I can sort by x, y, z, or element type, but not by molecule, which I don't understand. If not with these tools, is there some other one to use?

  • $\begingroup$ VESTA's structural input files are usually specified in the POSCAR format (from VASP): vasp.at/wiki/index.php/POSCAR. Line 5 contains the names of the elements and the atomic positions follow that order. This should directly tell you the atoms and their coordinates. But with regard to molecules, I am not sure if that's possible to separate it atleast on VESTA. Basically, this can tell you atom1, atom2 etc but not molecule1, molecule2 because the input takes only elements. $\endgroup$
    – Xivi76
    Feb 22, 2021 at 7:07

2 Answers 2


One option is to use the Atomic Simulation Environment's sort function. The function ase.build.sort() takes a required Atoms object (e.g. the supercell of the original CIF) and an optional tags argument that allows you to sort however you wish. It's then just up to you to find out how to flag each individual molecule in the order that you'd like.

  • $\begingroup$ Thanks, how do I load the supercell in the Atomic Simulation Environment? As an .xyz file? $\endgroup$
    – user1
    Feb 22, 2021 at 8:04
  • 1
    $\begingroup$ If you have a .cif, you can read that in using from ase.io import read and then atoms = read('MyStructure.cif'). You can even use ASE to generate the supercell from a unit cell via something like atoms = atoms*(2,2,2) to make a 2x2x2 supercell upon definition of atoms. See here for more info. $\endgroup$ Feb 23, 2021 at 4:36
  • $\begingroup$ Thanks. I am following up on this now. When I import the .cif file, I get the following warning: "UserWarning: crystal system 'monoclinic' is not interpreted for space group Spacegroup(14, setting=1). This may result in wrong setting!" Is there something I need to do to avoid the wrong parameters? I realize this isn't quite germane to my initial query. $\endgroup$
    – user1
    Mar 7, 2021 at 5:05
  • $\begingroup$ It probably is fine, but you should double-check the structure to be sure. If it has issues, rewrite the original CIF using another program (e.g. VESTA) and read the new CIF with ASE. It's complaining about the formatting a bit. $\endgroup$ Mar 8, 2021 at 6:12

This is in Avogadro 1.2.0. I will check behavior on Avogadro 2 later:

  1. File -> Open -> Choose your cif file
  2. Build -> Super Cell Builder -> Choose the number of repeats
  3. File -> Save As -> Choose desired file type (XYZ and PDB work. Avogadro 1.2.0 seems to lock up on my system when I try to write mol2 files by this procedure.

I would guess that maybe you tried this already, so maybe there is some problem with related to the cif file you are using. If the above doesn't work, maybe you could try with another cif file.

  • $\begingroup$ Thanks, but that's exactly what I tried using Avogadro 1.2.0. Unfortunately, it jumbles the output, as I alluded to in my initial post. $\endgroup$
    – user1
    Feb 23, 2021 at 17:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .