6
$\begingroup$

I have 100 .cif files. I want to convert them all to .vesta files through vesta software (https://jp-minerals.org/vesta/en/download.html). I know I can choose them one by one and convert them. Is there any method better than this?

Example of .cif file:

data_image0
_cell_length_a       18.685
_cell_length_b       11.722
_cell_length_c       9.244
_cell_angle_alpha    90
_cell_angle_beta     91.771
_cell_angle_gamma    90

_symmetry_space_group_name_H-M    "P 1"
_symmetry_int_tables_number       1

loop_
  _symmetry_equiv_pos_as_xyz
  'x, y, z'

loop_
  _atom_site_label
  _atom_site_occupancy
  _atom_site_fract_x
  _atom_site_fract_y
  _atom_site_fract_z
  _atom_site_thermal_displace_type
  _atom_site_B_iso_or_equiv
  _atom_site_type_symbol
  Ba1      1.0000 0.47790  0.69163  0.50773  Biso   1.000  Ba
  O1       1.0000 0.32620  0.78370  0.51070  Biso   1.000  O
  O2       1.0000 0.57370  0.66390  0.28140  Biso   1.000  O
  C1       1.0000 0.63400  0.67060  0.34230  Biso   1.000  C
  C2       1.0000 0.68510  0.49430  0.21710  Biso   1.000  C
  O3       1.0000 0.64950  0.74370  0.44150  Biso   1.000  O
  N1       1.0000 0.75820  0.62390  0.35530  Biso   1.000  N
  C3       1.0000 0.69280  0.59200  0.30020  Biso   1.000  C
  N2       1.0000 0.74430  0.42960  0.18470  Biso   1.000  N
  C4       1.0000 0.80920  0.46570  0.23460  Biso   1.000  C
  H1       1.0000 0.85040  0.42770  0.20760  Biso   1.000  H
  C5       1.0000 0.61350  0.45010  0.16440  Biso   1.000  C
  O4       1.0000 0.58760  0.48970  0.04290  Biso   1.000  O
  O5       1.0000 0.58440  0.37560  0.23660  Biso   1.000  O
  H2       1.0000 0.33420  0.76070  0.42010  Biso   1.000  H
  H3       1.0000 0.35810  0.81490  0.55970  Biso   1.000  H
  C6       1.0000 0.81440  0.56110  0.32780  Biso   1.000  C
  H4       1.0000 0.85860  0.57980  0.37060  Biso   1.000  H
  Ba2      1.0000 0.97790  0.19163  0.50773  Biso   1.000  Ba
  O6       1.0000 0.82620  0.28370  0.51070  Biso   1.000  O
  O7       1.0000 0.07370  0.16390  0.28140  Biso   1.000  O
  C7       1.0000 0.13400  0.17060  0.34230  Biso   1.000  C
  C8       1.0000 0.18510  0.99430  0.21710  Biso   1.000  C
  O8       1.0000 0.14950  0.24370  0.44150  Biso   1.000  O
  N3       1.0000 0.25820  0.12390  0.35530  Biso   1.000  N
  C9       1.0000 0.19280  0.09200  0.30020  Biso   1.000  C
  N4       1.0000 0.24430  0.92960  0.18470  Biso   1.000  N
  C10      1.0000 0.30920  0.96570  0.23460  Biso   1.000  C
  H5       1.0000 0.35040  0.92770  0.20760  Biso   1.000  H
  C11      1.0000 0.11350  0.95010  0.16440  Biso   1.000  C
  O9       1.0000 0.08760  0.98970  0.04290  Biso   1.000  O
  O10      1.0000 0.08440  0.87560  0.23660  Biso   1.000  O
  H6       1.0000 0.83420  0.26070  0.42010  Biso   1.000  H
  H7       1.0000 0.85810  0.31490  0.55970  Biso   1.000  H
  C12      1.0000 0.31440  0.06110  0.32780  Biso   1.000  C
  H8       1.0000 0.35860  0.07980  0.37060  Biso   1.000  H
  Ba3      1.0000 0.52210  0.69163  0.99227  Biso   1.000  Ba
  O11      1.0000 0.67380  0.78370  0.98930  Biso   1.000  O
  O12      1.0000 0.42630  0.66390  0.21860  Biso   1.000  O
  C13      1.0000 0.36600  0.67060  0.15770  Biso   1.000  C
  C14      1.0000 0.31490  0.49430  0.28290  Biso   1.000  C
  O13      1.0000 0.35050  0.74370  0.05850  Biso   1.000  O
  N5       1.0000 0.24180  0.62390  0.14470  Biso   1.000  N
  C15      1.0000 0.30720  0.59200  0.19980  Biso   1.000  C
  N6       1.0000 0.25570  0.42960  0.31530  Biso   1.000  N
  C16      1.0000 0.19080  0.46570  0.26540  Biso   1.000  C
  H9       1.0000 0.14960  0.42770  0.29240  Biso   1.000  H
  C17      1.0000 0.38650  0.45010  0.33560  Biso   1.000  C
  O14      1.0000 0.41240  0.48970  0.45710  Biso   1.000  O
  O15      1.0000 0.41560  0.37560  0.26340  Biso   1.000  O
  H10      1.0000 0.66580  0.76070  0.07990  Biso   1.000  H
  H11      1.0000 0.64190  0.81490  0.94030  Biso   1.000  H
  C18      1.0000 0.18560  0.56110  0.17220  Biso   1.000  C
  H12      1.0000 0.14140  0.57980  0.12940  Biso   1.000  H
  Ba4      1.0000 0.02210  0.19163  0.99227  Biso   1.000  Ba
  O16      1.0000 0.17380  0.28370  0.98930  Biso   1.000  O
  O17      1.0000 0.92630  0.16390  0.21860  Biso   1.000  O
  C19      1.0000 0.86600  0.17060  0.15770  Biso   1.000  C
  C20      1.0000 0.81490  0.99430  0.28290  Biso   1.000  C
  O18      1.0000 0.85050  0.24370  0.05850  Biso   1.000  O
  N7       1.0000 0.74180  0.12390  0.14470  Biso   1.000  N
  C21      1.0000 0.80720  0.09200  0.19980  Biso   1.000  C
  N8       1.0000 0.75570  0.92960  0.31530  Biso   1.000  N
  C22      1.0000 0.69080  0.96570  0.26540  Biso   1.000  C
  H13      1.0000 0.64960  0.92770  0.29240  Biso   1.000  H
  C23      1.0000 0.88650  0.95010  0.33560  Biso   1.000  C
  O19      1.0000 0.91240  0.98970  0.45710  Biso   1.000  O
  O20      1.0000 0.91560  0.87560  0.26340  Biso   1.000  O
  H14      1.0000 0.16580  0.26070  0.07990  Biso   1.000  H
  H15      1.0000 0.14190  0.31490  0.94030  Biso   1.000  H
  C24      1.0000 0.68560  0.06110  0.17220  Biso   1.000  C
  H16      1.0000 0.64140  0.07980  0.12940  Biso   1.000  H
  Ba5      1.0000 0.52210  0.30837  0.49227  Biso   1.000  Ba
  O21      1.0000 0.67380  0.21630  0.48930  Biso   1.000  O
  O22      1.0000 0.42630  0.33610  0.71860  Biso   1.000  O
  C25      1.0000 0.36600  0.32940  0.65770  Biso   1.000  C
  C26      1.0000 0.31490  0.50570  0.78290  Biso   1.000  C
  O23      1.0000 0.35050  0.25630  0.55850  Biso   1.000  O
  N9       1.0000 0.24180  0.37610  0.64470  Biso   1.000  N
  C27      1.0000 0.30720  0.40800  0.69980  Biso   1.000  C
  N10      1.0000 0.25570  0.57040  0.81530  Biso   1.000  N
  C28      1.0000 0.19080  0.53430  0.76540  Biso   1.000  C
  H17      1.0000 0.14960  0.57230  0.79240  Biso   1.000  H
  C29      1.0000 0.38650  0.54990  0.83560  Biso   1.000  C
  O24      1.0000 0.41240  0.51030  0.95710  Biso   1.000  O
  O25      1.0000 0.41560  0.62440  0.76340  Biso   1.000  O
  H18      1.0000 0.66580  0.23930  0.57990  Biso   1.000  H
  H19      1.0000 0.64190  0.18510  0.44030  Biso   1.000  H
  C30      1.0000 0.18560  0.43890  0.67220  Biso   1.000  C
  H20      1.0000 0.14140  0.42020  0.62940  Biso   1.000  H
  Ba6      1.0000 0.02210  0.80837  0.49227  Biso   1.000  Ba
  O26      1.0000 0.17380  0.71630  0.48930  Biso   1.000  O
  O27      1.0000 0.92630  0.83610  0.71860  Biso   1.000  O
  C31      1.0000 0.86600  0.82940  0.65770  Biso   1.000  C
  C32      1.0000 0.81490  0.00570  0.78290  Biso   1.000  C
  O28      1.0000 0.85050  0.75630  0.55850  Biso   1.000  O
  N11      1.0000 0.74180  0.87610  0.64470  Biso   1.000  N
  C33      1.0000 0.80720  0.90800  0.69980  Biso   1.000  C
  N12      1.0000 0.75570  0.07040  0.81530  Biso   1.000  N
  C34      1.0000 0.69080  0.03430  0.76540  Biso   1.000  C
  H21      1.0000 0.64960  0.07230  0.79240  Biso   1.000  H
  C35      1.0000 0.88650  0.04990  0.83560  Biso   1.000  C
  O29      1.0000 0.91240  0.01030  0.95710  Biso   1.000  O
  O30      1.0000 0.91560  0.12440  0.76340  Biso   1.000  O
  H22      1.0000 0.16580  0.73930  0.57990  Biso   1.000  H
  H23      1.0000 0.14190  0.68510  0.44030  Biso   1.000  H
  C36      1.0000 0.68560  0.93890  0.67220  Biso   1.000  C
  H24      1.0000 0.64140  0.92020  0.62940  Biso   1.000  H
  Ba7      1.0000 0.47790  0.30837  0.00773  Biso   1.000  Ba
  O31      1.0000 0.32620  0.21630  0.01070  Biso   1.000  O
  O32      1.0000 0.57370  0.33610  0.78140  Biso   1.000  O
  C37      1.0000 0.63400  0.32940  0.84230  Biso   1.000  C
  C38      1.0000 0.68510  0.50570  0.71710  Biso   1.000  C
  O33      1.0000 0.64950  0.25630  0.94150  Biso   1.000  O
  N13      1.0000 0.75820  0.37610  0.85530  Biso   1.000  N
  C39      1.0000 0.69280  0.40800  0.80020  Biso   1.000  C
  N14      1.0000 0.74430  0.57040  0.68470  Biso   1.000  N
  C40      1.0000 0.80920  0.53430  0.73460  Biso   1.000  C
  H25      1.0000 0.85040  0.57230  0.70760  Biso   1.000  H
  C41      1.0000 0.61350  0.54990  0.66440  Biso   1.000  C
  O34      1.0000 0.58760  0.51030  0.54290  Biso   1.000  O
  O35      1.0000 0.58440  0.62440  0.73660  Biso   1.000  O
  H26      1.0000 0.33420  0.23930  0.92010  Biso   1.000  H
  H27      1.0000 0.35810  0.18510  0.05970  Biso   1.000  H
  C42      1.0000 0.81440  0.43890  0.82780  Biso   1.000  C
  H28      1.0000 0.85860  0.42020  0.87060  Biso   1.000  H
  Ba8      1.0000 0.97790  0.80837  0.00773  Biso   1.000  Ba
  O36      1.0000 0.82620  0.71630  0.01070  Biso   1.000  O
  O37      1.0000 0.07370  0.83610  0.78140  Biso   1.000  O
  C43      1.0000 0.13400  0.82940  0.84230  Biso   1.000  C
  C44      1.0000 0.18510  0.00570  0.71710  Biso   1.000  C
  O38      1.0000 0.14950  0.75630  0.94150  Biso   1.000  O
  N15      1.0000 0.25820  0.87610  0.85530  Biso   1.000  N
  C45      1.0000 0.19280  0.90800  0.80020  Biso   1.000  C
  N16      1.0000 0.24430  0.07040  0.68470  Biso   1.000  N
  C46      1.0000 0.30920  0.03430  0.73460  Biso   1.000  C
  H29      1.0000 0.35040  0.07230  0.70760  Biso   1.000  H
  C47      1.0000 0.11350  0.04990  0.66440  Biso   1.000  C
  O39      1.0000 0.08760  0.01030  0.54290  Biso   1.000  O
  O40      1.0000 0.08440  0.12440  0.73660  Biso   1.000  O
  H30      1.0000 0.83420  0.73930  0.92010  Biso   1.000  H
  H31      1.0000 0.85810  0.68510  0.05970  Biso   1.000  H
  C48      1.0000 0.31440  0.93890  0.82780  Biso   1.000  C
  H32      1.0000 0.35860  0.92020  0.87060  Biso   1.000  H
  Cu1      1.0000 0.75000  0.75000  0.50000  Biso   1.000  Cu
  Cu2      1.0000 0.25000  0.75000  0.00000  Biso   1.000  Cu
  Cu3      1.0000 0.25000  0.25000  0.50000  Biso   1.000  Cu
  Cu4      1.0000 0.75000  0.25000  0.00000  Biso   1.000  Cu 

update 1 I tried to convert the .cif file to .vesta file using the command line interface. The conversion was done without error but while I open the converted file in VESTA software, it shuts down.

The errors I received are as follows:

(VESTA-gui:78659): Gtk-WARNING **: 23:55:37.970: Negative content width -2 (allocation 32, extents 17x17) while allocating gadget (node button, owner GtkButton)

(VESTA-gui:78659): Gtk-WARNING **: 23:55:37.970: Negative content width -2 (allocation 32, extents 17x17) while allocating gadget (node button, owner GtkButton)
Segmentation fault (core dumped)

`

$\endgroup$
1

2 Answers 2

7
$\begingroup$

VESTA has the possibility to be operated via Command Line Interface.

For a one single file conversion, you can use:

VESTA -nogui -open in.cif -save *.vesta out.vesta

The parameters there are:

  • -nogui: to not open/work VESTA using the Graphical User Interface (normal mode).
  • -open: Read a file and visualize it (as we are using -nogui, there is no visualization).
  • -save format: to export a file in the specified format (take a look here for details.

Now, if you have multiple CIF files and want to convert in serial mode, automatically, you can use the batch script below:

#!/bin/bash
# Convert CIF file to VESTA format using VESTA command line interface
#
for file in *.cif; do
    extension="${file##*.}"
    filename="${file%.*}"
    VESTA -nogui -open file -save *.vesta $filename.vesta
done

Save the script as something like cif2vesta.sh, and execute it using sh cif2vesta.sh in the folder with your CIF files.

$\endgroup$
5
  • $\begingroup$ Thank you so much. File conversion can be done using the above suggestions, but while I open the converted file in VESTA software, I receive the following error: (VESTA-gui:78659): Gtk-WARNING **: 23:55:37.970: Negative content width -2 (allocation 32, extents 17x17) while allocating gadget (node button, owner GtkButton) (VESTA-gui:78659): Gtk-WARNING **: 23:55:37.970: Negative content width -2 (allocation 32, extents 17x17) while allocating gadget (node button, owner GtkButton) Segmentation fault (core dumped) $\endgroup$
    – Sanu
    Mar 29, 2023 at 18:35
  • $\begingroup$ Can you upload the converted file to a paste bin/GitHub gist and link it here? $\endgroup$
    – Doryx
    Mar 29, 2023 at 18:40
  • $\begingroup$ We have updated the question now. $\endgroup$
    – Sanu
    Mar 30, 2023 at 6:46
  • 1
    $\begingroup$ @Doryx we have the "Modeling Matters" GitHub repo for that: mattermodeling.meta.stackexchange.com/q/393/5 $\endgroup$ Mar 30, 2023 at 11:45
  • $\begingroup$ Wow that is awesome! $\endgroup$
    – Doryx
    Mar 30, 2023 at 19:24
5
$\begingroup$

Atomsk

You can use Atomsk package to convert cif files to .vesta.

Here you can find the supported file formats and here how to convert multiple files at the same time.

$\endgroup$

You must log in to answer this question.

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