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.0
cargo install crabwurcs-cli@0.3.0

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

import crabwurcs

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

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",
)
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 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

  • 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.0.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crabwurcs-0.3.0.tar.gz (399.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

crabwurcs-0.3.0-cp39-abi3-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.9+Windows x86-64

crabwurcs-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

crabwurcs-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.8 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

crabwurcs-0.3.0-cp39-abi3-macosx_11_0_arm64.whl (2.6 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

crabwurcs-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file crabwurcs-0.3.0.tar.gz.

File metadata

  • Download URL: crabwurcs-0.3.0.tar.gz
  • Upload date:
  • Size: 399.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for crabwurcs-0.3.0.tar.gz
Algorithm Hash digest
SHA256 309cc07ca8d2857cad0fa6bb8ad7cd48fd2358227282f02e690ba8c77c71cac2
MD5 304b820e6617a2fe64cfe5fa18c19e8c
BLAKE2b-256 977828cfc902eb5a0390731d1488e96a31218e1aedbe05dc7d422b81a65ced34

See more details on using hashes here.

File details

Details for the file crabwurcs-0.3.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: crabwurcs-0.3.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for crabwurcs-0.3.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ebcfa43f631199c6dde67edfd641ac46e2cddc3d7f6ae0e2660b86eea0ccbd23
MD5 fd39f02646b51772cb575f14c696531a
BLAKE2b-256 c08927bd20de68cb436f67e456a9070c685700dea5e5e3745387d4ed3384e9e9

See more details on using hashes here.

File details

Details for the file crabwurcs-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for crabwurcs-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5eb6d3a8e70884f6a7c2a90535d1548e2479750dcc1c61b572074e7481900043
MD5 778963df3ef6206615f756620407d117
BLAKE2b-256 192aad615577f2bfadd7f0ebd3c483a4888740c4c3bd0c10f8794c53c2d00131

See more details on using hashes here.

File details

Details for the file crabwurcs-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for crabwurcs-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 feead4969116e5eb4358bfbff7201b4d4072c8f14b30da69db90b3237b0d361d
MD5 8cee8bca9f3e85369b232b18db223a2a
BLAKE2b-256 c3bbce3d71b8063a6531bd8074f2ed73ba1f3efa62b701eeab843acf68b07ef6

See more details on using hashes here.

File details

Details for the file crabwurcs-0.3.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for crabwurcs-0.3.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eafff46c89a6a6a286557e657348741e224f167481f3203db3df68fee1b79f46
MD5 9471124668a01c383c46bd73530d6e59
BLAKE2b-256 fc3275fd9b06cb75b7ae10f245206e9f379906c27eb033f1e8fe5fbadb8de24f

See more details on using hashes here.

File details

Details for the file crabwurcs-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for crabwurcs-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 277718ff84fe2eebd61352364a138ea3358226a715d8fb0975658e4e6fa2e95d
MD5 2ed5b03c33381444e778f7df0e5f905d
BLAKE2b-256 f2dee8f59f6bf4a00dfb88829fedb739ede4d4fa8e273704bf92ee39631eb2e8

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.1

6 files

This release

0.3.0 This release

6 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