Skip to main content

GlyLES

testing

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 monomers and side chains you can attach to monomers).

This implementation currently only works for glycans that fulfill certain properties:

  • Linkages have to be explicit, i.e. (a1-4)
  • The structure of the glycan can be represented as a tree of the monomers with maximal branching factor 2.
  • All root monomers (e.g. Glc, but not GlcNAc) from this website (GalNAc is seen as modification of galactose)
  • Some modifications can be added to the monomers, please see the README in the grammar folder for more information on this.

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)

The output for convert can be manifold as well:

  • stdout when specifying no output-related argument, or
  • return as list of tuples if returning=true is set, or
  • writing to an output_file, e.g. convert(glycan="Man(a1-2)Man", output_file="./out.csv").

Any output consists of tuples of the form (input_iupac, smiles). The same also holds for convert_generator which returns tuples of input and smiles strings.

Poetry

To develop this package, I used 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glyles-0.3.1.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glyles-0.3.1-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file glyles-0.3.1.tar.gz.

File metadata

  • Download URL: glyles-0.3.1.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.5 Windows/10

File hashes

Hashes for glyles-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b755e213dcf83b3092f92ba1528a867b593102b28b6eb282e938ecad850a6356
MD5 81b523919f3595f0dab8308475544771
BLAKE2b-256 271c221820821c13065efda0cccabc33854d53bdf724c82dfc9cbb28674f8a04

See more details on using hashes here.

File details

Details for the file glyles-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: glyles-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.5 Windows/10

File hashes

Hashes for glyles-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e2ba6243ec73c6152e0cf4860eba54e638db83a0cb7d328b7a6bbb3a9fe6f90
MD5 6ea299db1beaca7b94d6ef69fd4c705a
BLAKE2b-256 0917a63d71f738f88f131b298cdcb38738c7ebdba744aa11afa8f251bfeb91ef

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

0.5.11

2 files

0.5.10

2 files

0.5.9

2 files

0.5.8

2 files

0.5.7

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

This release

0.3.1 This release

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page