GlyLES
A tool to convert IUPAC representation of Glycans into SMILES representation. This repo is still in the development phase; so, feel free to report any errors or issues.
Specification and (current) Limitations
The exact specification we're referring to when talking about "IUPAC representations of glycan", is given in the "Notes" section of this website. But as this package is still in the development phase, not everything of the specification is implemented yet (especially not all side chains you can attach to monomers).
This implementation currently only works for glycans that fulfill certain properties:
- The structure of the glycan can be represented as a tree of the monosaccharides with maximal branching factor 3.
- Only basic monomers (e.g.
Glc, but notGlcNAc) from this website (GalNAc is seen as modification of galactose). In addition to this list, Erythrose is parsable. - Some modifications can be added to the monomers, please see the README in the grammar
folder for more information on this.
E.g.GlcNAcis seen to be a modified version ofGlc.
Installation
So far, this package can only be downloaded from the python package index. So the installation with pip is very easy.
Just type
pip install glyles
and you're ready to use it as described below. Use
pip install --upgrade glyles
to upgrade the glyles package to the most recent version.
Usage
Convert the IUPAC into a SMILES representation using the handy convert method
from glyles.converter import convert
convert(glycan="Man(a1-2)Man", output_file="./test.txt")
You can also use the convert_generator method to get a generator for all SMILES:
from glyles.converter import convert_generator
for smiles in convert_generator(glycan_list=["Man(a1-2)Man a", "Man(a1-2)Man b"]):
print(smiles)
In general, the convert and convert_generator methods support the same types of input. The samples are shown
for convert but it's the same for convert_generator.
- single glycan, e.g.
convert(glycan="Man(a1-2)Man)", - a list of glycans, e.g.
convert(glycan_list=["Man(a1-2)Man a", "Man(a1-2)Man"]), and - a file of glycans, e.g.
convert(glycan_file="./glycans.txt"). Here its important that the file many only contain one IUPAC per line. - for better runtime one can also provide a generator as input, e.g.
convert(glycan_generator=some_generator)
Any output consists of tuples of the form (input_iupac, smiles). convert_generator returns those tuples in a
generator. convert-output is a bit different:
- By default, the method returns the list of tuples.
- You can print them to
stdoutby specifyingreturning=False. - The tuples can also be written
output_file, e.g.convert(glycan="Man(a1-2)Man", output_file="./out.csv").
Notation of glycans
There are multiple different notations for glycans in IUPAC. So, according to the
SNGF specification, Man(a1-4)Gal, Mana1-4Gal, and Mana4Gal
all describe the same disaccharide. This is also covered in this package as all three notations will be parsed into the
same tree of monosaccharides and result in the same SMILES string.
Poetry
To develop this package, we use the poetry package manager (see here for detailed instruction). It has basically the same functionality as conda but supports the package management better and also supports distinguishing packages into those that are needed to use the package and those that are needed in the development of the package. To enable others to work on this repository, we also publish the exact specifications of our poetry environment.
Metadata
Release files for glyles 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| glyles-0.4.2.tar.gz | 56.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| glyles-0.4.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 117.0 kB
Release files / glyles-0.4.2.tar.gz
| Download URL | glyles-0.4.2.tar.gz |
|---|---|
| Size | 56.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68e16c528e24fea0e9660c2ada0ce89b99df1e5f4bb2f5ffd03ecb60c6eeb24d
|
|
BLAKE2b-256 checksum How to use checksums |
892f14f71fe9861e47c376132315268aa4d656e2238c25528a31032dcdd8e063
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.12 CPython/3.7.6 Linux/4.18.0-372.16.1.el8_6.x86_64
|
Release files / glyles-0.4.2-py3-none-any.whl
| Download URL | glyles-0.4.2-py3-none-any.whl |
|---|---|
| Size | 60.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e25b43d843ce924d1cbe9d212e26064cb4f3ed019b7cc4fc3240f90cd3126420
|
|
BLAKE2b-256 checksum How to use checksums |
11fd9e4bfccc38135812eb65051d08b8396847d71666f9783acbb04ff026d885
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.12 CPython/3.7.6 Linux/4.18.0-372.16.1.el8_6.x86_64
|