Supported File Formats and Options#
Chemists are a very imaginative group. They keep thinking of new file formats.
Indeed, these are not just simple differences in how chemical data is stored, but often completely different views on molecular representations. For example, some file formats ignore hydrogen atoms as “implicit,” while others do not store bonding information. This is, in fact, a key reason for Open Babel’s existence.
OpenBabel has support for 146 formats in total. It can read 108 formats and can write 107 formats. These formats are identified by a name (for example, ShelX format
) and one or more short codes (in this case, ins
or res
). The titles of each section provide this information (for example, ShelX format (ins, res)).
The short code is used when using obabel or babel to convert files from one format to another:
obabel -iins myfile.ins -ocml
converts from ShelX format to Chemical Markup Language (in this case, no output file is specified and the output will be written to screen [stdout]). In fact, if the filename extension is the same as the file format code, then there is no need to specify the code. In other words, the following command will behave identically:
babel myfile.ins -ocml
As well as the general conversion options described elsewhere (see Options), each format may have its own options for either reading or writing. For example, the ShelX format has two options that affect reading of files, s
and b
. To set a file format option:
For Read Options, precede the option with
-a
at the command lineFor Write Options, precede the option with
-x
For example, if we wanted to set all bonds to single bonds when reading a ShelX format file, we could specify the s
option:
babel -iins myfile.ins -ocml -as
More than one read (or write) option can be specified (e.g. -ax -ay -az
). babel (but not obabel) also allows you to specify several options together (e.g. as -axyz
).
- Developer Note
To set the file formats for an
OBConversion
object, useSetInAndOutFormat(InCode, OutCode)
. To set a Read Options
, useSetOptions("s", OBConversion::INOPTIONS)
.
- Common cheminformatics formats
- Utility formats
- Compare molecules using InChI (k)
- Confab report format (confabreport)
- Copy raw text (copy)
- General XML format (xml)
- Generic Output file format (dat, log, out, output)
- MolPrint2D format (mpd)
- Multilevel Neighborhoods of Atoms (MNA) (mna)
- Open Babel molecule report (molreport)
- Open Babel report format (report)
- Outputs nothing (nul)
- Read and write raw text (text)
- Title format (txt)
- XYZ cartesian coordinates format (xyz)
- Other cheminformatics formats
- Computational chemistry formats
- ABINIT Output Format (abinit)
- ACES input format (acesin)
- ACES output format (acesout)
- ADF Band output format (adfband)
- ADF DFTB output format (adfdftb)
- ADF cartesian input format (adf)
- ADF output format (adfout)
- CAChe MolStruct format (cac, cache)
- CASTEP format (castep)
- Cacao Cartesian format (caccrt)
- Cacao Internal format (cacint)
- Crystal 09 output format (c09out)
- Culgi object file format (cof)
- DALTON input format (dalmol)
- DALTON output format (dallog)
- DMol3 coordinates format (dmol, outmol)
- Extended XYZ cartesian coordinates format (exyz)
- FHIaims XYZ format (fhiaims)
- Fenske-Hall Z-Matrix format (fh)
- GAMESS Input (gamin, inp)
- GAMESS Output (gam, gamess, gamout)
- GAMESS-UK Input (gukin)
- GAMESS-UK Output (gukout)
- GULP format (got)
- Gaussian Input (com, gau, gjc, gjf)
- Gaussian Output (g03, g09, g16, g92, g94, g98, gal)
- Gaussian Z-Matrix Input (gzmat)
- Gaussian formatted checkpoint file format (fch, fchk, fck)
- HyperChem HIN format (hin)
- Jaguar input format (jin)
- Jaguar output format (jout)
- MOPAC Cartesian format (mop, mopcrt, mpc)
- MOPAC Internal (mopin)
- MOPAC Output format (moo, mopout)
- MPQC output format (mpqc)
- MPQC simplified input format (mpqcin)
- Molpro input format (mp)
- Molpro output format (mpo)
- NWChem input format (nw)
- NWChem output format (nwo)
- ORCA input format (orcainp)
- ORCA output format (orca)
- PWscf format (pwscf)
- Parallel Quantum Solutions format (pqs)
- Q-Chem input format (qcin)
- Q-Chem output format (qcout)
- TurboMole Coordinate format (tmol)
- Turbomole AOFORCE output format (aoforce)
- VASP format (CONTCAR, POSCAR, VASP)
- ZINDO input format (zin)
- Molecular fingerprint formats
- Crystallography formats
- Reaction formats
- Image formats
- 2D drawing formats
- 3D viewer formats
- Ball and Stick format (bs)
- Chem3D Cartesian 1 format (c3d1)
- Chem3D Cartesian 2 format (c3d2)
- Chemical Resource Kit 3D format (crk3d)
- Ghemical format (gpr)
- Maestro format (mae, maegz)
- Molden format (mold, molden, molf)
- PCModel Format (pcm)
- UniChem XYZ format (unixyz)
- ViewMol format (vmol)
- XCrySDen Structure Format (axsf, xsf)
- YASARA.org YOB format (yob)
- Kinetics and Thermodynamics formats
- Molecular dynamics and docking formats
- Amber Prep format (prep)
- AutoDock PDBQT format (pdbqt)
- DL-POLY CONFIG (CONFIG)
- DL-POLY HISTORY (HISTORY)
- Dock 3.5 Box format (box)
- GRO format (gro)
- GROMOS96 format (gr96)
- LPMD format (lpmd)
- MDFF format (CONTFF, MDFF, POSFF)
- MacroModel format (mmd, mmod)
- SIESTA format (siesta)
- The LAMMPS data format (lmpdat)
- Tinker XYZ format (txyz)
- XTC format (xtc)
- Volume data formats
- JSON formats
- Miscellaneous formats
- Biological data formats
- Obscure formats