Skip to main content

glyco-gwstoolkit

Python PyPI Version PyPI Downloads

A Python toolkit for enumerating glycan tree topologies from sugar compositions and generating GWS/MSP libraries with SNFG visualization.

Features

  • Combinatorial enumeration of all unique glycan tree topologies for arbitrary sugar compositions
  • GlycoWorkbench-exact fragmentation via embedded GlycanBuilder2 — multi-charge, multi-adduct, pos/neg modes
  • SNFG rendering + interactive HTML reports with Plotly charts and sortable tables
  • One-command pipeline with checkpointing, resume, and multi-worker parallelism

Installation

Prerequisites: Python ≥ 3.10, Java JDK ≥ 11

git clone https://github.com/sosyphe/glyco-gwstoolkit.git
cd glyco-gwstoolkit
uv sync
gwstoolkit check    # verify Python + Java dependencies

Quick Start

One command — enumerate, fragment, render, and report:

gwstoolkit pipeline \
    --composition "Glc:2,Gal:2" \
    --output-dir output/ \
    --workers 4

Output:

  • data/structures.json — 18 unique glycan tree isomers
  • library.msp — theoretical fragmentation spectra (MSP format)
  • images/ — SNFG diagrams for each unique topology
  • report.html — interactive report with Plotly charts

Input: Sugar Composition

Composition is specified as Sugar:Count pairs, comma-separated.

Example Meaning
Glc:3,Gal:6 3 glucose + 6 galactose
Man:3,GlcNAc:4,Fuc:2 N-glycan core composition
Gal:2,NeuAc:2 Sialylated galactose

Options

Ion modes and adducts:

Mode Adducts Precursor Types
Positive (pos) H, Na, K [M+H]⁺, [M+Na]⁺, [M+K]⁺
Negative (neg) H only [M-H]⁻
gwstoolkit pipeline -c "Glc:2,Gal:2" --mode pos,neg --adducts H,Na
# → [M+H]⁺, [M+Na]⁺, [M-H]⁻  (Na auto-skipped in neg mode)

Fragmentation presets: GWB_default · CID_low · CID_high · HCD · BY_only

Pipeline

flowchart LR
    A["Glc:2,Gal:2"] --> B["① Enumerate"]
    B --> C["② Fragment"]
    C --> D["③ Render"]
    D --> E["④ Report"]

    B -.-> F["structures.json"]
    C -.-> G["library.msp"]
    D -.-> H["images/*.png"]
    E -.-> I["report.html"]

SNFG Example

Run steps individually

# 1. Enumerate all unique structures
gwstoolkit enumerate -c "Glc:3,Gal:6" -o structures.json

# 2. Fragment → MSP library
gwstoolkit fragment -i structures.json -o library.msp \
    --preset GWB_default --charges 1,2,3,4 --adducts H,Na,K

# 3. Render SNFG diagrams
gwstoolkit render -i structures.json --output-dir images/

# 4. Generate HTML report
gwstoolkit report -i output/ -o report.html

Tip: fragment and render also accept GWS strings directly — use --gws "..." for a single structure or --gws-file gws_list.txt for batch input (one GWS per line).

Performance

Structure counts grow exponentially with residue count — plan compositions carefully:

Composition Residues Structures Enum Fragment
Glc:2,Gal:3 5 63 <0.01s ~2s
Glc:3,Gal:3 6 268 0.02s ~6s
Glc:3,Gal:6 9 14,684 1.4s ~31min
Man:5,GlcNAc:4,Fuc:1 10 464,364 63s ~5h

Use --workers N for parallel acceleration.

Limitations

Current enumeration is purely combinatorial — no biochemical constraints:

  • No anomeric configuration (α/β) — tree connectivity only, no stereochemistry
  • No linkage position (1→3, 1→4, 1→6) — branching structure only
  • No ring form (pyranose/furanose) distinction
  • No biochemical rule filtering — biologically unlikely structures are included

Output is a superset of biologically plausible structures. Filter based on domain knowledge.

License

MIT

Metadata

Release files for glyco-gwstoolkit 0.1.0

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

Source distribution (sdist)

Source distribution for glyco-gwstoolkit 0.1.0
File Size Uploaded
glyco_gwstoolkit-0.1.0.tar.gz 26.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for glyco-gwstoolkit 0.1.0
File Interpreter ABI Platform
glyco_gwstoolkit-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 53.6 MB

Release files / glyco_gwstoolkit-0.1.0.tar.gz

Download URL glyco_gwstoolkit-0.1.0.tar.gz
Size 26.9 MB
Tags Source
SHA-256 checksum
How to use checksums
af4ffb3a2ffe3137fd01aae42822e09564e377d21278f7cdb8ce8e22d44e54ad
BLAKE2b-256 checksum
How to use checksums
8d704a5542e6457dae9fb0e28e7ec442f69baa8f7e5ba980d6b981d8db6a66ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / glyco_gwstoolkit-0.1.0-py3-none-any.whl

Download URL glyco_gwstoolkit-0.1.0-py3-none-any.whl
Size 26.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
48d70136080475db49ad11aa2bc3304697e2aa36a4f1c7c140d18940f3a82060
BLAKE2b-256 checksum
How to use checksums
a126dc08be8fe0432fdb5ffb5ad61fdf67a39fe637f6ba0d0500ddffcdc10af3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

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