library(remotes)
install_github("perishky/meffonym")
In the example below, we show how to apply the Hannum clock (Hannum et al. 2013).
library(meffonym)
meth <- ... ## methylation matrix, rows=CpG site, columns=samples
age <- ... ## age for each sample
female <- ... ## sex for each sample (1=female,0=male)
ret <- meffonym.score(meth, "hannum")
cor(ret$score, age)
## [1] 0.9342
Some models require additional inputs or have optional steps:
calibrate
parameter to TRUE
in meffonym.score()
or by using the meffonym.horvath.age()
function.meffonym.score(meth,"horvath",calibrate=TRUE)$score
== meffonym.horvath.age(meth)
calibrate
parameter to TRUE
in meffonym.score()
or by using the meffonym.dunedinpace.estimate()
function.meffonym.score(meth, "dunedinpace", calibrate=TRUE)$score
== meffonym.dunedinpace.estimate(meth)
meffonym.score()
.
Alternatively, the meffonym.grimage()
function can be used.meffonym.score(rbind(meth,female=female,age=age))$score
== meffonym.grimage(meth,female,age)
meffonym.score()
for
the Horvath DNAmAge ('horvath'), Skin and Blood ('skin') and PedBE ('pedbe') models.
This behavior can be changed for all clocks by passing an alterative transformation
function to the transform
parameter.Models can be added temporarily to the package using
meffonym.add.models()
. However, these models will disappear as soon
as R is exited or meffonym
is reloaded. To add a model so that it
persists, create a new folder and add the model definition to
inst and add a new row for the model in
inst/models.csv. The model definition is encoded
in a csv file with two columns, pred.var
and coef
. One row can
optionally provide a model intercept with the pred.var
name
'intercept'.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.