Difference between revisions of "XYZ (format)"

From Open Babel
Jump to: navigation, search
 
m (Adding bold to highlight warning)
 
(6 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
|extensions=xyz
 
|extensions=xyz
 
|mime=chemical/x-xyz
 
|mime=chemical/x-xyz
|url=
+
|url=http://openbabel.sourceforge.net/wiki/XYZ
|notes=
+
|import=Yes
 +
|export=Yes
 +
|version=All
 +
|dimensionality=3D
 
|options=
 
|options=
 
<pre>
 
<pre>
Line 17: Line 20:
 
although no formal specification has been published. Consequently,
 
although no formal specification has been published. Consequently,
 
Open Babel attempts to be extremely flexible in parsing XYZ
 
Open Babel attempts to be extremely flexible in parsing XYZ
format files. Similar formats include [[Tinker
+
format files. Similar formats include [[Tinker XYZ]] and [[UniChem XYZ]] which differ
XYZ]] and [[UniChem XYZ]] which differ
+
 
slightly in the format of the files. (Notably, [[UniChem XYZ]] uses the
 
slightly in the format of the files. (Notably, [[UniChem XYZ]] uses the
 
atomic number rather than element symbol for the first column.)
 
atomic number rather than element symbol for the first column.)
  
Line one of the file contains the number of atoms in the file.<br>
+
* Line one of the file contains the number of atoms in the file.
Line two of the file contains a title, comment, or filename.<br>
+
* Line two of the file contains a title, comment, or filename.
  
 
Any remaining lines are parsed for atom information. Lines start with
 
Any remaining lines are parsed for atom information. Lines start with
Line 33: Line 35:
 
====Output Format====
 
====Output Format====
  
The first line written is the number of atoms in the molecule. Line two is  
+
The first line written is the number of atoms in the molecule  
 +
('''Warning:''' The number of digits is limited to three for some programs, e.g. maestro).
 +
Line two is  
 
the title of the molecule or the filename if no title is defined.
 
the title of the molecule or the filename if no title is defined.
 
Remaining lines define the atoms in the file. The first column is the
 
Remaining lines define the atoms in the file. The first column is the

Latest revision as of 06:40, 28 February 2007

Filename Extensions xyz
Chemical MIME Type chemical/x-xyz
Specification URL http://openbabel.sourceforge.net/wiki/XYZ
Import Yes
Export Yes
Open Babel Version All

Options

        Read Options e.g. -as
        s  Output single bonds only
        b  Disable bonding entirely

Additional Comments

Input Format

The "XYZ" chemical file format is widely supported by many programs, although no formal specification has been published. Consequently, Open Babel attempts to be extremely flexible in parsing XYZ format files. Similar formats include Tinker XYZ and UniChem XYZ which differ slightly in the format of the files. (Notably, UniChem XYZ uses the atomic number rather than element symbol for the first column.)

  • Line one of the file contains the number of atoms in the file.
  • Line two of the file contains a title, comment, or filename.

Any remaining lines are parsed for atom information. Lines start with the element symbol, followed by X, Y, and Z coordinates in angstroms separated by whitespace.

Multiple molecules / frames can be contained within one file.

Output Format

The first line written is the number of atoms in the molecule (Warning: The number of digits is limited to three for some programs, e.g. maestro). Line two is the title of the molecule or the filename if no title is defined. Remaining lines define the atoms in the file. The first column is the atomic symbol (right-aligned on the third character), followed by the XYZ coordinates in "10.5" format, in angstroms. This means that all coordinates are printed with five decimal places.

Example File

12
benzene example
  C        0.00000        1.40272        0.00000
  H        0.00000        2.49029        0.00000
  C       -1.21479        0.70136        0.00000
  H       -2.15666        1.24515        0.00000
  C       -1.21479       -0.70136        0.00000
  H       -2.15666       -1.24515        0.00000
  C        0.00000       -1.40272        0.00000
  H        0.00000       -2.49029        0.00000
  C        1.21479       -0.70136        0.00000
  H        2.15666       -1.24515        0.00000
  C        1.21479        0.70136        0.00000
  H        2.15666        1.24515        0.00000