Skip to content

Computing GrimAge From Your Own Methylation Data

Oak
A huge misty-valley beast ringed by glowing sensor pods, its hide covered in lit and unlit nodules forming a pattern.

By the end of this guide you will have a GrimAge estimate for yourself, an age-acceleration figure you can defend, and a clear sense of the error bars around both. What you need: raw IDAT files from an Illumina methylation array (450k, EPIC v1, EPIC v2, or the newer MSA), your chronological age at the time of the blood draw, your sex, R 4.3 or later with Bioconductor, and roughly 16 GB of RAM. Whole-genome sequencing will not substitute. GrimAge is defined on array beta values at specific CpG sites, and a WGS BAM tells you nothing about methylation unless the library was bisulfite or enzymatically converted. If you only have a vendor PDF with a single “biological age” number, stop and request the IDATs. Everything below depends on having them.

One thing to know before you start. The CpG weights for GrimAge have never been released publicly. There is no grimage_coefficients.csv on GitHub. The repositories that rank for “GrimAge github” are meffonym, dnaMethyAge, and methylCIPHER. They implement dozens of published clocks and generally do not include the original GrimAge, because the coefficients are not there to include. The canonical route is Horvath’s online calculator. The best open alternative is the principal-component version of the clock, PC-GrimAge, whose trained object is distributed. We will cover both.

1. Understand what GrimAge is estimating

GrimAge is a Cox model for time to death, re-expressed in units of years. It is not a prediction of your chronological age. The construction has two stages. First, elastic-net models are trained to predict plasma levels of seven proteins from methylation, along with smoking pack-years. Second, those eight DNAm surrogates plus chronological age and sex are entered into a mortality model. The linear predictor is then transformed into a value with the units of age 1. GrimAge version 2 adds DNAm surrogates for log C-reactive protein and log HbA1c.

Two consequences follow. Chronological age is an input, so GrimAge will always track your age closely, and the interesting quantity is the residual. And because the training target was mortality rather than age, GrimAge tends to outperform age-trained clocks on clinical endpoints. In a large cohort study it predicted all-cause mortality and multiple age-related phenotypes better than the Horvath, Hannum, and PhenoAge clocks 2. That result is the main reason people go to the trouble of computing it rather than a clock with public weights.

This also answers the common question about the limitations of the original Horvath clock. It was trained to predict calendar age across many tissues, and it does that well. Being an accurate age predictor caps how much mortality-relevant variance it can carry, because the part of the signal that correlates with age is precisely the part that says nothing new about you 2.

2. Generate beta values from the IDATs

Do your own normalization rather than trusting the vendor’s processed matrix. You want to see the QC metrics, and you want control over probe masking. We use sesame, because its default preprocessing chain handles dye bias and background well and its EPIC v2 and MSA support is current.

library(sesame)
sesameDataCache()

betas <- openSesame(
  "idats/",
  prep = "QCDPB",     # mask, channel inference, dye bias, pOOBAH, noob
  func = getBetas,
  BPPARAM = BiocParallel::MulticoreParam(4)
)
dim(betas)
sum(is.na(betas)) / length(betas)

The prep string is a pipeline. Q applies the quality mask for known problem probes, P is pOOBAH detection-based masking, and B is noob background correction. Expect a few percent of probes to come back as NA on a good sample. If more than about 5 percent are missing, or if the median unmethylated and methylated intensities are low, treat the array as suspect and rerun the sample.

The minfi route is equivalent for our purposes and is what most published pipelines used:

library(minfi)
rg   <- read.metharray.exp("idats/", force = TRUE)
mset <- preprocessNoob(rg)
detP <- detectionP(rg)
betas <- getBeta(mset)
betas[detP[rownames(betas), ] > 0.01] <- NA

Do not use functional normalization (preprocessFunnorm) on a single sample. The method estimates its adjustment from variation across samples and has nothing to work with when n equals one.

3. Harmonize probe identifiers across array versions

This is where most single-person clock calculations quietly go wrong. The clocks were trained on 450k and EPIC v1 probe IDs. If your data came off EPIC v2, your row names look like cg16867657_BC21 rather than cg16867657, and several clock CpGs are represented by more than one replicate probe. If your data came off the MSA array, the probe set is smaller and differently composed again.

Strip the suffix and average replicates before doing anything else:

library(data.table)
dt <- as.data.table(betas, keep.rownames = "probe")
dt[, probe := sub("_.*$", "", probe)]
agg <- dt[, lapply(.SD, mean, na.rm = TRUE), by = probe]
m <- as.matrix(agg[, -1]); rownames(m) <- agg$probe

