Skip to main content

MetaClock workflow

MetaClock workflow diagram

This repository contains workflows for chronological-age prediction, cross-domain generalization, biological-age and disease analysis, functional enrichment, and intervention analysis. GEO workflows download inputs into repository-local data directories. The workflow READMEs describe the required files and preparation steps.

Project overview

MetaClock is an integrated framework that combines predictions from multiple established epigenetic clocks into meta models. This repository organizes the reproducible downstream workflows used to evaluate chronological-age prediction, quantify generalization across array platforms, tissues, and species, and study biological-age associations with disease and interventions.

Environment

Install uv and create the locked Python 3.11 environment from the repository root:

uv sync --frozen

MetaClock Python package

The repository also provides the importable metaclock package

python -m pip install -e .

Input contract

metaclock.fit() accepts an in-memory anndata.AnnData object or an .h5ad file in pyaging's standard orientation:

  • rows are samples;
  • columns are DNAm or phenotype features;
  • feature names are stored in adata.var_names;
  • the numeric training response is stored in adata.obs["age"] by default.

Clocks that use phenotype covariates, such as GrimAge, require those covariates in the input matrix and adata.var_names according to pyaging's input rules.

Fit and predict

Pass any ordered list of pyaging component-model names. The fitted result is an sklearn-compatible pipeline whose predict() method first runs the same components in the same order and then applies the trained meta-regressor:

import metaclock

component_model_list = [
    "horvath2013",
    "hannum",
    "dnamphenoage",
]

model = metaclock.fit(
    train_adata,
    component_model_list,
    "elastic_net",
    target="age",
)

predicted_age = model.predict(test_adata)

The three positional arguments are the input data, component-model list, and model architecture. Set pyaging_dir when using a specific local pyaging weight cache. The component ordering used for fitting is retained for every later prediction.

To run the component clocks without fitting a meta-model:

component_outputs = metaclock.predict_components(
    test_adata,
    component_model_list,
)

Supported architectures are elastic_net, lasso, ridge, linear_regression, random_forest, svr, mlp, and lightgbm. The mlp architecture uses StandardScaler followed by sklearn's MLPRegressor; its network parameters can be overridden through model_params. LightGBM is part of the standard locked environment and uses its sklearn-compatible LGBMRegressor interface.

Fitted models can be saved with joblib and loaded for later prediction:

import joblib

joblib.dump(model, model_output_path)
loaded_model = joblib.load(model_output_path)
predicted_age = loaded_model.predict(test_adata)

Metadata

Release files for metaclock-analysis-workflows 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metaclock-analysis-workflows 0.1.0
File Size Uploaded
metaclock_analysis_workflows-0.1.0.tar.gz 9.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for metaclock-analysis-workflows 0.1.0
File Interpreter ABI Platform
metaclock_analysis_workflows-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.1 kB

Release files / metaclock_analysis_workflows-0.1.0.tar.gz

Download URL metaclock_analysis_workflows-0.1.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b7308b2d85f4bbec1b294644d441532691569c35d342b6b704b983b1cc557880
BLAKE2b-256 checksum
How to use checksums
e25c0f3ee328f231dc2501b0df75917f532428a84e1ce4e44cc30501697e3da7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.14

Release files / metaclock_analysis_workflows-0.1.0-py3-none-any.whl

Download URL metaclock_analysis_workflows-0.1.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
feac1d32288feffc6931792476820a5f1900efd7762387136ecf6bb95639ddb7
BLAKE2b-256 checksum
How to use checksums
1f92f1c564e5f82687583658a9d90e4d6d3ae0b5bbd5ff245ab730ea679a1505
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page