Skip to main content

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 in the issues section.

Specification and (current) Limitations

The exact specification, we're refering 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 fulfil certain properties:

  • Linkages have to be explicit, i.e. (a1-4)
  • The structure of the glycan can be represented as tree of the monomers with maximal branching factor 2.
  • All root monomers (e.g. Glc, but not GlcNAc) from this website
  • Modification such as adding sulfur (e.g. Gal3S), phosphate (e.g. Gal3P) and a NAc-group can be added (e.g. GalNAc).

For an overview of the implemented derivatives, please look at the README in the grammar folder. You can get a python-readable list of the currently included monomers with the following code

from glyles.glycans.factory.factory import MonomerFactory

MonomerFactory().monomer_names()

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.

Workflow

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 generator over 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 supports the same for 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. For convert_generator there is one output. convert supports

  • stdout when specifying no output-related argument, or
  • returned 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").

Here each line of the output will state the input IUPAC and the output SMILES. In case of written output separated with a comma.

Poetry

To develop this package I used the poetry package manager (see here for a 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. In order to enable others to work on this repository, we also publish the exact specifications of out poetry environment.

Metadata

Release files for glyles 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for glyles 0.1.2
File Size Uploaded
glyles-0.1.2.tar.gz 32.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for glyles 0.1.2
File Interpreter ABI Platform
glyles-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 71.8 kB

Release files / glyles-0.1.2.tar.gz

Download URL glyles-0.1.2.tar.gz
Size 32.0 kB
Tags Source
SHA-256 checksum
How to use checksums
408e985e87d9b1db9b7e736ffb20b6ee21ab414033964523f4602626eed7ca5c
BLAKE2b-256 checksum
How to use checksums
c991dafb4399f9a162c3fffef5b06c0b5f1bb85b187f2c88d496588e9832112b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.7.3 Windows/10

Release files / glyles-0.1.2-py3-none-any.whl

Download URL glyles-0.1.2-py3-none-any.whl
Size 39.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b50f78c7f344dc934d5cfaf554a1bd592bc76d6b03026b2080f48259486e6975
BLAKE2b-256 checksum
How to use checksums
580827cd93efef765bc4a3c73088a1c9ab35019f14ae9020c7ebce2a649f606d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.7.3 Windows/10

Release history Release notifications | RSS feed

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.5.11

2 release files

0.5.9

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release 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