Applications for DNA Methylation Analysis
June 19, 2025
Copying Code Blocks
All code blocks can be copied by clicking the clipboard icon in the upper right corner. If the icon is hidden, hovering your mouse cursor in the area should reveal it.
Scrolling Content
In come cases, content may wrap beyond the limits of the slide. It may be necessary to scroll up/down or left/right.
Let’s Keep it Simple, Silly
My goal is to focus largely on conceptual issues related to SLCMA and studies of DNA methylation. Although I briefly discuss the slcma
R Package created by Dr. Andrew Smith, this is not meant to be a full tutorial.
I’m Just a Padawan
Dr. Andrew Smith is a Jedi Master. I learned everything I know about SLCMA from him. Some materials have been borrowed/adapted from his teaching. I am grateful and humbled by the opportunity to learn from him.
Structured
Life
Course
Modeling
Approach
Which life course hypothesis best fits our data?
\[SP_j = x_j\]
\[Acc = \sum_{j=1}^m{x_j}\]
\[Rec = \sum_{j=1}^m{\left(x_jt_j\right)}\]
Variable | Description |
---|---|
y |
Outcome |
sp04 |
Binary Exposure (\(Age = 4\)) |
sp26 |
Binary Exposure (\(Age = 26\)) |
sp43 |
Binary Exposure (\(Age = 43\)) |
acc |
Accumulation |
rec |
Recency |
# set seed
set.seed(1234)
# simulate exposure & outcome data
n <- c(141, 20, 88, 80, 40, 35, 317, 367)
y <- c(28.7, 27.5, 29.1, 27.8, 28.3, 27.1, 27.6, 26.0)
se <- c(0.5, 1.1, 0.7, 0.7, 0.8, 0.9, 0.3, 0.2)
sp04 <- rep(c(0, 1, 0, 0, 1, 1, 0, 1), times = n)
sp26 <- rep(c(0, 0, 1, 0, 1, 0, 1, 1), times = n)
sp43 <- rep(c(0, 0, 0, 1, 0, 1, 1, 1), times = n)
e <- lm(rnorm(sum(n)) ~ sp04 * sp26 * sp43)$residuals
y <- rep(y, n) + rep(se * sqrt(n), n) * e / sd(e)
# construct accumulation & recency measures
acc <- sp04 + sp26 + sp43
rec <- (sp04 * 4) + (sp26 * 26) + (sp43 * 43)
# create data frame
dats_bin <- data.frame(cbind(y, sp04, sp26, sp43, acc, rec))
# clean up
rm(list = "n", "y", "se", "sp04", "sp26", "sp43", "acc", "rec", "e")
Hyp. | Coeff. | R2 |
---|---|---|
SP04 | -1.737 | 0.026 |
SP26 | -1.075 | 0.008 |
SP43 | -1.820 | 0.023 |
Acc | -0.964 | 0.034 |
Rec | -0.032 | 0.025 |
Hyp. | Coeff. | R2 |
---|---|---|
Acc + SP04 | -0.731 | 0.036 |
Acc + SP26 | -1.389 | 0.039 |
Acc + SP43 | -0.836 | 0.034 |
Acc + Rec | -1.179 | 0.034 |
Hyp. | Coeff. | R2 |
---|---|---|
Acc + SP26 + SP04 | -1.380 | 0.039 |
Acc + SP26 + SP43 | -1.396 | 0.039 |
Acc + SP26 + Rec | -1.397 | 0.039 |
Model | Hypothesis | R2 |
---|---|---|
1 | Acc | 0.034 |
2 | Acc + SP26 | 0.039 |
3 | Acc + SP26 + SP04 | 0.039 |
Call:
lm(formula = y ~ acc, data = dats_bin)
Residuals:
Min 1Q Median 3Q Max
-21.771 -3.318 -0.039 3.160 20.029
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 29.1837 0.3376 86.433 < 2e-16 ***
acc -0.9642 0.1566 -6.158 1.04e-09 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 5.215 on 1086 degrees of freedom
Multiple R-squared: 0.03373, Adjusted R-squared: 0.03285
F-statistic: 37.92 on 1 and 1086 DF, p-value: 1.039e-09
slcma
R Packageslcma
R Package simplifies everything.slcma
R Packageslcma
R Packageslcma
R Packageslcma
package is available on GitHubinstall_github()
command from the remotes
packageslcma_model <- slcma(y ~ sp04 + sp26 + sp43 +
Accumulation(sp04, sp26, sp43) +
Recency(weights = c(4, 26, 43), sp04, sp26, sp43),
data = dats_bin)
Term
(Intercept)
sp04
sp26
sp43
Accumulation(sp04, sp26, sp43)
Recency(weights = c(4, 26, 43), sp04, sp26, sp43)
Role
Adjusted for in all models
Available for variable selection
Available for variable selection
Available for variable selection
Available for variable selection
Available for variable selection
Inference for model at Step 1 of LARS procedure
Number of selected variables: 1
R-squared from lasso fit: 0.022
Results from fixed lasso inference (selective inference):
Standard deviation of noise (specified or estimated) sigma = 5.210
Testing results at lambda = 18.578, with alpha = 0.050
Coef P-value CI.lo CI.up LoTailArea
Accumulation(sp04, sp26, sp43) -0.964 0 -1.272 -0.63 0.024
UpTailArea
Accumulation(sp04, sp26, sp43) 0.024
selectiveInference
Packageslcma
PackageWhen true hypothesis is compound, power to select a single hypothesis is greater for Max-|t| Test than Fixed LASSO Inference.