OpenBind: EV-A71 2A protease crystal structures with binding affinities: sample notebook
A worked notebook for OpenBind: EV-A71 2A protease crystal structures with binding affinities, with 10 code cells and the output each one printed. On Scigantic it opens in a hosted JupyterLab with the dataset already mounted, so nothing is downloaded first.
- Provider
- OpenBind Consortium
- License
- CC0 1.0
- Size
- 2,785 objects, 802 MB in the bucket
- Format
- Parquet, CSV, FASTA, PDB format (in sampled files)
- Stored at
- Amazon S3, s3://scigantic-openbind (us-east-1)
- Access
- Free and public. No account with the data provider is needed.
The notebook
Start here. Click the grey cell below and press Shift+Enter. It reads the OpenBind events table off the archive and takes about a second. Then change MIN_PKD to 5.5 and run it again.
# Start here: click this cell, press Shift+Enter.
import os
from pathlib import Path
import duckdb
MIN_PKD = 6.5 # try 5.5, then run again. pKD 6.5 is a KD of about 316 nM.
mount = Path(os.environ.get("SCIGANTIC_MOUNT_PATH") or Path.home() / "archive")
REL = mount / "ev-a71-2a" / "v2-20260828"
events = REL / "parquet" / "events.parquet"
n, comp, with_pkd = duckdb.sql(
f"SELECT count(*), count(distinct compound_group), count(experimental_pkd) FROM '{events}'").fetchone()
print(f"{n} crystallographic binding events, {comp} compounds, {with_pkd} events with a measured pKD")
hits = duckdb.sql(f"""
SELECT complex_name, smiles, experimental_pkd, resolution_a FROM '{events}'
WHERE experimental_pkd >= {MIN_PKD} ORDER BY experimental_pkd DESC""").df()
print(f"{len(hits)} events at pKD >= {MIN_PKD}")
best = hits.iloc[0]
print(f"strongest: {best.complex_name}, pKD {best.experimental_pkd:.2f}, solved at {best.resolution_a:.2f} A")
print(best.smiles)
OpenBind: EV-A71 2A protease structures with affinities
This is the first public release of the OpenBind consortium, generated at Diamond Light Source: crystal structures of the enteroviral 2A protease with a bound small molecule, and a measured binding affinity (pKD, from a Creoptix WAVEsystem) for some of them. The protein is CVA16 2A protease, used as a surrogate for EV-A71 2A. The data is CC0.
The archive has two releases under ev-a71-2a/. This notebook reads v2-20260828, the current Zenodo record. The older v1-20260505 is kept as a zip because it alone holds the docking-prepared structures.
Everything below reads three parquet tables from parquet/: events (one row per binding event), ligand_poses (the ligand as an SDF) and contacts (protein residues within 4.5 A of the ligand).
import duckdb, numpy as np, pandas as pd
import matplotlib.pyplot as plt
con = duckdb.connect()
for f in sorted((REL / "parquet").glob("*.parquet")):
con.execute(f"CREATE OR REPLACE VIEW {f.stem} AS SELECT * FROM read_parquet('{f}')")
for t in ("events", "ligand_poses", "contacts"):
print(f"{t}: {con.sql(f'SELECT count(*) FROM {t}').fetchone()[0]:,} rows")
Output:
events: 925 rows ligand_poses: 925 rows contacts: 15,066 rows
Events, compounds and affinities
An event is one ligand modelled in one crystal. A compound can have several events, so there are fewer compounds than events. The release metadata gives a pKD for some events only.
con.sql("""
SELECT 'binding events' AS what, count(*) AS n FROM events
UNION ALL SELECT 'compounds (distinct SMILES)', count(distinct smiles) FROM events
UNION ALL SELECT 'events with a pKD', count(experimental_pkd) FROM events
UNION ALL SELECT 'compounds with a pKD', count(distinct smiles) FILTER (WHERE has_affinity) FROM events
UNION ALL SELECT 'fragment-screen events', count(*) FILTER (WHERE fragment_screen) FROM events
UNION ALL SELECT 'fragment-screen events with a pKD', count(*) FILTER (WHERE fragment_screen AND has_affinity) FROM events
UNION ALL SELECT 'covalent events', count(*) FILTER (WHERE covalent) FROM events
""").df()
Output:
what n 0 binding events 925 1 compounds (distinct SMILES) 699 2 events with a pKD 649 3 compounds with a pKD 499 4 fragment-screen events 113 5 fragment-screen events with a pKD 5 6 covalent events 2
Quality flags in the release
The release flags some events and does not remove them. suspected_artefact and pb_valid_ref come straight from the release metadata. The last row applies all three conditions together.
con.sql("""
SELECT 'suspected_artefact' AS flag, count(*) FILTER (WHERE suspected_artefact) AS events FROM events
UNION ALL SELECT 'pb_valid_ref is false', count(*) FILTER (WHERE NOT pb_valid_ref) FROM events
UNION ALL SELECT 'has a pKD, valid pose, not an artefact',
count(*) FILTER (WHERE has_affinity AND pb_valid_ref AND NOT suspected_artefact) FROM events
""").df()
Output:
flag events 0 suspected_artefact 39 1 pb_valid_ref is false 28 2 has a pKD, valid pose, not an artefact 621
Resolution and ligand size
Resolution and R-factors are parsed from each structure's PDB header; ligand properties are computed with RDKit from the stored pose.
con.sql("""
SELECT 'resolution (A)' AS quantity,
round(min(resolution_a), 2) AS min, round(median(resolution_a), 2) AS median, round(max(resolution_a), 2) AS max FROM events
UNION ALL SELECT 'R-free', round(min(r_free), 3), round(median(r_free), 3), round(max(r_free), 3) FROM events
UNION ALL SELECT 'ligand heavy atoms', min(ligand_heavy_atoms), median(ligand_heavy_atoms), max(ligand_heavy_atoms) FROM events
UNION ALL SELECT 'ligand mol. weight', round(min(ligand_mw), 1), round(median(ligand_mw), 1), round(max(ligand_mw), 1) FROM events
UNION ALL SELECT 'pKD', round(min(experimental_pkd), 2), round(median(experimental_pkd), 2), round(max(experimental_pkd), 2) FROM events
""").df()
Output:
quantity min median max 0 resolution (A) 1.010 1.470 2.750 1 R-free 0.169 0.225 0.444 2 ligand heavy atoms 6.000 21.000 35.000 3 ligand mol. weight 86.100 304.400 504.700 4 pKD 3.440 4.940 7.940
The distribution of pKD
pkd = con.sql("SELECT experimental_pkd AS pkd FROM events WHERE has_affinity").df().pkd
fig, ax = plt.subplots(figsize=(7, 3.4))
ax.hist(pkd, bins=np.arange(3.25, 8.25, 0.25), color="#2f6fb0", edgecolor="white")
ax.set_xlabel("pKD (higher is tighter)"); ax.set_ylabel("events")
ax.set_title(f"{len(pkd)} events with a pKD, median {pkd.median():.2f}")
ax.spines[["top", "right"]].set_visible(False)
plt.tight_layout(); plt.show()
How many events per compound, and how many ligand copies per structure
Events that share a SMILES have the same compound_group. A structure can also hold more than one copy of the ligand, one in each protein chain. ligand_chain and ligand_res_seq say which copy an event's pose is.
print("events per compound")
display(con.sql("""SELECT events AS events_per_compound, count(*) AS compounds
FROM (SELECT compound_group, count(*) AS events FROM events GROUP BY 1) GROUP BY 1 ORDER BY 1""").df())
print("ligand copies per structure")
con.sql("""SELECT n_lig_copies_in_structure AS ligand_copies, count(*) AS structures
FROM events GROUP BY 1 ORDER BY 1""").df()
Output:
events per compound ligand copies per structure ligand_copies structures 0 1 632 1 2 291 2 3 2
The ten tightest binders
Drawn in 2D from the stored ligand poses, one row per compound (the best-resolved crystal), using events with a valid pose that are not flagged as artefacts.
from rdkit import Chem
from rdkit.Chem import Draw, AllChem
top = con.sql("""
SELECT DISTINCT ON (smiles) complex_name, experimental_pkd AS pkd, resolution_a
FROM events WHERE has_affinity AND pb_valid_ref AND NOT suspected_artefact
ORDER BY smiles, resolution_a
""").df().sort_values("pkd", ascending=False).head(10)
poses = con.sql("SELECT complex_name, ligand_sdf FROM ligand_poses").df().set_index("complex_name").ligand_sdf
mols, legends = [], []
for r in top.itertuples():
m = Chem.MolFromMolBlock(poses[r.complex_name])
AllChem.Compute2DCoords(m) # 2D drawing only; the stored pose stays 3D
mols.append(m); legends.append(f"{r.complex_name[-5:]} pKD {r.pkd:.2f}")
Draw.MolsToGridImage(mols, molsPerRow=5, subImgSize=(230, 190), legends=legends)
One structure, read
This is the one place a PDB file is opened. gemmi reads complex_ref.pdb for the tightest binder above and finds the ligand copy the event refers to. The residue counts come from the file; the contact count comes from the contacts table.
import gemmi
best = top.iloc[0]
ev = con.sql(f"""SELECT complex_ref_path, ligand_chain, ligand_res_seq, n_lig_copies_in_structure, n_contact_residues
FROM events WHERE complex_name = '{best.complex_name}'""").fetchone()
st = gemmi.read_structure(str(REL / ev[0]))
print(f"{best.complex_name}: pKD {best.pkd:.2f}, resolution {best.resolution_a:.2f} A, space group {st.spacegroup_hm}")
for ch in st[0]:
kinds = {}
for r in ch:
kinds[r.name if r.het_flag == "H" else "protein residue"] = kinds.get(r.name if r.het_flag == "H" else "protein residue", 0) + 1
print(f" chain {ch.name}: {dict(kinds)}")
lig = next(r for c in st[0] for r in c if r.name == "LIG" and c.name == ev[1] and r.seqid.num == ev[2])
print(f"ligand: chain {ev[1]}, residue {ev[2]}, {len(lig)} atoms; ligand copies in this structure: {ev[3]}")
print(f"{ev[4]} protein residues within 4.5 A of the ligand (contacts table)")
con.sql(f"SELECT chain, res_name, res_seq, min_dist_a FROM contacts WHERE complex_name = '{best.complex_name}' ORDER BY min_dist_a LIMIT 8").df()
Output:
A71EV2A-x7259a: pKD 7.94, resolution 1.75 A, space group C 1 2 1
chain B: {'ZN': 1}
chain A: {'protein residue': 139, 'LIG': 1}
chain E: {'HOH': 5}
chain W: {'HOH': 11}
ligand: chain A, residue 4000, 28 atoms; ligand copies in this structure: 1
18 protein residues within 4.5 A of the ligand (contacts table)
chain res_name res_seq min_dist_a
0 A SER 105 2.807
1 A GLN 95 2.912
2 A GLY 127 2.932
3 A ARG 93 2.983
4 A SER 125 2.994
5 A TYR 90 3.226
6 A THR 126 3.280
...
More OpenBind data in this session
OpenBind's two Fragalysis fragment screens, FatA (a plant enzyme and herbicide target) and the dengue 2 and Zika NS5 polymerases, are mounted beside this archive under ~/additional-datasets/. They are structures only, with no affinity measurements. They are hosted with OpenBind's permission, and OpenBind has not published a license for them, so credit OpenBind and the Diamond Light Source XChem facility. Their schema card is on that archive's Data tab.
The table puts all four proteins side by side. An observation is one ligand modelled in one crystal, the same unit as an event above.
extra = next(iter(sorted((Path.home() / "additional-datasets").glob("*openbind-fragalysis*"))), None)
if extra is None:
raise SystemExit("The Fragalysis archive is not mounted under ~/additional-datasets in this session.")
FATA_EV = extra / "FatA" / "v3.1-2026-07-28" / "parquet" / "events.parquet"
FLAVI_EV = extra / "Flavi_NS5_RdRp" / "v3.1-2026-09-01" / "parquet" / "events.parquet"
con.sql(f"""
SELECT protein, observations, compounds, round(median_res, 2) AS median_resolution_a,
median_heavy_atoms, measured_pkd
FROM (
SELECT 'EV-A71 / CVA16 2A protease' AS protein, count(*) AS observations, count(distinct smiles) AS compounds,
median(resolution_a) AS median_res, median(ligand_heavy_atoms) AS median_heavy_atoms,
count(experimental_pkd) AS measured_pkd FROM events
UNION ALL
SELECT 'FatA', count(*), count(distinct smiles), median(resolution_a), median(ligand_heavy_atoms), 0
FROM '{FATA_EV}' WHERE NOT is_pdb_reference
UNION ALL
SELECT CASE soakdb_ProteinName WHEN 'DNV2_NS5A' THEN 'Dengue 2 NS5 RdRp' ELSE 'Zika NS5 RdRp' END,
count(*), count(distinct smiles), median(resolution_a), median(ligand_heavy_atoms), 0
FROM '{FLAVI_EV}' WHERE soakdb_ProteinName IN ('DNV2_NS5A', 'Zika_NS5A') GROUP BY soakdb_ProteinName
) ORDER BY observations DESC
""").df()
Output:
protein observations compounds median_resolution_a \ 0 EV-A71 / CVA16 2A protease 925 699 1.47 1 FatA 402 165 1.83 2 Zika NS5 RdRp 258 141 1.84 3 Dengue 2 NS5 RdRp 120 95 1.75 median_heavy_atoms measured_pkd 0 21.0 649 1 14.0 0 2 14.0 0 3 15.0 0
Things to know when using this data
- Events are not compounds. Count compound_group or distinct smiles for compounds.
- The affinity count differs from the Zenodo text. The files carry a pKD for 649 events (499 compounds). The Zenodo description
says 601 compounds. OpenBind's benchmark repo lists the same 649 events, and its raw measurement table covers about 595 to 625 compounds depending on how identity is counted, which is the likely origin of 601 (an inference; none of those counts is exactly 601).
- The release flags rather than filters. Apply pb_valid_ref and suspected_artefact yourself.
- Structures are not guaranteed to share a coordinate frame. Superpose on protein atoms before comparing poses between events.
- The Fragalysis datasets have no affinities and no published license. measured_pkd is 0 for those three proteins because the
data holds structures only. Credit OpenBind and the Diamond Light Source XChem facility.
- The archive's schema card (the Data tab, and the in-notebook assistant) lists the measured details, including a PDB parsing
problem in 224 of the 925 delig-desolv.pdb files.
Run it
Open this notebook to run it, see the dataset page for the full description, or browse the full catalog.