Skip to content

Commit

Permalink
added new Wu clock
Browse files Browse the repository at this point in the history
  • Loading branch information
isglobal-brge committed Apr 26, 2021
1 parent 88dd23c commit c41aef0
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 1,372 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: methylclock
Type: Package
Title: Chronological and gestational DNAm age estimation using different methylation-based clocks
Version: 0.7.0
Date: 2021-03-24
Version: 0.7.2
Date: 2021-04-26
Authors@R: c( person("Dolors", "Pelegri-Siso", , "[email protected]", role = "aut"),
person("Juan R.", "Gonzalez", ,"[email protected]", role = c("aut", "cre")))
Description: Package to estimate DNA methylation age (DNAmAge) using different methylation clocks.
Expand Down
16 changes: 15 additions & 1 deletion R/DNAmGA.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ DNAmGA <- function(x, toBetas = FALSE,
as.character(coefKnightGA$CpGmarker[-1]),
coefBohlin$CpGmarker[-1],
as.character(coefMayneGA$CpGmarker[-1]),
as.character(coefLeeGA$CpGmarker[-1])
as.character(coefLeeGA$CpGmarker[-1]),
as.character(coefWuGA$CpGmarker[-1])
)

if (any(!cpgs.all %in% colnames(cpgs))) {
Expand Down Expand Up @@ -134,6 +135,16 @@ DNAmGA <- function(x, toBetas = FALSE,
Mayne = mayne
)


# --------------> Wu

wu <- predAge(cpgs.imp, coefWuGA, intercept = TRUE)
Wu <- data.frame(
id = rownames(cpgs.imp),
Wu = wu
)


# --------------> Lee


Expand Down Expand Up @@ -186,6 +197,7 @@ DNAmGA <- function(x, toBetas = FALSE,
Knight <- ageAcc1(Knight, age, lab = "Knight")
Bohlin <- ageAcc1(Bohlin, age, lab = "Bohlin")
Mayne <- ageAcc1(Mayne, age, lab = "Mayne")
Wu <- ageAcc1(Wu, age, lab = "Wu")
}
else {
cell.counts <- try(meffil.estimate.cell.counts.from.betas(
Expand All @@ -202,6 +214,7 @@ DNAmGA <- function(x, toBetas = FALSE,
Knight <- ageAcc2(Knight, df, lab = "Knight")
Bohlin <- ageAcc2(Bohlin, df, lab = "Bohlin")
Mayne <- ageAcc2(Mayne, df, lab = "Mayne")
Wu <- ageAcc2(Wu, df, lab = "Wu")
}
}
}
Expand All @@ -212,6 +225,7 @@ DNAmGA <- function(x, toBetas = FALSE,
out <- Knight %>%
full_join(Bohlin, by = "id") %>%
full_join(Mayne, by = "id") %>%
full_join(Wu, by = "id") %>%
full_join(Lee, by = "id")
out <- tibble::as_tibble(out)

Expand Down
11 changes: 7 additions & 4 deletions R/checkClocksGA.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,24 @@ checkClocksGA <- function(x, ...) {
coefBoh <- coefBohlin$CpGmarker[-1][!coefBohlin$CpGmarker[-1] %in% cpg.names]
checkBohlin <- coefBoh[!coefBoh %in% cpg.names]
checkMayne <- coefMayneGA$CpGmarker[-1][!coefMayneGA$CpGmarker[-1] %in% cpg.names]
checkWu <- coefWuGA$CpGmarker[-1][!coefWuGA$CpGmarker[-1] %in% cpg.names]
checkLee <- coefLeeGA$CpGmarker[-1][!coefLeeGA$CpGmarker[-1] %in% cpg.names]


sizes <- c(
length(checkKnight), length(checkBohlin),
length(checkMayne), length(checkLee)
length(checkMayne), length(checkWu),
length(checkLee)
)

n <- c(
nrow(coefKnightGA) - 1, length(coefBoh),
nrow(coefMayneGA) - 1, nrow(coefLeeGA) - 1
nrow(coefMayneGA) - 1, nrow(coefWuGA) - 1.
nrow(coefLeeGA) - 1
)

df <- data.frame(
clock = c("Knight", "Bohlin", "Mayne", "Lee"),
clock = c("Knight", "Bohlin", "Mayne", "Wu", "Lee"),
Cpgs_in_clock = n,
missing_CpGs = sizes,
percentage = round((sizes / n) * 100, 1)
Expand All @@ -54,7 +57,7 @@ checkClocksGA <- function(x, ...) {

out <- list(
Knight = checkKnight, Bohlin = checkBohlin,
Mayne = checkMayne, Lee = checkLee
Mayne = checkMayne, Wu = checkWy, Lee = checkLee
)
}
else {
Expand Down
Binary file added data/coefWu.rda
Binary file not shown.
1 change: 1 addition & 0 deletions vignettes/methylclock.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ This manual describes how to estimate chronological and gestational DNA methylat
- **Knight's clock**: It uses 148 CpGs described in @knight2016epigenetic. It was trained using 27K and 450K arrays in cord blood samples.
- **Bohlin's clock**: It uses 96 CpGs described in @bohlin2016prediction. It was trained using 450K array in cord blood samples.
- **Mayne's clock**: It uses 62 CpGs described in @mayne2017accelerated. It was trained using 27K and 450K.
- **Wu's clock**: It uses 111 CpGs described in @wu2019dna. It was trained using 27K and 450K.
- **Lee's clocks**: Three different biological clocks described in @lee2019placental are implemented. It was trained for 450K and EPIC arrays in placenta samples.
- **RPC clock**: Robust placental clock (RPC). It uses 558 CpG sites.
- **CPC clock**: Control placental clock (CPC). It usses 546 CpG sites.
Expand Down
11 changes: 11 additions & 0 deletions vignettes/methylclock.bib
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
@article{wu2019dna,
title={DNA methylation profile is a quantitative measure of biological aging in children},
author={Wu, Xiaohui and Chen, Weidan and Lin, Fangqin and Huang, Qingsheng and Zhong, Jiayong and Gao, Huan and Song, Yanyan and Liang, Huiying},
journal={Aging (Albany NY)},
volume={11},
number={22},
pages={10031},
year={2019},
publisher={Impact Journals, LLC}
}
@article{mcewen2019pedbe,
title={The PedBE clock accurately estimates DNA methylation age in pediatric buccal cells},
author={McEwen, Lisa M and O?Donnell, Kieran J and McGill, Megan G and Edgar, Rachel D and Jones, Meaghan J and MacIsaac, Julia L and Lin, David Tse Shen and Ramadori, Katia and Morin, Alexander and Gladish, Nicole and others},
Expand Down
1,365 changes: 0 additions & 1,365 deletions vignettes/methylclock.html

This file was deleted.

0 comments on commit c41aef0

Please sign in to comment.