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:

  • All monomers are given in D-Enantiomer, except fucose (Fuc) which has L-Enantiomer
  • 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 3.
  • Only the 23 implemented monomers may participate in the glycan (see below)

For an overview of the implemented monomers, 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 import MonomerFactory

MonomerFactory.monomers()

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.

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
  • 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 separated with a comma.

In case of convert_generator the outputs only contain the SMILES strings in the order of the arguments (first glycan , then glycan_list, glycan_file, and glycan_generator).

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.0.3

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.0.3
File Size Uploaded Provenance Actions
glyles-0.0.3.tar.gz 23.1 kB Without provenance Details for glyles-0.0.3.tar.gz

Built distribution (wheel)

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

Total release size: 51.3 kB

Release files / glyles-0.0.3.tar.gz

Download URL glyles-0.0.3.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
34db851780a2cc7d180e934ac02b4dd7591f466d4f0eb00a8184670a12dd9a7e
BLAKE2b-256 checksum
How to use checksums
7f92a479b7d139b0643f03764a4a99feb0feefd85f8e3d55277384d27d0e6460
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.0.3-py3-none-any.whl

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

Security for glyles 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files No provenance

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