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.3
cargo install crabwurcs-cli@0.3.3

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 reads every monosaccharide from its coordinates (ring, configuration of every centre, anomer, substituents, linkages) and reports residue names that disagree. It retains chain, sequence number, insertion code, and graph-node provenance. Coordinate generation and PDB writing are out of scope for 0.3.

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.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 crabwurcs 0.3.3
File Size Uploaded Provenance Actions
crabwurcs-0.3.3.tar.gz 492.5 kB Without provenance Details for crabwurcs-0.3.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for crabwurcs 0.3.3
File Actions
crabwurcs-0.3.3-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for crabwurcs-0.3.3-cp39-abi3-win_amd64.whl
crabwurcs-0.3.3-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.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
crabwurcs-0.3.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for crabwurcs-0.3.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
crabwurcs-0.3.3-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for crabwurcs-0.3.3-cp39-abi3-macosx_11_0_arm64.whl
crabwurcs-0.3.3-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for crabwurcs-0.3.3-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 15.2 MB

Release files / crabwurcs-0.3.3.tar.gz

Download URL crabwurcs-0.3.3.tar.gz
Size 492.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ddb367e6fa7e4c6b4b0aaf508f6caac6bfc64e9a935edae21f2c7a95742fb0a7
BLAKE2b-256 checksum
How to use checksums
7ad57b244b77884a0f021b42b16f64d3f20c82307ef87349e87b7b7b62ed36c4
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.3-cp39-abi3-win_amd64.whl

Download URL crabwurcs-0.3.3-cp39-abi3-win_amd64.whl
Size 2.9 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
81c867deef1c04bdb39596757c01f2ef51ae500cad62f9d09b4a2a27ccc8bf15
BLAKE2b-256 checksum
How to use checksums
b3113197024600807ff62825d80b08e68fb6ea2bfc6242b166c0eb3d9d53dc5a
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.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL crabwurcs-0.3.3-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
bd2cb4ce08686d63d6fbdc9d52bb8f91cd871cf4a5a25bc0a47ea40fc12ab5ab
BLAKE2b-256 checksum
How to use checksums
4c5325e4fe4cb373115e47f10bea2f5d0de0912da614a2ed21f79927263d805d
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.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL crabwurcs-0.3.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 3.0 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
b4d1ac95e82842ac9e1eb9f89252ebfc3fc247ae63529c84fffd016746a1d7b7
BLAKE2b-256 checksum
How to use checksums
da6ed4bcac5037692d1d45a14d6ee49f8377a5598ed27f8a19260ef9ad24dd51
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.3-cp39-abi3-macosx_11_0_arm64.whl

Download URL crabwurcs-0.3.3-cp39-abi3-macosx_11_0_arm64.whl
Size 2.8 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c0a4a6e91fc8aa27c061f17e2ed035ed141fc3c54f678ca44c45fd431fd86836
BLAKE2b-256 checksum
How to use checksums
ad98637eb5d8624bc81ba34e4be08d12998eb0f710aac98baaa482df1836bc44
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.3-cp39-abi3-macosx_10_12_x86_64.whl

Download URL crabwurcs-0.3.3-cp39-abi3-macosx_10_12_x86_64.whl
Size 2.9 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
e7b0f322b279e49c763be04e984ef04bcacdab94642df40eaedbc2e4db09883e
BLAKE2b-256 checksum
How to use checksums
916e330b7a9e1dd16a5899ccab1c268a910f4388876d9646bc7dc2aefc186390
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.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.

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