pdb2sql
PD
Fast and versatile Python package that leverages SQL queries to parse, manipulate and process biomolecular structure files. The structure files should be in the PDB format and are available on www.rcsb.org.
Updated 50 months ago
9 2
Read/write protein structure mmCIF files using SQL with DuckDB
Query mmCIF (PDBx) structural-biology files with SQL, right inside DuckDB.
ATTACH a .cif file and every mmCIF category shows up as a normal DuckDB table — with column types inferred from the PDBx/mmCIF dictionary. No ETL, no schema design, no Python parsing loop: just SQL over macromolecular structure data.
LOAD 'mmcif.duckdb_extension';
-- Read only
ATTACH 'https://files.rcsb.org/download/1AMB.cif.gz' AS mmcifdb (TYPE mmcif);
SELECT count(*) FROM mmcifdb.atom_site;
-- Write
ATTACH '1amb_updated.cif' AS wdb (TYPE mmcif, READ_WRITE TRUE);
USE wdb;
BEGIN;
INSERT INTO atom_site (label_atom_id, Cartn_x, type_symbol) VALUES ('O1', 3.5, 'O');
UPDATE atom_site SET type_symbol='ZZ' WHERE label_atom_id='O1';
DELETE FROM atom_site WHERE label_atom_id='O1';
COMMIT; -- updates 1amb_updated.cif file
A software for AI-driven identification of unknown proteins in cryo-EM density maps
Fast and versatile Python package that leverages SQL queries to parse, manipulate and process biomolecular structure files. The structure files should be in the PDB format and are available on www.rcsb.org.