pdb_cpp
pdb_cpp is a structural bioinformatics toolkit with a C++ core and Python API for fast PDB/mmCIF parsing, atom selection, sequence/structure alignment, TM-score, and DockQ evaluation.
What is included
- Read/write
.pdb,.cif,.pqr, and.grofiles - Atom/residue/chain selections (including geometric
withinqueries) - Sequence extraction and pairwise sequence alignment
- Sequence-based structural superposition and chain-permutation alignment
- TM-align/TM-score through the bundled USalign/TM-align core
- DockQ metrics (
DockQ,Fnat,Fnonnat,LRMS,iRMS,rRMS) - Hydrogen bond detection (Baker & Hubbard geometric method, no explicit H required)
- Solvent-accessible surface area (Shrake-Rupley) on
Model, plus buried protein-protein surface and shape-complementarity helpers - Secondary structure assignment
- Core geometric helpers (e.g., distance matrix)
Installation
From PyPI
python -m pip install pdb-cpp
From source
git clone https://github.com/samuelmurail/pdb_cpp
cd pdb_cpp
python -m pip install -e .
For development:
python -m pip install -r requirements.txt
pytest
Quick start
from pdb_cpp import Coor
# Load from local file
coor = Coor("tests/input/1y0m.cif")
# Or fetch by PDB ID (mmCIF is downloaded and cached)
coor_pdb = Coor(pdb_id="1y0m")
# Or use the RCSB helper for explicit structure choices
from pdb_cpp import rcsb
bio_assembly = rcsb.load("5a9z", structure="biological_assembly", assembly_id=1)
asym_unit = rcsb.load("5a9z", structure="asymmetric_unit")
print(coor.model_num) # number of models
print(coor.get_aa_seq()) # chain -> sequence
# Write selection/structure back to disk
coor.write("out_structure.pdb")
Documentation map
For complete usage documentation, use the project docs site and source pages:
- Basic tutorial:
docs/source/basic_example.md - Full feature guide:
docs/source/functionality.md - Copy-paste recipes:
docs/source/quick_recipes.md - Installation and build notes:
docs/source/installation.md - API reference entry:
docs/source/pdb_cpp.rst
Online docs: https://samuelmurail.github.io/pdb_cpp/
Documentation
- API and examples: https://samuelmurail.github.io/pdb_cpp/
- Docs sources:
docs/source/
Notes for contributors (C++ core)
When adding C++ features:
- Add implementation files in
src/pdb_cpp/_core/ - Register sources in
setup.py - Expose bindings in
src/pdb_cpp/_core/pybind.cpp - Reinstall extension (
pip install -e . --no-build-isolation) and run tests
Metadata
Release files for pdb-cpp 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pdb_cpp-0.2.3.tar.gz | 199.0 kB | Without provenance | Details for pdb_cpp-0.2.3.tar.gz |
Release files / pdb_cpp-0.2.3.tar.gz
| Download URL | pdb_cpp-0.2.3.tar.gz |
|---|---|
| Size | 199.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5ea295088c237baf8e5a9dc0c7012bdc6cdaacd0918d43e540ee50dd1387d838
|
|
BLAKE2b-256 checksum How to use checksums |
4336029cc3bec0b5953217d0d4038195fd33b0cb5b314b78faca78656c4af82a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for pdb-cpp 0.2.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.