Skip to main content

crabWURCS Banner

crabWURCS

CI PyPI Crates.io Documentation License: MIT

crabWURCS is a pure-Rust glycoinformatics toolkit with first-class Python and command-line interfaces. It converts WURCS 2.0, IUPAC condensed/extended, GLYCAM, SMILES, MOL, and SDF; extracts glycans from PDB/mmCIF; and renders SNFG SVG or PNG images.

Install

Python 3.9 or newer:

pip install crabwurcs

Rust library or CLI:

cargo add crabwurcs@0.3.2
cargo install crabwurcs-cli@0.3.2

Prebuilt Python wheels use the stable CPython ABI and do not require RDKit or a local Rust compiler on supported Linux, macOS, and Windows systems.

Python quick start

from IPython.display import SVG, display
import crabwurcs

glycan = crabwurcs.Glycan.parse("Gal(b1-4)GlcNAc")
print(glycan.to(crabwurcs.Format.WURCS))
print(glycan.to(crabwurcs.Format.SMILES))
display(SVG(glycan.render("svg")))

svg = glycan.render(
    "svg",
    highlight_motifs=["Gal(b1-?)GlcNAc"],
)
open("glycan.svg", "w").write(svg)

for result in crabwurcs.extract_pdb_file("structure.cif"):
    print(result.attachment_site, result.glycan.to("iupac-condensed"))
    print(result.residues)

Convenience functions are available for one-step use:

wurcs = crabwurcs.convert(
    "Gal(b1-4)GlcNAc",
    to_format="wurcs",
    from_format="iupac-condensed",
)
normalized = crabwurcs.normalize_wurcs(wurcs)
png = crabwurcs.render_snfg(wurcs, from_format="wurcs", image_format="png")

Rust quick start

use crabwurcs::{Format, convert, parse_notation, render_svg};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let iupac = "Gal(b1-4)GlcNAc";
    let wurcs = convert(iupac, Format::IupacCondensed, Format::Wurcs)?;
    let graph = parse_notation(&wurcs, Format::Wurcs)?;
    let svg = render_svg(&graph)?;
    println!("{svg}");
    Ok(())
}

Command line

Both pip install crabwurcs and cargo install crabwurcs-cli install the crabwurcs command:

crabwurcs convert --to wurcs 'Gal(b1-4)GlcNAc'
crabwurcs normalize-wurcs 'WURCS=2.0/...'
crabwurcs wurcs-to-mol --format smiles glycan.wurcs
crabwurcs pdb-to-wurcs --to iupac-condensed structure.cif
crabwurcs render --output glycan.png 'Gal(b1-4)GlcNAc'

Coverage and chemical guarantees

WURCS-producing operations return the local normalized representation. The strict Rust, Python, and CLI normalizers reject syntax that cannot be proven lossless; ordinary serialization retains an unchanged parsed source for those rare constructs instead of dropping information. No network service is used.

  • All 87 SNFG 2.0.4 registry entries parse and render.
  • All 74 chemically concrete entries are tested through WURCS, IUPAC, SMILES, MOL/SDF, and PDB/mmCIF component recognition.
  • The 13 generic/display-only classes preserve uncertainty and return typed errors when a concrete molecule would require invented stereochemistry.
  • Compositions, uncertain linkage ensembles, probabilities, and variable repeats do not silently collapse to one molecule.
  • PDB/mmCIF extraction retains chain, sequence number, insertion code, and graph-node provenance. Coordinate generation and PDB writing are out of scope for 0.3.2.

See the complete residue table and format limitations for details.

Workspace

crabwurcs-core    WURCS grammar and shared ResidueGraph
crabwurcs-iupac   IUPAC condensed/extended and GLYCAM
crabwurcs-mol     SMILES, MOL, and SDF molecular interop
crabwurcs-pdb     PDB/mmCIF glycan extraction
crabwurcs-snfg    SNFG SVG/PNG rendering
crabwurcs         unified Rust facade
crabwurcs-cli     Rust command-line application
crabwurcs-python  private PyO3 extension for the PyPI package

Documentation and development

crabWURCS is available under the MIT license.

Metadata

Release files for crabwurcs 0.3.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 crabwurcs 0.3.2
File Size Uploaded Provenance Actions
crabwurcs-0.3.2.tar.gz 423.4 kB Without provenance Details for crabwurcs-0.3.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for crabwurcs 0.3.2
File Actions
crabwurcs-0.3.2-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for crabwurcs-0.3.2-cp39-abi3-win_amd64.whl
crabwurcs-0.3.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for crabwurcs-0.3.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
crabwurcs-0.3.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for crabwurcs-0.3.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
crabwurcs-0.3.2-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for crabwurcs-0.3.2-cp39-abi3-macosx_11_0_arm64.whl
crabwurcs-0.3.2-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for crabwurcs-0.3.2-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 14.8 MB

Release files / crabwurcs-0.3.2.tar.gz

Download URL crabwurcs-0.3.2.tar.gz
Size 423.4 kB
Tags Source
SHA-256 checksum
How to use checksums
405cffc64a31a53170a82ba5e10c9c662c6f40558884b70da35e4f3108df6735
BLAKE2b-256 checksum
How to use checksums
f1bb6c899640c315b7c40fa9fb1974448c5ac1cd4417b32e19c19908821ffcca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / crabwurcs-0.3.2-cp39-abi3-win_amd64.whl

Download URL crabwurcs-0.3.2-cp39-abi3-win_amd64.whl
Size 2.9 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
b0e146030001ddbeda005a60a4195eab3db93fb5eb72f94e4ba842779356b579
BLAKE2b-256 checksum
How to use checksums
bdc6dab21ce9c7a3e935c28acabf13895ef7bb90f6d28f30a81ba42d986d7850
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / crabwurcs-0.3.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL crabwurcs-0.3.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.1 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
6a45f851ec43af7a295c082105ef2fadf7fbf9940669a023567c632f8e0e614a
BLAKE2b-256 checksum
How to use checksums
b3a49404a352bdf3024a855603f73bb8c699263f25ae699495b32fcd2a920bb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / crabwurcs-0.3.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL crabwurcs-0.3.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.9 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
1b98cb8ace8d6fe5938d7930785cd137b92572f441b2157a18bf6834e0800432
BLAKE2b-256 checksum
How to use checksums
b9ee66b52681bf81e48de93aff9ddfedb5a3b5cfd797e5379d93df80e6dceba1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / crabwurcs-0.3.2-cp39-abi3-macosx_11_0_arm64.whl

Download URL crabwurcs-0.3.2-cp39-abi3-macosx_11_0_arm64.whl
Size 2.7 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
13bb5834260d1614d837b0de8eb7d1263350662c06fe644c08b1ac535e5c2575
BLAKE2b-256 checksum
How to use checksums
4b52e2c46b1165c8814c64fba9f7914f62f264abc64872e0596a3fb8afa6a89f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / crabwurcs-0.3.2-cp39-abi3-macosx_10_12_x86_64.whl

Download URL crabwurcs-0.3.2-cp39-abi3-macosx_10_12_x86_64.whl
Size 2.8 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
9f3a474373a319faac54c1ba9784b48ce668745922035f5c60804dcdf4427822
BLAKE2b-256 checksum
How to use checksums
c2dce47fff6ba7e04a037985239f596b98db839234ea54e9946993e9b9004afb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for crabwurcs 0.3.2

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.

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