FUNCTION EXPLANATIONS - MorganLevineLab/PC-Clocks Wiki

calcPCClocks

This is the function sourced from R script run_calcPCClocks.R


Hannum G, Guinney J, Zhao L, Zhang L, Hughes G, Sadda S, Klotzle B, Bibikova M, Fan JB, Gao Y, Deconde R, Chen M, Rajapakse I, Friend S, Ideker T, Zhang K. Genome-wide methylation profiles reveal quantitative views of human aging rates. Mol Cell. 2013 Jan 24;49(2):359-367. doi: 10.1016/j.molcel.2012.10.016. Epub 2012 Nov 21. PMID: 23177740; PMCID: PMC3780611.

If you are interested in looking at the significance of individual PCs in your data, we encourage you to manually load and project the PCs for the clocks using the R commands:
load(file = paste(path_to_PCClocks_directory,"CalcAllPCClocks.RData", sep = ""))

run steps from function to restrict CpGs to the 78,464 sites, and perform mean imputation as necessary. Then:

sweep(as.matrix(datMeth),2,CalcPCHorvath1$center) %*% CalcPCHorvath1$rotation swap out the name of whichever clock you wish to look at in addition to PCHorvath1


calcPCClocks_Accel

This is the function sourced from R script run_calcPCClocks_Accel.R


clockColumns = c("PCHorvath1", "PCHorvath2", "PCHannum", "PCPhenoAge", "PCDNAmTL", "PCGrimAge")

for (i in clockColumns){ DNAmAge[,paste0(i,"Resid")] = resid(lm(DNAmAge[,i][1](/MorganLevineLab/PC-Clocks/wiki/1) ~ DNAmAge$Age + DNAmAge$[your-column-name(s)-here]))