Then check coverage against the clock’s CpG list and record the number. Cross-platform work shows that epigenetic age estimates from EPIC v2 and MSA data need explicit calibration before they can be compared to each other or to legacy results 3. A GrimAge computed on EPIC v2 and one computed on 450k are not interchangeable to the year. Keep your platform in the metadata for every run.

Missing CpGs are imputed to a cohort mean. Horvath’s calculator does this against an internal gold standard, and PC-Clocks does it against the reference means shipped with the object. Imputation is fine for a handful of probes and misleading for hundreds, so report the fraction imputed alongside the result.

4. Run the original GrimAge through the calculator

Go to the DNA Methylation Age Calculator hosted at UCLA and use the advanced blood analysis option. You upload two CSV files. The first is the beta matrix, with the probe identifier in the first column and one column per sample. The second is a sample annotation file. At minimum it holds a sample identifier, Age, Female coded 0 or 1, and Tissue set to a blood type. GrimAge will not be returned if age or sex is missing, because both are model inputs. Check the current template file on the site rather than trusting a format you read in a blog post, including this one.

Subset to the probes the calculator expects before uploading. The site publishes a mini-annotation file of roughly thirty thousand CpGs, and restricting to it takes the upload from gigabytes to tens of megabytes.

mini <- fread("datMiniAnnotation.csv")
keep <- intersect(mini$Name, rownames(m))
out  <- data.table(ProbeID = keep, m[keep, , drop = FALSE])
fwrite(out, "betas_for_calculator.csv")

pheno <- data.table(
  SampleID = colnames(m),
  Age      = 41.3,
  Female   = 0,
  Tissue   = "Blood WB"
)
fwrite(pheno, "pheno_for_calculator.csv")

Leave the calculator’s own normalization option on. It applies a BMIQ-style adjustment to a gold-standard reference, which is part of how the published models were defined. The output includes DNAmGrimAge and AgeAccelGrim, along with each of the component surrogates. Those components are DNAm pack-years, DNAm PAI-1, DNAm GDF-15 and the rest. Keep the components. They are more interpretable than the composite and they change differently over time.

5. Run PC-GrimAge locally if you want a reproducible pipeline

Uploading your methylome to a web form is not a pipeline you can version-control. The alternative we prefer for repeated use is the principal-component clock family from the Levine lab, available at MorganLevineLab/PC-Clocks. Instead of a few hundred individual CpGs, these models project thousands of probes onto principal components and regress on those, which substantially improves test-retest reliability.

# clone the repo, then download CalcAllPCClocks.RData (~1.5 GB) per the README
source("PC-Clocks/run_calcPCClocks.R")
source("PC-Clocks/run_calcPCClocks_Accel.R")

datMeth  <- t(m)                       # samples in rows, CpGs in columns
datPheno <- data.frame(Age = 41.3, Female = 0, Tissue = "Blood")
rownames(datPheno) <- rownames(datMeth)

pc <- calcPCClocks(
  path_to_PCClocks_directory = "PC-Clocks/",
  datMeth  = datMeth,
  datPheno = datPheno
)
pc[, c("PCGrimAge", "PCPhenoAge", "PCHorvath1")]

Two cautions. The RData object is large and the call will use most of your RAM on a laptop. And PC-GrimAge is trained to approximate GrimAge, not to equal it, so the two numbers will differ by a year or more on the same sample. Pick one and stay with it.

For the surrounding context, install the packages that do have public weights. perishky/meffonym will list what it carries with meffonym.models() and scores a matrix in one call. yiluyucheng/dnaMethyAge exposes availableClock() and methyAge(). Also compute DunedinPACE from danbelsky/DunedinPACE, which estimates pace of aging rather than a cumulative age and behaves differently from GrimAge in the same people 4. If you want a clock optimized for accuracy against chronological age as a comparison point, the Edinburgh models are trained and described with that goal 5.

6. Turn the estimate into an age acceleration you can defend

Age acceleration is the residual from regressing the clock output on chronological age in a reference sample. With one person you have no regression to run. Two workable options remain.

The first is to report DNAmGrimAge - Age directly and label it as such. This is not the same quantity as the published AgeAccelGrim and it carries a cohort- and sex-specific offset. The second, better option is to obtain a reference distribution. Published cohort papers report mean GrimAge acceleration and its spread in defined populations, so you can express your value as an approximate z-score against a stated reference 6.

Whichever you choose, write down the reference. Interpretation of age acceleration is population-dependent to a degree people underestimate. Socioeconomic factors are associated with epigenetic age acceleration and with the outcomes it predicts 7. Early-life adversity shows associations with next-generation GrimAge decades later 4. A single number without a stated comparison group is not interpretable.

