scigantic-wwpdb
Explore the wwPDB Chemical Component Dictionary (CCD) from Python, by id, no download.
The CCD is the reference chemistry for every small molecule, ligand, ion, and modified residue in the PDB, about 45,000 components. It is the small-molecule reference AlphaFold 3 uses for ligand pose prediction, and what you reach for whenever a structure has a HETATM to reason about.
The whole dictionary is a single 45,000-file directory. Mirroring or FUSE-mounting it is awkward: the public autoindex either truncates (files.wwpdb.org caps at 2,000 entries) or is slow to list (the complete mirror is 50k entries). So this library never lists the tree. It fetches exactly what you ask for, over HTTP, in three tiers so exploring stays fast:
import scigantic_wwpdb as ccd
ids = ccd.search("heme") # 1. ids by name (RCSB text search)
ccd.find(ids) # 2. metadata for the set, ONE request:
# [Summary('HEC', 'HEME C', formula='C34 H34 Fe N4 O4'), ...]
c = ccd.component("HEC") # 3. full structure only for what you want
find batch-fetches name/formula/type/weight/SMILES/InChIKey for a whole result set in a single request (RCSB's data API), so you skim before you fetch. The browsing idiom is find(search("kinase inhibitor")).
Install
pip install scigantic-wwpdb # core: gemmi + requests
pip install "scigantic-wwpdb[rdkit]" # + RDKit for to_rdkit / to_sdf / depiction
Full structure, RDKit, SDF
c = ccd.component("ATP") # one small GET, parsed
c.name # "ADENOSINE-5'-TRIPHOSPHATE"
c.formula # "C10 H16 N5 O13 P3"
c.atoms[0] # Atom(id='PG', element='P', charge=0, x=1.2, y=-0.226, z=-6.85, ...)
ccd.components(["ATP", "ADP", "AMP"]) # many, fetched in parallel
mol = ccd.to_rdkit("ATP") # RDKit Mol with the ideal 3-D coordinates
ccd.to_sdf("ATP", "ATP.sdf") # write an SDF
to_rdkit builds the molecule from the dictionary's atoms and bonds, not from a SMILES round-trip, so organometallics like heme (whose coordinate-bond SMILES a plain parser cannot read) still work.
One-liners smiles / inchi / inchikey / formula / name(id) use the fast metadata API, not a full CIF fetch.
The whole dictionary
For bulk work, stream the full components.cif.gz once (cached) and parse it with gemmi:
doc = ccd.read_dictionary() # downloads ~117 MB once, then a gemmi Document
For anything less than a few thousand components, component() / components() are faster and use no local disk.
Layout
Small, single-purpose modules: rcsb (search + batch metadata), structure (fetch + parse), _cif (gemmi), chem (RDKit/SDF), dictionary (the bundle), model (records). Per-component data is RCSB (files.rcsb.org/ligands/download/<ID>.cif); search and batch metadata are the RCSB search + data APIs; the bundle is EBI. All overridable via SCIGANTIC_CCD_* environment variables.
Data and license
Library code: MIT (see LICENSE). The CCD data it fetches is wwPDB, released under CC0 1.0; cite the wwPDB when you use it. Built by Scigantic.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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 scigantic_wwpdb-0.1.0.tar.gz.
File metadata
- Download URL: scigantic_wwpdb-0.1.0.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bde140a4183296b3c71c589dddf259db68f9447081132f571556686345e1d92b
|
|
| MD5 |
1009d182e9dc37c48ee09390039c1e77
|
|
| BLAKE2b-256 |
ef43094eb6de2c4b9623c2c5435d28de9e98309ba4ce06408bf30064928e3edc
|
File details
Details for the file scigantic_wwpdb-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scigantic_wwpdb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cda9cee5190c04d71c1a004669c3f092a8b88a5a1b9208435c4e40ed9465c1f3
|
|
| MD5 |
cc80847b45c1d1c68939d4715996fcd2
|
|
| BLAKE2b-256 |
6cdbc424c6aaeecfa2cf65c9b6bdfdbb5c3dcd799d6da795fb22df10cc3ae989
|