Skip to main content

A complete Protein Data Bank (PDB) file parser

Project description

Pidibble

a complete PDB-file parser

PyPI Downloads

Pidibble is a Python package for parsing standard Protein Data Bank (PDB) files. It conforms to the most recent standard (v.3.3 Atomic Coordinate Entry Format, ca. 2011).

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.pdbparser module.

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=list(sorted(list(p.parsed.keys())))
>>> print(keys)
['ANISOU', 'ATOM', 'AUTHOR', 'CISPEP', 'COMPND', 'CONECT', 'CRYST1', 'DBREF', 'END', 'EXPDTA', 'FORMUL', 'HEADER', 'HELIX', 'HET', 'HETATM', 'HETNAM', 'JRNL.AUTH', 'JRNL.DOI', 'JRNL.PMID', 'JRNL.REF', 'JRNL.REFN', 'JRNL.TITL', 'KEYWDS', 'LINK', 'MASTER', 'ORIGX1', 'ORIGX2', 'ORIGX3', 'REMARK.100', 'REMARK.2', 'REMARK.200', 'REMARK.280', 'REMARK.290', 'REMARK.290.CRYSTSYMMTRANS', 'REMARK.3', 'REMARK.300', 'REMARK.350', 'REMARK.350.BIOMOLECULE.1', 'REMARK.4', 'REMARK.465', 'REMARK.500', 'REVDAT', 'SCALE1', 'SCALE2', 'SCALE3', 'SEQADV', 'SEQRES', 'SHEET', 'SOURCE', 'SSBOND', 'TER', 'TITLE']
>>> 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(alphafold='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: 


Changelog

See CHANGELOG.md for the full release history.

Project details


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.5.3.tar.gz (2.9 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.5.3-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pidibble-1.5.3.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pidibble-1.5.3.tar.gz
Algorithm Hash digest
SHA256 20089fca39205e7dd57047eb6be12f99210ec5647caf50a9bd970ba547d3dd8c
MD5 a597ace89f19410da0ceaf8a70e2bf32
BLAKE2b-256 77e9405f1b7e609d12187a15cc1440d74b23ae8d81b5c2254f9b1e9137e15285

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pidibble-1.5.3-py3-none-any.whl
  • Upload date:
  • Size: 30.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pidibble-1.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 09938b475f700ea6494a1aa5b0b6c63da24e5d1c2955149dfed08cca144beb0e
MD5 53aad585db4b34e8d3c081c0d6a9cb8a
BLAKE2b-256 983169ff93202f75e1a833ac0964a1a91db32b961f7a15a54dddc52e3d266d7c

See more details on using hashes here.

Supported by

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