Then decide what the number can and cannot do. GrimAge predicts group-level mortality and morbidity well 126. It is not a personal prognosis, and it is not a diagnostic test. In cognitively healthy centenarians, peripheral epigenetic aging still carried survival information independent of brain aging biomarkers, which tells you the signal is real and also that it is a statistical association across people 8. If any component looks alarming, particularly the DNAm surrogates for CRP or HbA1c, the right response is to order the corresponding clinical assay and discuss it with a physician. Do not treat a methylation surrogate as a lab result.

7. Plan the second measurement before you draw conclusions from the first

A single GrimAge is a point with unknown noise. Technical variation in array clocks is large enough that a difference of a year or two between two runs of the same DNA is unremarkable 9. Build the noise estimate into your design.

Split one blood draw into two aliquots and run both, ideally on the same chip. The spread between them is your technical floor. Then repeat the profile no sooner than 12 months later and prefer 24. Process the new sample with the identical pipeline version, array type, and preprocessing chain. Remember that chronological age is an input to GrimAge. A two-year gap will produce roughly two years of GrimAge increase from the age term alone, so you must compare acceleration to acceleration. Do not compare GrimAge to GrimAge.

Set an expectation for effect size before you look. Intervention studies that move these clocks tend to report changes in the range of a fraction of a year to a couple of years, as in work linking cardiorespiratory fitness improvements to epigenetic age deceleration 10. That is the same order as technical noise on a single-CpG clock, which is the strongest argument for using the PC versions and for running duplicates. If your two aliquots disagree by three years, no intervention result you compute from a single follow-up sample means anything.

Footnotes

  1. Ake T. Lu, Austin Quach, James G. Wilson, et al. DNA methylation GrimAge strongly predicts lifespan and healthspan. Aging, 2019. https://doi.org/10.18632/aging.101684 ↩ ↩2

  2. Cathal McCrory, Giovanni Fiorito, Belinda Hernandez, et al. GrimAge Outperforms Other Epigenetic Clocks in the Prediction of Age-Related Clinical Phenotypes and All-Cause Mortality. The Journals of Gerontology: Series A, 2020. https://doi.org/10.1093/gerona/glaa286 ↩ ↩2 ↩3

  3. Yui Tomo, Tatsuma Shoji, Ryo Nakaki. Cross-Platform Calibration of Epigenetic Age Between the EPICv2 and MSA Arrays. 2025. https://doi.org/10.64898/2025.12.10.693592 ↩

  4. Cathal McCrory, Giovanni Fiorito, Aisling M O’Halloran, et al. Early life adversity and age acceleration at mid-life and older ages indexed using the next-generation GrimAge and Pace of Aging epigenetic clocks. Psychoneuroendocrinology, 2022. https://doi.org/10.1016/j.psyneuen.2021.105643 ↩ ↩2

  5. Elena Bernabeu, Daniel L. McCartney, Danni A. Gadd, et al. Refining epigenetic prediction of chronological and biological age. Genome Medicine, 2023. https://doi.org/10.1186/s13073-023-01161-y ↩

  6. Jessica D. Faul, Jung Ki Kim, Morgan E. Levine, et al. Epigenetic-based age acceleration in a representative sample of older Americans: Associations with aging-related morbidity and mortality. Proceedings of the National Academy of Sciences, 2023. https://doi.org/10.1073/pnas.2215840120 ↩ ↩2

  7. Isabel Yannatos, Shana D. Stites, Courtney Boen, et al. Epigenetic age and socioeconomic status contribute to racial disparities in cognitive and functional aging between Black and White older Americans. 2023. https://doi.org/10.1101/2023.09.29.23296351 ↩

  8. Yaran Zhang, Marc Hulsman, Niccolò Tesi, et al. Peripheral Epigenetic Aging Predicts Survival in Cognitively Healthy Centenarians Independent of Brain Aging-Related Biomarkers. 2026. https://doi.org/10.64898/2026.05.01.26352140 ↩

  9. Simone Ecker, Stephan Beck. The epigenetic clock: a molecular crystal ball for human aging?. Aging, 2019. https://doi.org/10.18632/aging.101712 ↩

  10. Menno Van Damme, Sanne Stegen, Bram Steenwinckel, et al. Epigenetic age deceleration reflects exercise-induced cardiorespiratory fitness improvements. GeroScience, 2026. https://doi.org/10.1007/s11357-025-02076-9 ↩

Pothos builds longitudinal molecular profiles of individuals: whole-genome sequencing, single-cell RNA sequencing, and plasma proteomics, delivered as a detailed report, every data file, and stored cells. Build your profile.