Skip to main content

The 50-conformer probe: residue-resolved hydrogen-exchange opening free energies from conformational ensembles

Project description

hxprobe — the 50-conformer probe

Read residue-resolved hydrogen-exchange opening free energies out of a conformational ensemble.

hxprobe turns a conformational ensemble (from a generative model, molecular dynamics, or any source) into per-residue protection factors and opening free energies (ΔG_open, in kcal/mol) using a white-box, two-parameter physical operator. It is an inexpensive, physically interpretable probe of how well an ensemble reproduces the near-equilibrium local opening that hydrogen–deuterium exchange measures — and it converges within roughly 50 conformers, which is where the name comes from.

ln PF_i = β_C · ⟨N_C,i⟩ + β_H · ⟨N_H,i⟩            (ensemble average)
ΔG_open,i = RT · ln PF_i                            (EX2 regime)

N_C counts heavy atoms near each backbone amide nitrogen and N_H counts the amide's backbone hydrogen bonds, averaged over the ensemble. The two coefficients are fixed to their classical Best–Vendruscolo values (0.35 and 2.0) and are not fitted to stability data, so any residue-level signal the probe recovers comes from the ensemble, not from a tuned scoring function.

Install

pip install hxprobe

This pulls in numpy, pandas, and mdtraj. Two optional extras:

pip install "hxprobe[fix]"   # PDBFixer/OpenMM: repair + protonate raw structures
pip install "hxprobe[diff]"  # PyTorch: differentiable operator for steering

Quickstart

import hxprobe

# Score the bundled 50-conformer ubiquitin ensemble (already protonated).
res = hxprobe.score_ensemble(hxprobe.example_ensemble_path(), protonate="none")
print(res.to_dataframe().head())          # resSeq, resn, NC_mean, NH_mean, lnPF, dGopen_kcal

# Compare to experimental native-state HX opening free energies.
exp = hxprobe.load_experimental()          # {resSeq: dG_open}
ref = [exp.get(int(r), float("nan")) for r in res.resSeq]
print("Spearman vs experiment:", round(hxprobe.spearman(res.lnPF, ref), 3))

Score your own ensemble — a multi-model PDB, or a trajectory plus topology:

res = hxprobe.score_ensemble("my_ensemble.pdb")               # multi-model PDB
res = hxprobe.score_ensemble("traj.xtc", top="topology.pdb")  # trajectory + topology
res.to_csv("opening_free_energies.csv")

If your structures are raw heavy-atom coordinates without hydrogens, the H-bond term is obtained either by a geometric amide-H placement (default, no extra dependencies) or, more faithfully, with PDBFixer:

res = hxprobe.score_ensemble("raw_heavy_atom.pdb", protonate="pdbfixer")  # needs hxprobe[fix]

Command line

hxprobe example                       # run the bundled ubiquitin demo
hxprobe score my_ensemble.pdb         # print the per-residue table
hxprobe score traj.xtc --top top.pdb --out dG.csv
hxprobe converge my_ensemble.pdb      # show convergence with ensemble size

What you get back

score_ensemble returns a ProtectionResult with NumPy arrays and a .to_dataframe() / .to_csv() helper:

field meaning
resSeq, resn residue number and one-letter code
NC_mean, NH_mean ensemble-averaged contacts / hydrogen bonds
lnPF, log10PF log protection factor
dGopen_kcal opening free energy ΔG_open (kcal/mol)

Two further entry points:

  • convergence(ensemble) — Spearman correlation of the n-conformer readout against the full-ensemble readout (and, optionally, against an experimental reference), showing the plateau near ~50 conformers.
  • global_unfolding(ensemble)RT · min_c ⟨ln PF⟩_residues, the protection of the most-open conformer, a bounded proxy for global fold stability (the unfolded-state limit of the ensemble).

How it works

For each backbone amide (prolines and non-standard residues are skipped):

  • N_C — heavy atoms within 6.5 Å of the amide nitrogen, sequence separation |i − j| ≥ 3, hydrogens excluded.
  • N_H — backbone carbonyl oxygens within 2.6 Å of the amide hydrogen, sequence separation |i − j| ≥ 2.

Counts are computed per conformer and averaged over the ensemble before the linear combination is formed, so a residue that is buried in most conformers but exposed in a rare open state receives the reduced mean contact count its protection reflects. The contact term dominates, so the readout is robust even when hydrogens are placed geometrically rather than with a full protonation step.

Reproducing the bundled example

hxprobe example scores a 50-conformer leakage-free ubiquitin ensemble and recovers the experimental native-state opening free energies at Spearman ρ ≈ 0.58, with the correlation plateauing by ~25–50 conformers — the behaviour that motivates the probe.

Citing

If you use hxprobe, please cite the accompanying study on residue-resolved hydrogen-exchange free energies as a benchmark for generative conformational ensembles. (Reference to be added on publication.)

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hxprobe-0.1.0.tar.gz (992.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hxprobe-0.1.0-py3-none-any.whl (989.8 kB view details)

Uploaded Python 3

File details

Details for the file hxprobe-0.1.0.tar.gz.

File metadata

  • Download URL: hxprobe-0.1.0.tar.gz
  • Upload date:
  • Size: 992.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.18

File hashes

Hashes for hxprobe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8c4eb218a54d17ba95102d506aa4b4a30216c25a88dc12f239bd1144e36e9e1f
MD5 4b0ad6eed766bfdecbb3ed984ea7c868
BLAKE2b-256 ed7c88d073c239cd8872ffa3c4fecc350cc393efa2a6813b3cdfff6a6b20284d

See more details on using hashes here.

File details

Details for the file hxprobe-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hxprobe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 989.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.18

File hashes

Hashes for hxprobe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a4c1deccc960694c00959b4f8fce80b4e71d3e5a22d2f01328d4d11b503f4dc
MD5 74c2396dde3bd621f29d70227439a6c2
BLAKE2b-256 99f223f39dad0f5eaff2bf6593ef5706723f67d5239e7bdbce6e6ba564df3f26

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page