DeepSMILES, a SMILES-like syntax suited to machine learning
Project description
This Python module can convert well-formed SMILES (that is, as writen 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.
The library is used as follows:
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)
Project details
Release history Release notifications
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size deepsmiles-1.0.1-py2.py3-none-any.whl (12.6 kB) | File type Wheel | Python version py2.py3 | Upload date | Hashes View hashes |
Filename, size deepsmiles-1.0.1.tar.gz (8.0 kB) | File type Source | Python version None | Upload date | Hashes View hashes |
Hashes for deepsmiles-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e78a5967868634d9b58a1bb9f5deeaa266a179f27b37fbd631ae53ea5b070ba1 |
|
MD5 | b0fd414c8082500e59de8e7f0d088925 |
|
BLAKE2-256 | c4aac043624e7cdac49811725dfc139423b5092bbf7cccb5a346d63ea0f364c1 |