Evaluate

Basic Examples

Find the SMILES string from a chemical name:“AllowRadicals”:

○
NameToSMILES
["2-amino-14,16-dimethyloctadecan-3-ol"]
In[]:=
CCC(C)CC(C)CCCCCCCCCCC(O)C(C)N
Out[]=

Use a chemical name with defined stereochemistry:

○
NameToSMILES
["(2R,3S,4S,5R)-3-(dimethylamino)-2,4,5-trihydroxyhexanal"]
In[]:=
C[C@@H](O)[C@@H](O)[C@@H]([C@@H](O)C=O)N(C)C
Out[]=

Options

Canonicalized SMILES strings will use aromatic bonds when possible. Use the “Canonicalize” option to toggle this behavior:

○
NameToSMILES
["benzene","Canonicalize"#]&/@{True,False}
In[]:=
{c1ccccc1,C1=CC=CC=C1}
Out[]=

Canonicalization will also make all SMILES strings referring to the same molecule equivalent:

Grid​​{{"Name","Canonicalized","Non-canonical"}}~Join~Functionname,Flatten@name,
○
NameToSMILES
[name,"Canonicalize"#]&/@{True,False}/@{"1,3-dichlorobenzene","2,4-dichlorobenzene","3,5-dichlorobenzene"},DividersCenter
In[]:=
Name
Canonicalized
Non-canonical
1,3-dichlorobenzene
Clc1cccc(Cl)c1
ClC1=CC(=CC=C1)Cl
2,4-dichlorobenzene
Clc1cccc(Cl)c1
ClC1=CC=CC(=C1)Cl
3,5-dichlorobenzene
Clc1cccc(Cl)c1
ClC=1C=CC=C(C1)Cl
Out[]=

The “AllowRadicals” option controls how the name of chemical substituents are handled:

○
NameToSMILES
["methyl","AllowRadicals"#]&/@{True,False}
In[]:=
[CH3],Failure

Input: methyl
Message: methyl could be parsed but OPSIN was unsure of the meaning of the words. This error will occur, by default, if a name is just a substituent
Tag: OpsinParseFailure
Out[]=
○
NameToSMILES
["methyl","AddDummyAtoms"#]&/@{True,False}
In[]:=
{*C,[CH3]}
Out[]=