Pdb2sql

Python package for querying PDB protein structure files with SQL

What it is

pdb2sql is a Python package that enables researchers and developers to process Protein Data Bank (PDB) files using familiar SQL queries. The tool parses ATOM records from PDB structures and loads them into a queryable database format, making it straightforward to extract, filter, and analyze molecular coordinate data without writing custom parsing code. Installation is handled through pip, and the project provides a quick start tutorial alongside comprehensive API documentation covering structure superposition, similarity calculations, and coordinate transformations.

The package targets computational biologists, structural bioinformaticians, and data scientists who work with protein structures and need a flexible way to interrogate atomic coordinates. By exposing PDB data through a SQL interface, pdb2sql lowers the barrier for complex selections such as residue-level filters, distance-based queries, and chain-specific extractions that would otherwise require specialized libraries or custom scripts.

Getting started takes approximately ten minutes according to the project's guided tutorial, which walks through loading a structure, running basic queries, and exporting results. The Python API exposes a PDB2SQL class with methods for common structural biology tasks including superposition alignment, root-mean-square deviation calculations, and coordinate transformations, all built on top of the underlying SQL engine.

Hosted on Read the Docs with versioned documentation, the project is maintained by the Netherlands eScience Center and distributed under an open source license. Its notable strengths include zero-configuration setup via pip, a lightweight dependency footprint, and the ability to integrate directly into existing Python data science workflows using pandas or NumPy for downstream analysis.

This description was generated by AI from the site's public content and may contain errors.

What you can do there

  • Query PDB ATOM records with SQL syntax
  • Perform structure superposition and alignment
  • Calculate structure similarity metrics
  • Apply coordinate transformations
  • Access versioned documentation and tutorials

Who it's for

Computational biologists and structural bioinformaticians analyzing protein structures

Frequently asked questions about pdb2sql.readthedocs.io

›What PDB record types does pdb2sql parse

Currently only ATOM records are parsed; HETATM and other PDB record types are ignored.

›How do I install pdb2sql

Run pip install pdb2sql from the command line to install the package from PyPI.

›Can I use pdb2sql for structure superposition

Yes, the Python API includes superposition functionality along with structure similarity and transformation utilities.

›Is there a tutorial for beginners

A ten minute quickstart tutorial is available in the documentation covering basic loading and querying workflows.

›Who maintains pdb2sql

The project is copyrighted by the Netherlands eScience Center and hosted on Read the Docs.

›Does pdb2sql work with large PDB files

The SQL-based approach is designed for efficient querying of parsed coordinate data, suitable for typical structural biology datasets.