bindingdb-report

BindingDB report generator

Turn a huge BindingDB TSV file (millions of rows, 640 columns) into one self-contained HTML report that you can open in any browser, with no Python knowledge needed to read it.

Overview section of the report

Live example: https://turfstack.github.io/bindingdb-report/example_report/bindingdb_report.html (works once GitHub Pages is switched on for this repo)

What it does

Disclosure: AI-generated code

Most of this code was generated with the help of a large language model (Claude, by Anthropic), then run and checked by the author. It may contain mistakes. Please verify any number that matters to your work (see “Checking the numbers” below).

Requirements

Quick start

1. Get the code and install the packages

git clone https://github.com/turfstack/bindingdb-report.git
cd bindingdb-report
python -m venv .venv

Activate the environment:

source .venv/bin/activate          # Linux / macOS / WSL
.venv\Scripts\Activate.ps1         # Windows PowerShell
pip install -r requirements.txt

2. Try it on a small slice first (about a minute)

python bindingdb_report.py "path/to/BindingDB_All.tsv" --max-rows 100000 --out trial.html

3. Run it on the whole file

python bindingdb_report.py "path/to/BindingDB_All.tsv" --out bindingdb_report.html

Then open bindingdb_report.html in your browser.

Options

Option Default Meaning
tsv (required)   Path to the BindingDB TSV file
--out bindingdb_report.html Output HTML file
--chunk 50000 Rows read at a time. Lower it (for example 25000) if you run out of memory
--max-rows all rows Only profile the first N rows (trial run)
--title BindingDB data assessment Report title
--human-labels Homo sapiens, Human, Homo sapiens (Human) Organism spellings counted as human

How to read the report

Limitations

Checking the numbers

Two independent checks you can run yourself (Linux, macOS or WSL):

wc -l BindingDB_All.tsv

This counts lines. Subtract 1 for the header and compare with the row count in the report.

awk -F'\t' 'NR==1{for(i=1;i<=NF;i++) if($i=="Target Source Organism According to Curator or DataSource") c=i; next} $c=="Homo sapiens"||$c=="Human"||$c=="Homo sapiens (Human)"{n++} END{print n}' BindingDB_All.tsv

This counts rows with one of the three human labels. It should match the “Rows matching human labels” card, give or take a few rows where whitespace was trimmed.

Validation done so far:

Data, license and citation

This repository contains code and an example report only, not BindingDB data.

Liu T, Hwang L, Burley SK, Nitsche CI, Southan C, Walters WP, Gilson MK. BindingDB in 2024: a FAIR knowledgebase of protein-small molecule binding data. Nucleic Acids Research 53(D1):D1633-D1644 (2025). https://doi.org/10.1093/nar/gkae1075