Skip to main content

Pidibble

a complete parser for PDB and PDBx/mmCIF files

PyPI version Python versions License Tests Documentation Status PyPI Downloads

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

pidibble-1.8.0.tar.gz (3.2 MB view details)

Uploaded Source

Built Distribution

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

pidibble-1.8.0-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file pidibble-1.8.0.tar.gz.

File metadata

  • Download URL: pidibble-1.8.0.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pidibble-1.8.0.tar.gz
Algorithm Hash digest
SHA256 722d78dc47848c9bdda0b139e27d2d96a8e09ac9f6fd968d61f53acf2502e1d6
MD5 476356393df74bc86ed4369d2693b32f
BLAKE2b-256 f3584bba86dfcd71a4ebc8fd552fec5b17fa596d43d40c937bd071353d059807

See more details on using hashes here.

Provenance

The following attestation bundles were made for pidibble-1.8.0.tar.gz:

Publisher: release.yaml on cameronabrams/pidibble

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pidibble-1.8.0-py3-none-any.whl.

File metadata

  • Download URL: pidibble-1.8.0-py3-none-any.whl
  • Upload date:
  • Size: 44.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pidibble-1.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 230c8648973fbaf807e92c96100a36782f1578bfa7127e40449d88e2222b2ac1
MD5 f74bc784fc5b819d4587389eb4d766d6
BLAKE2b-256 8eb2120d97d67a3503121a7c4b6131e424fe39bb5e22e55c9573f3aff8d09840

See more details on using hashes here.

Provenance

The following attestation bundles were made for pidibble-1.8.0-py3-none-any.whl:

Publisher: release.yaml on cameronabrams/pidibble

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.11.0

2 files

1.10.0

2 files

1.9.0

2 files

This release

1.8.0 This release

2 files

1.7.2

2 files

1.7.1

2 files

1.7.0

2 files

1.6.0

2 files

1.5.4

2 files

1.5.3

2 files

1.5.2

2 files

1.5.1

2 files

1.5.0

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.9

2 files

1.1.8

2 files

1.1.7

2 files

1.1.6

2 files

1.1.5

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.9.1

2 files

1.0.9

2 files

1.0.8

2 files

1.0.7.7

2 files

1.0.7.6

2 files

1.0.7.5

2 files

1.0.7.4

2 files

1.0.7.3

2 files

1.0.7.2

2 files

1.0.7.1

2 files

1.0.7

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page