A complete Protein Data Bank (PDB) file parser
Project description
Pidibble - a complete PDB parser
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:
>>> b=p.parsed['REMARK.350.BIOMOLECULE.1']
>>> print(b.pstr())
REMARK.350.BIOMOLECULE.1
rowName: ['BIOMT2', 'BIOMT3', 'BIOMT1', 'BIOMT2', 'BIOMT3', 'BIOMT1', 'BIOMT2', 'BIOMT3']
replNum: [1, 1, 2, 2, 2, 3, 3, 3]
m1: [0.0, 0.0, -0.5, 0.866025, 0.0, -0.5, -0.866025, 0.0]
m2: [1.0, 0.0, -0.866025, -0.5, 0.0, 0.866025, -0.5, 0.0]
m3: [0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0]
t: [0.0, 0.0, 107.18, 185.64121, 0.0, -107.18, 185.64121, 0.0]
>>> from pidibble.pdbparse import get_symm_ops
>>> Mlist,Tlist=get_symm_ops(b)
>>> for m in Mlist:
... print(str(m))
...
[[1. 0. 0.]
[0. 1. 0.]
[0. 0. 1.]]
[[-0.5 -0.866025 0. ]
[ 0.866025 -0.5 0. ]
[ 0. 0. 1. ]]
[[-0.5 0.866025 0. ]
[-0.866025 -0.5 0. ]
[ 0. 0. 1. ]]
Release History
- 1.0.7.4
- added logging functionality
- 1.0.7.3
- improved parsing of BIOMT transforms
- 1.0.7.2
- added documentation stub at readthedocs
- 1.0.7.1
- support for split BIOMT tables and REMARKS 280, 375, 650, and 700
- 1.0.7
- pretty-print enabled
- 1.0
- Initial version
Project details
Release history Release notifications | RSS feed
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.0.7.4.tar.gz
(778.0 kB
view details)
Built Distribution
File details
Details for the file pidibble-1.0.7.4.tar.gz
.
File metadata
- Download URL: pidibble-1.0.7.4.tar.gz
- Upload date:
- Size: 778.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1430e961329ccf92ccde3af53c9d98e653a67d1fcad277f5c57cbb42ccc7facb |
|
MD5 | 2a3b62d271d9aab1188fd3b00ba3f5b9 |
|
BLAKE2b-256 | 92a923f614b87e3cb3bb3dfc0e7678e699449b6663aef6f882859afd497dc1ec |
File details
Details for the file pidibble-1.0.7.4-py3-none-any.whl
.
File metadata
- Download URL: pidibble-1.0.7.4-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99a9a2f59a329102759edc38d03a9ac8f512e13306799f49befcd896e56b7f55 |
|
MD5 | 6a1b48c70cda92501074a4eed7d7f50a |
|
BLAKE2b-256 | 563d79b296b9493aa9ff2d10a4ea491a81c593b281524c16c08acd27aa75bfaf |