Playbook · Tools and pipelines
cif2plip: Protein-ligand interaction profiling using PLIP for co-folding outputs which produce CIF files
14 Jun 2026 · updated 17 Sep 2026 · 4 min read
cif2plip
CIF to strict PDB to PLIP. Trustworthy interaction profiling for co-folding outputs.
| π Website | marcdeller.com | βοΈ Contact | marc@marcdeller.com | π GitHub | bellcheddar/cif2plip |
CIF β strict PDB β PLIP protein-ligand interaction analysis
Why it matters: co-folding tools such as Boltz-2, AlphaFold 3, and Chai-1 emit ModelCIF files that quietly violate the PDB format (multi-character chain IDs, oversized residue names, no bond table), and naive conversion introduces a subtle CONECT-parsing bug that corrupts ligand perception and invents fictitious interactions. cif_to_plip diagnoses and fixes every one of these issues before PLIP ever sees the structure, so the protein-ligand interactions you report are real. It is useful for anyone doing structure-based drug design on predicted complexes: reliable, reproducible interaction fingerprints (H-bonds, salt bridges, pi-stacking, halogen bonds, metal coordination) straight from a raw co-folding CIF.
A single-file Python pipeline that converts a ModelCIF or mmCIF co-folding output into a format-compliant PDB file and feeds it directly into PLIP for full protein-ligand interaction profiling. Designed for downstream analysis of Boltz-2 and similar co-folding outputs where the input CIF carries no bond table and often contains multi-character chain IDs that break the PDB format specification.
Why this script exists
Modern co-folding tools (Boltz-2, AlphaFold 3, Chai-1) emit ModelCIF files with:
- Multi-character chain IDs (
JH1,J031, β¦) that exceed the single-character PDB column 22 limit - Residue names longer than 3 characters (
LIG1,SMOL, β¦) that overflow PDB columns 18β20 - No CONECT records β bond topology is absent from the file
NaΓ―vely converting such files with gemmi or pdb_tidy alone introduces a subtle but critical bug: pdb_tidy leaves a one-serial gap at each chain/TER boundary. Because OpenBabel maps CONECT records positionally by serial number, any gap causes records past that point to be silently discarded. The result is corrupted ligand perception β wrong SMILES, fictitious bonds in the PyMOL session, and invented PLIP interactions. cif_to_plip diagnoses and resolves all of these issues before PLIP ever sees the structure.
Pipeline
CIF input
β
ββ [1] gemmi parse + sanity check (single model enforced)
ββ [2] Remap multi-character chain IDs β single-character (A, B, C β¦)
ββ [3] Rename >3-char residue names β 3-char codes
ββ [4] Write strict PDB (element cols 77-78, TER records, occupancy/B padding)
ββ [5] pdb_tidy β renumber all serials contiguously (removes TER-boundary gap)
ββ [6] Generate intramolecular CONECT records from covalent-radius geometry
ββ [7] pdb_validate β format compliance check
ββ [8] PLIP β XML + TXT + PNG + PyMOL .pse
ββ [9] Flatten XML β interactions CSV + ligand summary CSV
Outputs
| File | Description |
|---|---|
<stem>.pdb | Standards-compliant PDB with contiguous serials and CONECT records |
<stem>_plip/<stem>_report.xml | Full PLIP XML report |
<stem>_plip/<stem>_report.txt | Human-readable PLIP text report |
<stem>_plip/*.png | Ray-traced binding-site images (one per ligand) |
<stem>_plip/*.pse | PyMOL session with PLIP interaction visualisation |
<stem>_interactions.csv | Tidy, flattened interactions table (one row per contact) |
<stem>_ligand_summary.csv | Per-ligand summary with SMILES, InChIKey, interaction counts |
Installation
Conda is recommended to manage the mixed Python/OpenBabel/PyMOL stack:
conda create -n cif2plip python=3.11 -y
conda activate cif2plip
# Core dependencies
pip install gemmi pdb-tools plip
# OpenBabel (required by PLIP for ligand perception)
conda install -c conda-forge openbabel -y
# Open-source PyMOL (required by PLIP for .pse session generation)
conda install -c conda-forge pymol-open-source -y
Verify the install:
python -m plip.plipcmd --help
pdb_tidy --help
Usage
python cif_to_plip.py <input.cif> [-o <output_dir>] [--no-plip]
Arguments
| Argument | Description |
|---|---|
cif | Input .cif / .mmcif file (required) |
-o, --outdir | Output directory (default: same directory as input) |
--no-plip | Convert to PDB only; skip PLIP analysis |
Examples
Run the full pipeline:
python cif_to_plip.py boltz_output/jak1_lig.cif -o results/jak1/
Convert only (useful for format validation or feeding into other tools):
python cif_to_plip.py model.cif --no-plip
Interaction types reported
PLIP detects and reports the following contact classes, all of which appear as distinct interaction_type values in the output CSV:
- Hydrophobic contacts
- Hydrogen bonds (donor/acceptor, with geometry)
- Water bridges
- Salt bridges
- Οβstacking (face-to-face and edge-to-face)
- Οβcation interactions
- Halogen bonds
- Metal coordination
Technical notes
Chain ID remapping
Chain IDs are assigned in order of appearance using the 62-character alphabet AβZ, aβz, 0β9. The mapping is printed to stdout at runtime.
Residue name truncation
Names exceeding 3 characters are truncated to their first 3 characters. Collisions are resolved by assigning sequential codes L01, L02, β¦ The mapping is printed to stdout.
CONECT generation
Bonds are perceived from covalent radii (Cordero et al., 2008) with a 0.45 Γ
tolerance. HβH pairs are excluded. The bond table is written using strictly 80-column CONECT records and inserted immediately before the END record, after all serials have been made contiguous.
Serial renumbering
All ATOM, HETATM, and TER records are renumbered sequentially from 1 with no gaps. This step is the fix for the OpenBabel CONECT-parsing bug described above.
Dependencies
| Package | Role |
|---|---|
| gemmi | CIF parsing and PDB writing |
| pdb-tools | pdb_tidy, pdb_validate |
| PLIP | Protein-ligand interaction profiling |
| OpenBabel | Ligand bond-order perception (PLIP dependency) |
| PyMOL (OSS) | .pse session generation (PLIP dependency) |
Licence
MIT
Citation
If you use this pipeline in published work, please cite PLIP:
Adasme MF et al. (2021). PLIP 2021: expanding the scope of the protein-ligand interaction profiler to DNA and RNA. Nucleic Acids Research, 49(W1), W530βW534. https://doi.org/10.1093/nar/gkab294
And gemmi if the CIF conversion step is central to your workflow:
Wojdyr M (2022). GEMMI: A library for structural biology. Journal of Open Source Software, 7(73), 4200. https://doi.org/10.21105/joss.04200
π€ Author
Marc C. Deller, D.Phil.
Structural biologist & drug discovery scientist