File formats

From Jmol
Revision as of 16:33, 21 January 2007 by AngelHerraez (talk | contribs) (script format, inline formats)
Jump to navigation Jump to search

(A timid attempt to compile information on file format specifications. It's far from complete yet.)

(Gaussian) Cube format

Jmol reads Cube files.

Original from Gaussian software (Gaussian website).

Description of Cube Input and Cube Output formats: http://www.nersc.gov/nusers/resources/software/apps/chemistry/gaussian/g98/00000430.htm


Jmol Voxel (JVXL) format

Jmol reads and writes JVXL files.

Unique to Jmol, stores isosurface data.

Documented at http://www.stolaf.edu/academics/chemapps/jmol/docs/misc/JVXL-format.pdf


MOL and SD formats

Jmol reads MOL and SD files (and can write MOL files under some circumstances).

Original from Elsevier MDL.

Official document: http://www.mdl.com/downloads/public/ctfile/ctfile.pdf


PDB format

Jmol reads PDB files.

(Official Protein Data Bank document) Atomic Coordinate Entry Format Description: http://www.pdb.org/pdb/file_formats/pdb/pdbguide2.2/guide2.2_frame.html


Script format

Jmol reads script files, using not the load command, but the script command. These are plain-text files containing commands in the Jmol/Rasmol/Chime syntax, that will modify the way the molecular model is shown. The file can have any extension.


Inline formats

Molecular data are usually contained in an external file and loaded into Jmol using the load command, but they can also be contained within the webpage (or fed into it using JavaScript or PHP, e.g. from a database).

In turn, script commands can also be contained in the molecular file.

To allow for this "inline" formats, several methods are implemented:

[Please, note that these are advanced procedures. For normal needs, they can be avoided in favour of using normal scripting practices.]

Molecular coordinates inline within a webpage

Can be done using direct instructions for the applet or, more easily, using functions in the Jmol.js library: jmolAppletInline, jmolLoadInline, jmolLoadInlineScript.

Molecular coordinates inline within a script or script file

Can de done using the data "model" command (Jmol 11 only).

Script inline within a molecular coordinates file

Scripts can be included after a #jmolscript: tag (case-sensitive). This must be taken as a comment by the molecular file parser, so its location depends on the file format:

  • In a PDB file, use REMARK #jmolscript: in any line, followed by the script commands in the same line.
  • In a MOL file, use an initial space plus #jmolscript: in the third line, followed by the script commands in the same line.
  • In an XYZ file, use #jmolscript: in the second line, followed by the script commands in the same line.

In all cases, the script will be applied after the whole molecule has loaded.