pdbcraft is a lightweight Python package for parsing and manipulating PDB and PDBx/MMCIF files.
pdbcraft has no external dependencies and stores data in simple data structures (nested dictionaries) that can be easily modified with external tools.
With pdbcraft, you can:
- Build a structure from either a PDB or PDBx/MMCIF file. The structure is built using both atomic coordinates and connectivity information.
- Remove selected models, chains, segments, residues, and atoms.
- Keep only selected models, chains, segments, residues, and atoms.
- Renumber models and residues.
- Rename models, chains, segments, residues, and atoms.
- Modify attributes for models, chains, segments, residues, and atoms.
- Merge structures.
- Sort the atoms of specific residue types according to a custom order.
- Write a PDB file of your structure.
- Write a PDBx/MMCIF file of your structure.
- Write a FASTA file containing the sequences of the chains found in your structure. You can also write multiple FASTA files containing all chains in a specific model, all instances of a particular chain in all models, or each model's chain separately.
- ... all while your connectivity data gets updated accordingly if present in the original structure(s).
However, pdbcraft does not perform complex tasks such as structural alignments, hydrogen bond detection, or secondary structure assignment.
We recommend packages such as BioPython for these operations.
pdbcraft requires Python version 3.11 or higher.
Here, we provide a quick way to install the current version of pdbcraft.
A more complete installation guide will follow and will be hosted on ReadTheDocs as part of pdbcraft's documentation.
To install pdbcraft:
-
Download it as a zipped file from GitHub.
-
Rename it
pdbcraft
. -
Unzip it in your preferred location.
-
(Optional) Activate the Python virtual environment where you want to install it.
-
Install it with
pip
by running:pip install ./pdbcraft
Detailed documentation, with a description of the API and full-fledged tutorials, is under construction and will soon be available on ReadTheDocs.
For now, the documentation is available as HTML files in the pdbcraft/doc/build
directory. Navigate to the index.html
file and open it with your favorite browser to read the documentation.
We welcome reports for any bugs or problems you may encounter in the dedicated "issues" section on GitHub.