SMILES (.smi)

  • Import can read the canonical and the isomeric version of the SMILES format.

BackgroundBackground

    MIME type: chemical/x-daylight-smiles
    SMILES chemical format.
    Commonly used to describe the structure of chemical molecules.
    SMILES is an acronym for Simplified Molecular Input Line Entry Specification.
    Used in cheminformatics applications and in chemistry databases to represent chemical formulas.
    ASCII format.
    Uses a linear notation to represent the connectivity graph of a molecule.
    Can store data for multiple molecules.
    Developed in the 1980s by Arthur Weininger and David Weininger.

Import and ExportImport and Export

  • Import["file.smi"] imports a file containing an arbitrary number of SMILES strings.
  • Import["file.smi"] converts SMILES data to a list of Wolfram Language expressions representing the graph structures of chemical molecules.
  • Import["file.smi",elem] imports the specified element from SMILES.
  • Import["file.smi",{{elem1,elem2,}}] imports multiple elements.
  • The import format can be specified with Import["file","SMILES"] or Import["file",{"SMILES",elem,}].
  • See the reference pages for full general information on Import.
  • ImportString[string,"SMILES"] converts a SMILES string to an expression.

ElementsElements

  • General Import elements:
  • "Elements"list of elements and options available in this file
    "Rules"full list of rules for each element and option
  • Import by default uses the element when converting from SMILES.
  • Data representation elements:
  • "EdgeRules"connectivity data, given as a list of rules
    "EdgeTypes"bond types, given as a list of strings
    "FormalCharges"charges of the atoms given by
    "VertexTypes"all atoms or groups constituting the molecule, typically given as a list of chemical element abbreviations

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Import the SMILES string for caffeine:

In[1]:=
Click for copyable input
Out[1]=

ChemicalData has SMILES data for all common chemicals:

In[1]:=
Click for copyable input
Out[1]=

The data given by Import or ImportString can be used as input for GraphPlot:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2008
(7.0)
| Updated in 2010
(8.0)