Skip to main content

cif-explorer

A local, browser-based explorer for IHMCIF / mmCIF files, built for PDB-IHM biocuration. Pick any row in any category and trace it up (the rows it refers to) and down (the rows that refer to it) through the whole hierarchy, with dictionary checks shown next to the values.

cif_explorer 9A1N.cif          # opens http://localhost:<port>/ in the browser

Features

  • Trace tree. Click a row; the right panel shows its fields, its parent rows and the child rows in every category that refers to it. Expand any node to keep walking up or down. "↑ all parents" opens the full chain of ancestors (e.g. atom_site → struct_asym → entity, ihm_model_list → ihm_modeling_protocol → ihm_dataset_group …).

  • Composite links. Parent/child relationships come from the PDBx and IHM dictionaries (_item_linked). Composite parent keys are completed, so atom_site rows link to entity_poly_seq by entity + residue number + residue name, and cross-link partners _1 / _2 are traced separately.

  • Dictionary checks. Every value is checked against the item's type, enumeration, range and mandatory flag (python-ihm's dictionary objects); missing mandatory items, unknown categories/items, duplicate keys and broken links (child values with no parent row) are listed in the checks panel, with links to the offending rows. Bad cells are highlighted in the table and the trace. python-ihm's own Dictionary.validate can be run from the same panel.

  • Live reload. The file is watched; when it changes it is re-read and the view (category, page, filters, selected row, expanded trace nodes, scroll positions) is kept. If the new version does not parse, the error is shown and the previous version stays on screen.

  • Big files. Reading is done by python-ihm's C tokenizer. Large tables (atom_site, ihm_starting_model_coord, ihm_sphere_obj_site, …) are packed into numpy arrays while reading, so memory stays below the file size. Paging, filtering, link lookups and child counts work on the packed columns and answer in tens of milliseconds even for millions of atoms.

    file atoms load checks stored peak RSS
    9A1N, 143 MB 1.9 M 7.6 s 5 s 97 MB 0.27 GB
    synthetic, 680 MB 9.5 M 35 s 9 s 432 MB 1.0 GB

    The browser opens immediately and shows a progress bar while loading.

  • Reads .cif, .cif.gz and BinaryCIF (.bcif).

Install

uv tool install cif-explorer    # or: pipx install cif-explorer
pip install cif-explorer
pip install -e .                # from a checkout

Usage

cif_explorer FILE [--port N] [--host ADDR] [--no-browser] [--no-watch]
                  [--dict DIC ...] [--update-dicts]

The PDBx (mmcif_pdbx_v50.dic) and IHM (mmcif_ihm_ext.dic) dictionaries are downloaded from mmcif.wwpdb.org on first use and cached in ~/.cache/cif_explorer/dictionaries (override the location with CIF_EXPLORER_CACHE, or pass local files with --dict). Use --update-dicts to refresh them.

In the browser:

action how
trace a row click it in the table
filter by a value double-click the cell
full-text filter in a category "contains…" box in the toolbar
search all categories search box at the top (/)
dictionary definition hover a column header or field name
jump from the tree to the table ⌖ table on a node
re-root the tree ⤒ root on a node
resize a panel drag its divider; double-click the divider to reset
dark / light theme ◐ button, top right (dark by default)

The theme and panel sizes are saved in ~/.config/cif_explorer/prefs.json ($XDG_CONFIG_HOME and CIF_EXPLORER_CONFIG are honoured) and apply to every run.

Limitations / ideas

  • Rows are matched to parents by exact value equality, as the dictionary links define. Range-style references (seq_id_begin..seq_id_end) are matched on their end points only; "which spheres cover residue 17" is not answered yet.
  • Line numbers are known per category (python-ihm reports them), not per row.
  • Only the first data block of a file is shown.

Development

uv venv && uv pip install -e ".[test]"
pytest

All CIF parsing is delegated to python-ihm; this package contains no tokenizer of its own.

Releasing

  1. Set __version__ in src/cif_explorer/__init__.py (e.g. 0.2.0) and commit.
  2. Tag and push: git tag v0.2.0 && git push origin v0.2.0.

The workflow runs the tests, builds the sdist and wheel, checks that the tag matches the version and publishes to PyPI through trusted publishing (GitHub environment pypi).

License

MIT, see LICENSE.

Metadata

Release files for cif-explorer 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cif-explorer 0.1.0
File Size Uploaded Provenance Actions
cif_explorer-0.1.0.tar.gz 61.5 kB With provenance Details for cif_explorer-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cif-explorer 0.1.0
File Interpreter ABI Platform Actions
cif_explorer-0.1.0-py3-none-any.whl Python 3 none any Details for cif_explorer-0.1.0-py3-none-any.whl

Total release size: 117.5 kB

Release files / cif_explorer-0.1.0.tar.gz

Download URL cif_explorer-0.1.0.tar.gz
Size 61.5 kB
Tags Source
SHA-256 checksum
How to use checksums
03e79e2427194f5c650cadb9a06767f9dff5f33d06facfefa1606c3de4ef0b01
BLAKE2b-256 checksum
How to use checksums
68bd4f0010de02b3cd3781c44cb26b645ff99d697aa7584f148991f8595024ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / cif_explorer-0.1.0-py3-none-any.whl

Download URL cif_explorer-0.1.0-py3-none-any.whl
Size 56.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
388702fdcb7c9a8412c9f68141ec4c6448ea52c1da091a937deb539fef61d2ce
BLAKE2b-256 checksum
How to use checksums
8e8f36b15a66cd68b63888512352893d5de938aa19b17d9da0a70b6779450013
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for cif-explorer 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cif_explorer-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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