Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

Selfies

Guides

  • Selfies Functions

Tech Notes

  • Generating Molecules With SELFIES

Symbols

  • EncodingToSelfies
  • FromSelfies
  • SelfiesAlphabet
  • SelfiesCounts
  • SelfiesEncoding
  • SplitSelfies
  • ToSelfies
WolframChemistry`Selfies`
FromSelfies
​
FromSelfies
[selfie]
converts the input SELFIES string to a SMILES string.
​
​
FromSelfies
[{
s
1
,
s
2
,…}]
returns a list of SMILES strings.
​
​
FromSelfies
[s,"Molecule"]
converts the input to
Molecule
objects.
​
Examples  
(2)
Basic Examples  
(2)
Convert a SELFIES string to a SMILES string :
In[1]:=
FromSelfies
["[C][C][C][C][=Branch1][C][=O][S][C@@H1][C][C@@H1][Ring1][Ring1][C]"]
Out[1]=
CCCC(=O)S[C@@H1]1C[C@@H1]1C
Create a molecule:
In[2]:=
FromSelfies
["[C][C][C][C][=Branch1][C][=O][S][C@@H1][C][C@@H1][Ring1][Ring1][C]","Molecule"]
Out[2]=
Molecule
Formula:
C
8
H
14
OS
Atoms:
24
Bonds:
24

​
Convert a list of SELFIES strings to SMILES:
In[1]:=
FromSelfies
[{"[C][C][C@H1][C][=Branch2][Ring2][=Branch2][=N][N][=C][Branch2][Ring1][Ring1][C][=C][Ring1][#Branch1][C][=C][Branch1][Ring1][O][C][C][=Branch1][Ring2][=C][Ring1][Branch2][O][C][C][=C][C][=C][Branch1][=Branch2][C][=Branch1][Ring2][=C][Ring1][=Branch1][O][C][O][C][C]","[C][O][C][C][O][C@H1][C][C@@H1][C@@H1][Branch1][O][C][C@@H1][Ring1][=Branch1][C][C][Branch1][C][C][C][NH2+1][C][C@H1][Branch1][Branch1][C][Ring1][N][=O][C][=Branch1][C][=O][O][C][C]","[C][C@H1][Branch1][=Branch1][C][=Branch1][C][=O][O][N][C][=Branch1][C][=O][C][N]"}]
Out[1]=
{CC[C@H1]1C(=NN=C(C2=C1C=C(OC)C(=C2)OC)C3=CC=C(C(=C3)OC)OC)C,COCCO[C@H1]1C[C@@H1]2[C@@H1](C[C@@H1]1CC(C)C)[NH2+1]C[C@H1](C2=O)C(=O)OCC,C[C@H1](C(=O)O)NC(=O)CN}
Convert a list of SELFIES strings to a list of molecules:
In[2]:=
FromSelfies
[{"[C][C][C@H1][C][=Branch2][Ring2][=Branch2][=N][N][=C][Branch2][Ring1][Ring1][C][=C][Ring1][#Branch1][C][=C][Branch1][Ring1][O][C][C][=Branch1][Ring2][=C][Ring1][Branch2][O][C][C][=C][C][=C][Branch1][=Branch2][C][=Branch1][Ring2][=C][Ring1][=Branch1][O][C][O][C][C]","[C][O][C][C][O][C@H1][C][C@@H1][C@@H1][Branch1][O][C][C@@H1][Ring1][=Branch1][C][C][Branch1][C][C][C][NH2+1][C][C@H1][Branch1][Branch1][C][Ring1][N][=O][C][=Branch1][C][=O][O][C][C]","[C][C@H1][Branch1][=Branch1][C][=Branch1][C][=O][O][N][C][=Branch1][C][=O][C][N]"},"Molecule"]
Out[2]=
Molecule
Formula:
C
22
H
26
N
2
O
4
Atoms:
54
Bonds:
56
,Molecule
Formula:
+
C
19
H
34
N
O
5
Atoms:
59
Bonds:
60
,Molecule
Formula:
C
5
H
10
N
2
O
3
Atoms:
20
Bonds:
19

TechNotes
▪
Generating Molecules With SELFIES
RelatedGuides
▪
Selfies Functions
RelatedLinks
▪
Self-Referencing Embedded Strings (SELFIES): A 100% robust molecular string representationMario Krenn, Florian Haese, AkshatKumar Nigam, Pascal Friederich, Alan Aspuru-Guzik
See Also
ToSelfies
 ▪
Molecule
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com