crabWURCS
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.1
cargo install crabwurcs-cli@0.3.1
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.1.
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crabwurcs-0.3.1.tar.gz.
File metadata
- Download URL: crabwurcs-0.3.1.tar.gz
- Upload date:
- Size: 406.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c07ca3d0804a71f69e289501ccb6324e4f3dfb311d95c0c7224dddaff3fe7814
|
|
| MD5 |
0fa363e5ffe97f9bf330544caf1f257a
|
|
| BLAKE2b-256 |
2d7f2240cf0963851c6c6a70a47e93347e5deebc4bc9d9c2a3d8b306893068a4
|
File details
Details for the file crabwurcs-0.3.1-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: crabwurcs-0.3.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce6643dac73f86f8564285641dffb026949f00ee985d00b31bf3fbad3c1830ac
|
|
| MD5 |
c2acd1d19f8d59ea31dcd411629cb7bf
|
|
| BLAKE2b-256 |
8bf9dd3c640f429c5f58f49dab11d9fc655f108e4fc64a1e59c3dbac97897e71
|
File details
Details for the file crabwurcs-0.3.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: crabwurcs-0.3.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94ce0ddf5e6f750d3ae089e458b0d2ec6de87ece5d12f43a16c14e7e7b3c4337
|
|
| MD5 |
a6a7f79d837010f6a7fb92237f31d6b6
|
|
| BLAKE2b-256 |
6a32da67fd9f00c9de8c1aa5097acdf4cfbf8b17f24f3642f54d05c07bf970c9
|
File details
Details for the file crabwurcs-0.3.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: crabwurcs-0.3.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5c9d2d9b8728ad1514283ae40e307f1a5dfc6697429349f05bdbd9d6a9f1948
|
|
| MD5 |
31634a302c9543b6a881b9929cf0772b
|
|
| BLAKE2b-256 |
e72d8e4d07e85c2f3ded6064fbebafd81b532399a6a357ebc9740d5d8fdd082d
|
File details
Details for the file crabwurcs-0.3.1-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: crabwurcs-0.3.1-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
651d1459aa33450f504fb5aca7d402e5abb3dadc2eba6f9807d1305db9144fa5
|
|
| MD5 |
8fa7bda7957d9ccdf6a821a1e9302070
|
|
| BLAKE2b-256 |
f83ac21ad0ed5dc05ae63bfa57fc10310cf69670a17394f5ff3e87f8565f747e
|
File details
Details for the file crabwurcs-0.3.1-cp39-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: crabwurcs-0.3.1-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b02bff84090d0feeb23a55eaa82f9f06af5b02f6e48e59eebea08e8b4267d3f
|
|
| MD5 |
d6631c69addd758ca2b3fb5b8bfd74e3
|
|
| BLAKE2b-256 |
46118b1ce94390d0e877193c7185f9349670e4f5391b8cb672faa5616a2ba443
|