https://github.com/baoilleach/deepsmiles
DeepSMILES - A variant of SMILES for use in machine-learning
https://github.com/baoilleach/deepsmiles
generative-models machine-learning neural-networks smiles
Last synced: 3 months ago
JSON representation
DeepSMILES - A variant of SMILES for use in machine-learning
- Host: GitHub
- URL: https://github.com/baoilleach/deepsmiles
- Owner: baoilleach
- License: mit
- Created: 2018-09-18T09:20:23.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-24T08:07:54.000Z (about 5 years ago)
- Last Synced: 2025-05-11T20:42:59.741Z (about 1 year ago)
- Topics: generative-models, machine-learning, neural-networks, smiles
- Language: Python
- Size: 30.3 KB
- Stars: 137
- Watchers: 7
- Forks: 30
- Open Issues: 6
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
DeepSMILES
==========
This Python module can convert well-formed SMILES (that is, as written by a cheminformatics toolkit) to DeepSMILES. It also does the reverse conversion.
Install the latest version with::
pip install --upgrade deepsmiles
DeepSMILES is a SMILES-like syntax suited to machine learning. Rings are indicated using a single symbol instead of two, while branches do not use matching parentheses but rather use a right parenthesis as a 'pop' operator.
For example, benzene is `c1ccccc1` in SMILES but `cccccc6` in DeepSMILES (where the `6` indicates the ring size). As a branch example, the SMILES `C(Br)(OC)I` can be converted to the DeepSMILES `CBr)OC))I`. For more information, please see the corresponding preprint (https://doi.org/10.26434/chemrxiv.7097960.v1) or the lightning talk at https://www.slideshare.net/NextMoveSoftware/deepsmiles.
The library is used as follows:
.. code-block:: python
import deepsmiles
print("DeepSMILES version: %s" % deepsmiles.__version__)
converter = deepsmiles.Converter(rings=True, branches=True)
print(converter) # record the options used
encoded = converter.encode("c1cccc(C(=O)Cl)c1")
print("Encoded: %s" % encoded)
try:
decoded = converter.decode(encoded)
except deepsmiles.DecodeError as e:
decoded = None
print("DecodeError! Error message was '%s'" % e.message)
if decoded:
print("Decoded: %s" % decoded)