Difference between revisions of "File formats/Chemical Structure"

From Jmol
Jump to navigation Jump to search
(loading SMILES and JME)
m (JME)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{File_Formats}}
 +
__TOC__
 
Some formats do not specify the 3D or 2D coordinates of atoms in a molecule, but just the chemical structure, that is a list of atoms and of connections (bonds) between them.
 
Some formats do not specify the 3D or 2D coordinates of atoms in a molecule, but just the chemical structure, that is a list of atoms and of connections (bonds) between them.
  
Line 16: Line 18:
 
(quotes may not be necessary, but are recommended for safety)
 
(quotes may not be necessary, but are recommended for safety)
  
This ability was introduced in Jmol 12.0.RC15, using [http://cheminfo.wikispaces.com/smi23d the web service at Indiana University]. Starting with Jmol 12.1.6, [http://cactus.nci.nih.gov/ the NIH Cactus server] is used instead.  
+
<div style="float:right;">
 +
<jmol>
 +
  <jmolApplet>
 +
  <signed>true</signed>
 +
  <size>200</size>
 +
  <color>white</color>
 +
  </jmolApplet>
 +
</jmol>
 +
</div>
 +
Or test it here:
 +
<jmol>
 +
<jmolButton>
 +
  <script>var x=prompt('enter a SMILES string','');if(!x){quit};load @{'$'+x};
 +
  </script>
 +
  <text>enter a SMILES to be loaded</text>
 +
  </jmolButton>
 +
</jmol>
 +
<br style="clear:both;">
 +
 
 +
This ability was introduced in Jmol 12.0.RC15, using [http://cheminfo.wikispaces.com/smi23d the web service at Indiana University]. Starting with Jmol 12.0.15 and 12.1.6, [http://cactus.nci.nih.gov/ the NIH Cactus server] is used instead.  
 
To force the use of a certain server, you can do:
 
To force the use of a certain server, you can do:
 
  smilesUrlFormat = "  "
 
  smilesUrlFormat = "  "
Line 25: Line 46:
 
  <nowiki>smilesUrlFormat="http://cactus.nci.nih.gov/chemical/structure/%FILE/file?format=sdf&get3d=True";</nowiki>
 
  <nowiki>smilesUrlFormat="http://cactus.nci.nih.gov/chemical/structure/%FILE/file?format=sdf&get3d=True";</nowiki>
  
 +
== JME ==
  
== JME ==
+
The '''[https://web.archive.org/web/20181203153343/http://www.molinspiration.com/jme/index.html JME Molecular Editor]''' (or JME Molecule Editor) is a Java applet written by Peter Ertl which allows to draw, edit and display molecules and reactions within a web page.
This is the native format used by the [http://www.molinspiration.com/jme/ JME Molecular Editor] by Peter Ertl. It is a format for 2D drawing, specifying atom identities, coordinates and bonds.
+
 
 +
Its successor, '''[https://jsme-editor.github.io/ JSME Molecule Editor]''', needs no Java and runs in any browser using just JavaScript.
 +
 
 +
The native data format for both JME and JSME is called ''JME format''. They can also import and export other formats.
 +
 
 +
=== JME format (file or text string)===
 +
It is formed by a single line of text, specifying atom identities, coordinates and bonds.
 +
[https://web.archive.org/web/20181203153343/http://www.molinspiration.com/jme/doc/jme_functions.html JME format]
  
 
Jmol can read this format, both from file or from a text string, and make a flat 2D model out of it; then, it adjusts atoms into 3D, adds missing hydrogens and, using the built-in UFF force field minimization, generates a 3D model for the molecule. (The JME format usually does not include hydrogens).
 
Jmol can read this format, both from file or from a text string, and make a flat 2D model out of it; then, it adjusts atoms into 3D, adds missing hydrogens and, using the built-in UFF force field minimization, generates a 3D model for the molecule. (The JME format usually does not include hydrogens).
Line 35: Line 64:
 
or
 
or
 
  load isopentane.jme
 
  load isopentane.jme
where {{file|isopentane.jme}} is a plain-text file with this content (a single line):
+
where {{file|isopentane.jme}} is a plain-text file with this content (everything in a single line):
 
  5 4 C 7.05 -5.74 C 8.27 -7.84 C 4.63 -7.14 C 5.84 -7.84 C 7.05 -7.14 1 5 1 2 5 1 3 4 1 4 5 1
 
  5 4 C 7.05 -5.74 C 8.27 -7.84 C 4.63 -7.14 C 5.84 -7.84 C 7.05 -7.14 1 5 1 2 5 1 3 4 1 4 5 1
  
Line 42: Line 71:
 
Example, for isopentane:
 
Example, for isopentane:
 
  load isopentane.jme filter "noMin"
 
  load isopentane.jme filter "noMin"
 +
 +
In summary, the format of the JME String is as follows (in a single line):
 +
* number of atoms
 +
* number of bonds
 +
* (atomic_symbol x_coord y_coord) for all atoms
 +
* (atom1 atom2 bond_order) for all bonds
 +
For stereo bonds, the bond order is -1 for up and -2 for down from the first to the second atom.
 +
 +
[{{SVN Trunk}}Jmol-datafiles/jme/ Example files].
 +
 +
[[Category:Pages Using Jmol MW Extension]]

Latest revision as of 19:28, 22 November 2022

File Formats

Some formats do not specify the 3D or 2D coordinates of atoms in a molecule, but just the chemical structure, that is a list of atoms and of connections (bonds) between them.

They can be put into text files or be just a text string fed into Jmol (inline loading).

SMILES

This (Simplified Molecular Input Line Entry Specification) is a standard format used for plain-text, single-line description of a chemical structure. It can be thought of as a 1D format, specifying just atoms and their connections, no coordinates. Note that there is more than one variant of SMILES strings. That is, the same chemical compund can be assigned different SMILES depending on the software used to generate the SMILES string or how the structure was drawn (e.g. the order in which atoms and bonds were added).

Jmol can read this format (not from file, just from a text string) as long as it can connect to a server that will do the conversion to a 2D or 3D format. To do this, you put a dollar sign before the SMILES string, or you use the smiles parameter. Note that the unsigned applet is not allowed connection to external servers ad so does not support this method.

Example, for isopentane:

load $CCC(C)C
load "$CCC(C)C"
load smiles "CCC(C)C"

(quotes may not be necessary, but are recommended for safety)

Or test it here:

This ability was introduced in Jmol 12.0.RC15, using the web service at Indiana University. Starting with Jmol 12.0.15 and 12.1.6, the NIH Cactus server is used instead. To force the use of a certain server, you can do:

smilesUrlFormat = "  "

and put between the quotes the url in the proper request format; use %FILE at the position where the SMILES string should be inserted into the url.

Examples:

smilesUrlFormat="http://cheminfov.informatics.indiana.edu/rest/thread/d3.py/SMILES/%FILE";
smilesUrlFormat="http://cactus.nci.nih.gov/chemical/structure/%FILE/file?format=sdf&get3d=True";

JME

The JME Molecular Editor (or JME Molecule Editor) is a Java applet written by Peter Ertl which allows to draw, edit and display molecules and reactions within a web page.

Its successor, JSME Molecule Editor, needs no Java and runs in any browser using just JavaScript.

The native data format for both JME and JSME is called JME format. They can also import and export other formats.

JME format (file or text string)

It is formed by a single line of text, specifying atom identities, coordinates and bonds. JME format

Jmol can read this format, both from file or from a text string, and make a flat 2D model out of it; then, it adjusts atoms into 3D, adds missing hydrogens and, using the built-in UFF force field minimization, generates a 3D model for the molecule. (The JME format usually does not include hydrogens).

Example, for isopentane:

load inline "5 4 C 7.05 -5.74 C 8.27 -7.84 C 4.63 -7.14 C 5.84 -7.84 C 7.05 -7.14 1 5 1 2 5 1 3 4 1 4 5 1"

or

load isopentane.jme

where File icon.gifisopentane.jme is a plain-text file with this content (everything in a single line):

5 4 C 7.05 -5.74 C 8.27 -7.84 C 4.63 -7.14 C 5.84 -7.84 C 7.05 -7.14 1 5 1 2 5 1 3 4 1 4 5 1

By default, Jmol will produce the 3D optimized model. Using the filter "noMin" parameter avoids that and so you will get the model, with atoms adjusted to 3D in preparation for minimization, but without added hydrogens and without the minimization.

Example, for isopentane:

load isopentane.jme filter "noMin"

In summary, the format of the JME String is as follows (in a single line):

  • number of atoms
  • number of bonds
  • (atomic_symbol x_coord y_coord) for all atoms
  • (atom1 atom2 bond_order) for all bonds

For stereo bonds, the bond order is -1 for up and -2 for down from the first to the second atom.

Example files.

Contributors

AngelHerraez