R/predictAge.R
predictAge.Rd
predictAge
Multiplies the coefficients from one of three
epigenetic gestational age clocks, by the corresponding CpGs in a supplied
betas data.frame
.
predictAge(betas, type = "RPC")
A vector of length m
, containing inferred gestational age.
Predicts gestational age using one of 3 placental gestational age clocks: RPC, CPC, or refined RPC. Requires placental DNA methylation measured on the Infinium 27K/450k/EPIC methylation array. Ensure as many predictive CpGs are present in your data, otherwise accuracy may be impacted.
It's recommended that you have all predictive CpGs, otherwise accuracy may vary.
# Load placenta DNAm data
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
data(plBetas)
data(plPhenoData)
plPhenoData %>%
mutate(inferred_ga = predictAge(plBetas, type = "RPC"))
#> 558 of 558 predictors present.
#> # A tibble: 24 × 8
#> sample_id sex disease gestation_wk ga_RPC ga_CPC ga_RRPC inferred_ga
#> <fct> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 GSM1944936 Male preeclampsia 36 38.5 38.7 38.7 38.5
#> 2 GSM1944939 Male preeclampsia 32 33.1 34.2 32.6 33.1
#> 3 GSM1944942 Female preeclampsia 32 34.3 35.1 33.3 34.3
#> 4 GSM1944944 Male preeclampsia 35 35.5 36.7 35.5 35.5
#> 5 GSM1944946 Female preeclampsia 38 37.6 37.6 36.6 37.6
#> 6 GSM1944948 Female preeclampsia 36 36.8 38.4 36.7 36.8
#> 7 GSM1944949 Female preeclampsia 37 38.2 38.1 37.7 38.2
#> 8 GSM1944950 Male preeclampsia 35 35.9 38.0 35.1 35.9
#> 9 GSM1944951 Female normal/heal… 39 40.2 41.0 39.6 40.2
#> 10 GSM1944952 Male normal/heal… 38 39.7 39.6 39.5 39.7
#> # ℹ 14 more rows