Skip to main content

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

scigantic_wwpdb-0.1.1.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

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

scigantic_wwpdb-0.1.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file scigantic_wwpdb-0.1.1.tar.gz.

File metadata

  • Download URL: scigantic_wwpdb-0.1.1.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for scigantic_wwpdb-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4d5ed4c5e3eb28ad9e75d66d10be5e1dece482b69ff996718f623a49c747f251
MD5 48cd5bb3d76864d67da0a2595436d9e6
BLAKE2b-256 5771172d06a4ae7d9bd6aed35ce8ae3c5d223f846be042b654b9d3c21be8eb39

See more details on using hashes here.

File details

Details for the file scigantic_wwpdb-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for scigantic_wwpdb-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0706c8294d031503fee277123fafed909d45a795580ee9682b071059cce06c64
MD5 9a9eca3d2076073e8f7998495109e41f
BLAKE2b-256 baacf91523b4100dc2704383350eb522d2e1acc4d098e4163f238880593299b5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

2 files

0.2.0

2 files

This release

0.1.1 This release

2 files

0.1.0

2 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