Skip to main content

Benchmark biological aging clocks on your data — PhenoAge, KDM, DunedinPACE proxy

Project description

AgingClockBench

PyPI version Tests Coverage Docs License: MIT Python 3.11+

Benchmark biological aging clocks on your data in minutes.

Multiple biological aging clocks exist — PhenoAge, KDM, DunedinPACE — but no standard tool lets researchers compare them side-by-side. AgingClockBench is the first open-source Python package implementing multiple clocks with a unified interface and reproducible mortality-validated benchmarking.

📖 Full Documentation


Install

pip install agingclockbench

Requires Python 3.11+.


Quick Start

from agingclockbench import PhenoAge, KDM, BenchmarkSuite
from agingclockbench.datasets import load_nhanes_sample

# Load bundled NHANES 1999-2000 (N=4,086, 20-year mortality follow-up)
df = load_nhanes_sample()

# Compute biological ages
results = {
    "PhenoAge": PhenoAge().transform(df),
    "KDM":      KDM().transform(df),
}

# Benchmark against mortality
suite = BenchmarkSuite(mortality_col="mortstat", followup_col="permth_exm")
report = suite.run(df, results)

print(report.to_dataframe())
Clock     Pearson r  Mort HR (per SD accel)  Mort p-value
PhenoAge      0.930                    1.83      0.000001
KDM           0.677                    1.41      0.000001
report.plot_km_survival()      # Kaplan-Meier by acceleration quartile
report.plot_comparison()       # biological age vs chronological age
report.to_html("report.html")  # interactive Plotly report

CLI

# Benchmark on bundled NHANES with HTML report
agingclockbench benchmark --data bundled --clocks all --report

# Your own data
agingclockbench benchmark \
  --data my_cohort.csv \
  --clocks PhenoAge KDM \
  --mortality-col vital_status \
  --followup-col followup_months \
  --output ./results/

Implemented Clocks

Clock Reference Biomarkers Key metric (NHANES)
PhenoAge Levine et al. 2018 Aging Cell 9 blood Pearson r=0.93, HR=1.83
KDM Klemera & Doubal 2006 Mech Ageing Dev 8 blood Pearson r=0.68, HR=1.41
DunedinPACEProxy Proxy (NOT Belsky 2022) 7 blood pace corr w/ PhenoAge accel r=0.84

Note: DunedinPACEProxy is a blood-biomarker approximation. The real DunedinPACE requires DNA methylation data (Illumina EPIC array).


Features

  • Unified interface — all clocks share the same transform() API
  • Validated — PhenoAge implementation cross-validated against reference; zero numerical difference on N=4,086 NHANES participants
  • Mortality benchmarking — Cox PH hazard ratios, Kaplan-Meier curves
  • Bundled data — NHANES 1999-2000 with 20-year mortality follow-up, ready to use
  • Interactive reports — Plotly HTML with comparison plots and benchmark table
  • CLI toolagingclockbench benchmark works out of the box
  • 89% test coverage — 76+ tests, CI/CD on every push

Documentation

Resource Link
Full docs aadityageddam-ux.github.io/aging_clock_bench
Quickstart docs/quickstart
PhenoAge algorithm docs/algorithms/phenoage
FAQ docs/faq
Example notebooks examples/

Citation

If you use AgingClockBench in your research, please cite:

@software{geddam2026agingclockbench,
  author = {Geddam, Aaditya},
  title  = {AgingClockBench: Benchmarking biological aging clocks},
  url    = {https://github.com/aadityageddam-ux/aging_clock_bench},
  year   = {2026}
}

Also cite the underlying clock papers:

  • Levine ME, et al. Aging Cell. 2018. (PhenoAge)
  • Klemera P, Doubal S. Mech Ageing Dev. 2006. (KDM)

Contributing

Contributions welcome! See CONTRIBUTING.md.

To add a new clock, implement the BaseClock interface — see the FAQ.


License

MIT © Aaditya Geddam

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

agingclockbench-0.1.0.tar.gz (82.6 kB view details)

Uploaded Source

Built Distribution

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

agingclockbench-0.1.0-py3-none-any.whl (87.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agingclockbench-0.1.0.tar.gz
  • Upload date:
  • Size: 82.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Linux/6.17.0-1015-azure

File hashes

Hashes for agingclockbench-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2ebe758c4f541853ea70f3a2d2a08f1dc0ebb7331b2e4023f04246c3ed918b2a
MD5 4b8b612fd86b6250d4280760efe10a38
BLAKE2b-256 5f4bf966070a85223db4221b3372d6b9f2ab4f3bf3e477fcd45981a8d154c665

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agingclockbench-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 87.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Linux/6.17.0-1015-azure

File hashes

Hashes for agingclockbench-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c3752f31e967a5b12c2bdbee2203cdd83671b6a08b65979b7d603f6ff11306cc
MD5 5b72f3a4f0f06e03807ad6fae12cb1da
BLAKE2b-256 17197ab8a4036efa4b1c89358545f28bf30a17fa16c4c033eebdf0dedb8252f7

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