From: Axel Kohlmeyer (
Date: Tue Apr 20 2004 - 01:55:15 CDT

hi guys,

as the person who is probably responsible for that comment in
the xyz-plugin, a few remarks to clear up some confusion.

the remark in the plugin about a comment line does not refer to the
second line (or as i like to call it title line) of the commonly
used version of the xyz format. there are .xyz file in the wild
that have an _additional_ comment _before_ the number of atoms.
this comment is prefixed by a pound sign '#'. so the remark
about a comment line refers to this line.

lubos, would you mind sending me a (small) example file, that does
not load correctly. since there are so many versions of the xyz file
format out there, i tried to make the parser very forgiving.
from the error message your get, i seems it is now too smart
for its own good and gets totally confused.

        axel kohlmeyer.

>>> "JS" == John Stone <> writes:

JS> Lubos,
JS> You used the word "crash", but it sounds like the plugin is just
JS> returning an error message, is this correct? Lets only use the word
JS> "crash" to refer to actual program crashes, so as not to cause confusion. :-)

JS> The comment line isn't read by the current version of the xyzplugin as
JS> you've discovered. This is actually mentioned in the xyzplugin src, but
JS> didn't get mentioned in the plugin documentation page, so I'll fix this
JS> momentarily. Here's the text from the source file:

JS> /*
JS> * XYZ molecule file format:
JS> * XYZ files are a simple molecule file format suitable for output
JS> * by homegrown software since they are very minimalistic. They don't
JS> * even include bonding information.
JS> *
JS> * [ # optional comment line ] comment line (can be blank)
JS> * ^^^ note, this is not supported by the current
JS> * version of this plugin.
JS> * [ N ] # of atoms, required by this xyz reader plugin
JS> * [ molecule name ] name of molecule (can be blank)
JS> * atom1 x y z [optional data] atom name followed by xyz coords
JS> * atom2 x y z [ ... ] and and (optionally) other data.
JS> * ... instead of atom name the atom number in
JS> * atomN x y z [ ... ] the PTE can be given.
JS> *
JS> * Note that this plugin currently ignores everything following the z
JS> * coordinate (the optional data fields).
JS> */

JS> If you want to make a modified xyz plugin to read your files that contain
JS> trajectory information, the best reference to look at would probably be
JS> the code in read_text_timestep() in dcdplugin.c. Essentially, you just
JS> need to set ts->A, ts->B, ts->C, ts->alpha, ts->beta, and ts->gamma
JS> for each timestep and you should be good to go.

JS> Let us know if you need help with this.

JS> John Stone

JS> On Mon, Apr 19, 2004 at 04:16:46PM +0200, Lubos Vrbka wrote:
>> hi all,
>> from the header of the xyzplugin.c file i can see that the comment line
>> (second line in the xyz file) is not supported...
>> when i try to read single frame xyz file with something written on the
>> 2nd line it loads fine.
>> when i try to read multiple frame xyz file with all "2nd lines" blank it
>> also loads fine.
>> however, with a comment written on the second lines (in fact, i store
>> pbc information in format " box x_dim y_dim z_dim" there, it crashes
>> with "ERROR: expecting 220 atoms, found only 221"
>> why is it crashing? from the source it seems it should be skipped...
>> and another question - if i'd like to modify the xyzplugin to support my
>> "format" of xyz file with box information on the second line - could
>> you please tell me where to look for the appropriate code how to store
>> box information for the whole trajectory in the vmd?
>> regards,
>> --
>> Lubos
>> _@_"

JS> --
JS> NIH Resource for Macromolecular Modeling and Bioinformatics
JS> Beckman Institute for Advanced Science and Technology
JS> University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
JS> Email: Phone: 217-244-3349
JS> WWW: Fax: 217-244-6078

Axel Kohlmeyer       e-mail:
Lehrstuhl fuer Theoretische Chemie          Phone: ++49 (0)234/32-26673
Ruhr-Universitaet Bochum - NC 03/53         Fax:   ++49 (0)234/32-14045
D-44780 Bochum
If you make something idiot-proof, the universe creates a better idiot.