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`
SplitSelfies
​
SplitSelfies
[selfies]
returns the symbols of the SELFIES string one-by-one with order preserved.
​
​
SplitSelfies[{
s
1
,
s
2
,…}]
returns a list of results.
​
Details and Options

Examples  
(3)
Basic Examples  
(2)
Split a SELFIES string:
In[1]:=
SplitSelfies
["[C][O][C]"]
Out[1]=
{[C],[O],[C]}
​
Find all the tokens in a medium-sized molecule's SELFIES string:
In[1]:=
split=
SplitSelfies

ToSelfies
Molecule
Formula:
C
35
H
43
Cl
N
2
O
7
Atoms:
88
Bonds:
90

Out[1]=
{[C],[O],[C],[=C],[C],[=C],[Branch2],[Branch1],[#Branch2],[C],[C@H1],[N],[C],[=Branch1],[C],[=O],[/C],[=C],[/C],[C@@H1],[Branch1],[#C],[C@H1],[Branch1],[C],[C],[/C],[=C],[/C],[=C],[C],[=C],[C],[=C],[Ring1],[=Branch1],[O],[C],[=Branch1],[C],[=O],[C@H1],[Branch1],[#Branch1],[C],[C],[Branch1],[C],[C],[C],[O],[C],[=Branch1],[C],[=O],[C@H1],[Branch1],[C],[C],[C],[N],[C],[Ring2],[Ring2],[C],[=O],[C],[=C],[Ring2],[Ring2],[#Branch2],[Cl]}
Shuffle the tokens and rejoin them to create a different molecule:
In[2]:=
SeedRandom[12345];​​Molecule
FromSelfies
[StringJoin[RandomSample[split]]]
Out[2]=
Molecule
Formula:
C
20
H
25
N
O
6
Atoms:
52
Bonds:
51

Applications  
(1)

TechNotes
▪
Generating Molecules With SELFIES
RelatedGuides
▪
Selfies Functions
RelatedLinks
▪
Self-referencing embedded strings (SELFIES): A 100% robust molecular string representation
See Also
Molecule
""

© 2025 Wolfram. All rights reserved.

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