PRIDE Crosslinking Archive (XL-MS): sample notebook
A worked notebook for PRIDE Crosslinking Archive (XL-MS), with 3 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
- Rosetta Commons
- License
- cc0-1.0
- Size
- 13 parquet files, 1.68 MB on disk (225,113 rows across them, 75,038 distinct in XL_all)
- Format
- Parquet (in sampled files)
- Stored at
- Hugging Face (https://huggingface.co/datasets/RosettaCommons/PRIDE_Crosslinking_Archive)
- Access
- Free and public. No account with the data provider is needed.
The notebook
Crosslinks from PRIDE, checked against AlphaFold structures
Crosslinking mass spectrometry (XL-MS) identifications from 26 PRIDE projects, curated by Rosetta Commons: 75,038 crosslinks over 10 reagents, each with the two UniProt accessions and residue numbers. Intra-chain links carry the C-alpha to C-alpha distance on the AlphaFold Database model, so you can ask how often a reagent's links fit a predicted structure.
Source: RosettaCommons/PRIDE_Crosslinking_Archive, CC0, mounted read-only at /mnt/archive.
Start here. Click the grey cell below and press Shift+Enter. It counts one reagent's links and the share that fit within 30 Angstrom on the AlphaFold model. Then change CROSSLINKER to DSS, BS3 or sulfo-SDA and run it again.
import os, pandas as pd
ROOT = os.environ.get("SCIGANTIC_MOUNT_PATH", "/mnt/archive")
CROSSLINKER = "DSSO"
xl = pd.read_parquet(f"{ROOT}/data/XL_all-00000-of-00001.parquet")
one = xl[xl["Crosslinker"] == CROSSLINKER]
intra = one[(one["XL Type"] == "Intra") & (one["Residue A"] != one["Residue B"])]
print(f"{CROSSLINKER}: {len(one):,} rows ({len(intra):,} intra-chain, {len(one) - len(intra):,} inter or self)")
print(f"median C-alpha distance {intra['XL Distance'].median():.1f} A; {(intra['XL Distance'] <= 30).mean():.0%} within 30 A")
Clean before you count
Three things in this table change any statistic you compute:
- Read XL_all only. The other parquet files are subsets of it; all thirteen together hold 225,113 rows, three times the real count.
- Inter-chain distances are -1.0, a placeholder, not a measurement. Filter to intra-chain rows first.
- Duplicates. 14,515 rows are exact copies, and many links appear twice with A and B swapped. Canonicalize the residue pair, then drop duplicates. The 527 self-links (distance 0.0) are not constraints.
import numpy as np
intra = xl[(xl["XL Type"] == "Intra") & (xl["Residue A"] != xl["Residue B"])].copy()
lo, hi = np.minimum(intra["Residue A"], intra["Residue B"]), np.maximum(intra["Residue A"], intra["Residue B"])
intra["Residue A"], intra["Residue B"] = lo, hi
intra = intra.drop_duplicates(["Data Source", "Crosslinker", "Accession A", "Residue A", "Residue B"])
summary = intra.groupby("Crosslinker")["XL Distance"].agg(links="size", median="median", within_30A=lambda d: (d <= 30).mean())
summary.sort_values("links", ascending=False).round(2)
Output:
links median within_30A Crosslinker DSSO 20372 17.85 0.75 sulfo-SDA 8022 16.19 0.81 DSS 4772 22.82 0.64 BS3 1463 21.12 0.65 VSD 1378 16.66 0.83 TTD 1263 13.90 0.90 VTT 1198 15.44 0.89 UCCL 1012 16.11 0.82 Alkyne-BVSC 79 21.75 0.73 DSBU-d12 42 24.26 0.67
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(7, 3), dpi=80)
for name, color in [("DSSO", "#043874"), ("DSS", "#dc6c04"), ("sulfo-SDA", "#2e9e5b")]:
d = intra.loc[intra["Crosslinker"] == name, "XL Distance"]
ax.hist(d, bins=64, range=(0, 80), density=True, histtype="step", lw=1.6, color=color, label=f"{name} (n={len(d):,})")
ax.axvline(30, color="k", lw=0.8, ls="--"); ax.set_xlabel("C-alpha distance on the AlphaFold model (A), links up to 80 A"); ax.set_ylabel("density"); ax.legend()
plt.tight_layout(); plt.show()
Notes
- 797 accessions carry a suffix (-A on 796, an isoform -1 on one); strip it before a UniProt or AlphaFold lookup.
- A link's "violation" depends on the reagent: short and zero-length reagents (TTD, VTT, sulfo-SDA) fit far more often than DSS or BS3.
- Only links with valid UniProt IDs were kept, so this is not the whole PRIDE crosslinking archive.
Run it
Open this notebook to run it, see the dataset page for the full description, or browse the full catalog.