Pidibble
a complete parser for PDB and PDBx/mmCIF files
Pidibble is a Python package for parsing Protein Data Bank structures in both the legacy PDB format (v.3.3 Atomic Coordinate Entry Format, ca. 2011) and the modern PDBx/mmCIF format that is now standard at the RCSB.
Unlike parsers like that found in packages like BioPython, pidibble provides meaningfully parsed objects from all standard PDB record types, not just ATOMs and CONECTs.
Once installed, the user has access to the PDBParser class in the pidibble.pdbparse module. Full documentation is at pidibble.readthedocs.io.
Example interactive usage
>>> from pidibble.pdbparse import PDBParser
>>> p=PDBParser(PDBcode='4zmj').parse()
>>> print (p.parsed['HEADER'].classification)
VIRAL PROTEIN
>>> print (p.parsed['HEADER'].depDate)
04-MAY-15
>>> print (p.parsed['HEADER'].idCode)
4ZMJ
>>> keys=sorted(p.parsed.keys())
>>> len(keys)
60
>>> keys[:8]
['ANISOU', 'ATOM', 'AUTHOR', 'CISPEP', 'COMPND', 'CONECT', 'CRYST1', 'DBREF']
>>> header=p.parsed['HEADER']
>>> print(header.pstr())
HEADER
classification: VIRAL PROTEIN
depDate: 04-MAY-15
idCode: 4ZMJ
>>> atoms=p.parsed['ATOM']
>>> len(atoms)
4518
>>> print(atoms[0].pstr())
ATOM
serial: 1
name: N
altLoc:
residue: resName: LEU; chainID: G; seqNum: 34; iCode:
x: -0.092
y: 99.33
z: 57.967
occupancy: 1.0
tempFactor: 137.71
element: N
charge:
Example downloading from AlphaFold
>>> from pidibble.pdbparse import PDBParser
>>> p=PDBParser(source_db='alphafold', source_id='O46077').parse()
>>> p.parsed['TITLE'].title
'ALPHAFOLD MONOMER V2.0 PREDICTION FOR ODORANT RECEPTOR 2A (O46077)'
>>> print(p.parsed['ATOM'][0].pstr())
ATOM
serial: 1
name: N
altLoc:
residue: resName: MET; chainID: A; seqNum: 1; iCode:
x: -0.553
y: 26.513
z: 23.174
occupancy: 1.0
tempFactor: 39.74
element: N
charge:
Example reading a PDBx/mmCIF file
Many recent RCSB entries have no legacy PDB file at all. Pass input_format='mmCIF' and pidibble parses the mmCIF/PDBx file into the same record objects (using author numbering), so downstream code stays the same:
>>> from pidibble.pdbparse import PDBParser
>>> p=PDBParser(source_db='rcsb', source_id='4tvp', input_format='mmCIF').parse()
>>> p.parsed['HEADER'].idCode
'4TVP'
>>> p.parsed['HEADER'].classification
'VIRAL PROTEIN/IMMUNE SYSTEM'
>>> len(p.parsed['ATOM'])
11344
See the mmCIF guide for the full coverage and the small, deliberate differences from the PDB parse.
Changelog
See CHANGELOG.md for the full release history.
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 pidibble-1.11.0.tar.gz.
File metadata
- Download URL: pidibble-1.11.0.tar.gz
- Upload date:
- Size: 3.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
176922e375a7d770fae18f68b3a3db4eecb0dc8c0cbdfc889a959baa8facadea
|
|
| MD5 |
c770c683b53e02428d42214a0f76ddbd
|
|
| BLAKE2b-256 |
6043e58162888e2c2c3602699df646f1b24fc3638b23090dc5215274658fce59
|
Provenance
The following attestation bundles were made for pidibble-1.11.0.tar.gz:
Publisher:
release.yaml on cameronabrams/pidibble
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pidibble-1.11.0.tar.gz -
Subject digest:
176922e375a7d770fae18f68b3a3db4eecb0dc8c0cbdfc889a959baa8facadea - Sigstore transparency entry: 2506937754
- Sigstore integration time:
-
Permalink:
cameronabrams/pidibble@356208d18b95dcee938ea1dbdb1d9ad6b5b5777c -
Branch / Tag:
refs/tags/v1.11.0 - Owner: https://github.com/cameronabrams
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@356208d18b95dcee938ea1dbdb1d9ad6b5b5777c -
Trigger Event:
push
-
Statement type:
File details
Details for the file pidibble-1.11.0-py3-none-any.whl.
File metadata
- Download URL: pidibble-1.11.0-py3-none-any.whl
- Upload date:
- Size: 60.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ea81ca79d0d09ee7f2a024b201e0d5e10879e02fc848ca640204769dee27be2
|
|
| MD5 |
541d6cf4f0a0159d046b85aa0ef8220f
|
|
| BLAKE2b-256 |
feb7e22e222e083d7c8acdf23bc4cda1bebe44a4300e88bcd8a4420aa4f65e89
|
Provenance
The following attestation bundles were made for pidibble-1.11.0-py3-none-any.whl:
Publisher:
release.yaml on cameronabrams/pidibble
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pidibble-1.11.0-py3-none-any.whl -
Subject digest:
6ea81ca79d0d09ee7f2a024b201e0d5e10879e02fc848ca640204769dee27be2 - Sigstore transparency entry: 2506937798
- Sigstore integration time:
-
Permalink:
cameronabrams/pidibble@356208d18b95dcee938ea1dbdb1d9ad6b5b5777c -
Branch / Tag:
refs/tags/v1.11.0 - Owner: https://github.com/cameronabrams
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@356208d18b95dcee938ea1dbdb1d9ad6b5b5777c -
Trigger Event:
push
-
Statement type: