diff --git a/404.html b/404.html index 7ea7a9b..db215ea 100644 --- a/404.html +++ b/404.html @@ -4,83 +4,201 @@ - + Page not found (404) • MotrpacRatTraining6moWATData - - - + + + - + + - - Skip to contents + -
-
-
+ + + +
+
+ Content not found. Please use links in the navbar. -
+
+ + +
- + diff --git a/LICENSE-text.html b/LICENSE-text.html index a4849f2..a364306 100644 --- a/LICENSE-text.html +++ b/LICENSE-text.html @@ -1,65 +1,178 @@ -License • MotrpacRatTraining6moWATDataLicense • MotrpacRatTraining6moWATData - Skip to contents + -
-
-
+
+ - + diff --git a/LICENSE.html b/LICENSE.html index b050aa4..ffdf95d 100644 --- a/LICENSE.html +++ b/LICENSE.html @@ -1,44 +1,149 @@ -MIT License • MotrpacRatTraining6moWATDataMIT License • MotrpacRatTraining6moWATData - Skip to contents + -
-
-
+
+ - + diff --git a/articles/ADIPOCYTE_SIZE_STATS.html b/articles/ADIPOCYTE_SIZE_STATS.html new file mode 100644 index 0000000..365802c --- /dev/null +++ b/articles/ADIPOCYTE_SIZE_STATS.html @@ -0,0 +1,421 @@ + + + + + + + +Statistical analysis of adipocyte diameter • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + + +
+

Regression Model +

+
+# Count adipocytes by bin and experimental group
+count_summary <- ADIPOCYTE_SIZE %>%
+  group_by(pid, sex, timepoint, diameter_bin) %>%
+  summarise(binned_adipocytes = n(),
+            .groups = "keep") %>%
+  group_by(pid) %>%
+  mutate(total_adipocytes = sum(binned_adipocytes),
+         adipocyte_prop = binned_adipocytes / total_adipocytes) %>%
+  ungroup()
+
+# Negative Binomial GLM with log link and offset
+fit <- glm.nb(binned_adipocytes ~ sex * timepoint * diameter_bin +
+                offset(log(total_adipocytes)),
+              link = "log",
+              data = count_summary)
+
+plot_lm <- function(x) {
+  on.exit(par(mfrow = c(1, 1)))
+  par(mfrow = c(2, 3))
+  for (i in 1:6) plot(x, which = i)
+}
+
+plot_lm(fit)
+

+

Observations 18 and 19 appear to be outlying, but there are almost +56K observations in the data, so they will not substantially affect the +model fit.

+
+# Model summary
+summary(fit)
+#> 
+#> Call:
+#> glm.nb(formula = binned_adipocytes ~ sex * timepoint * diameter_bin + 
+#>     offset(log(total_adipocytes)), data = count_summary, link = "log", 
+#>     init.theta = 41.44465041)
+#> 
+#> Coefficients:
+#>                                            Estimate Std. Error z value Pr(>|z|)
+#> (Intercept)                                -1.68746    0.06869 -24.567  < 2e-16
+#> sexMale                                     0.06403    0.09774   0.655 0.512383
+#> timepoint4W                                 0.24576    0.09577   2.566 0.010281
+#> timepoint8W                                 0.08760    0.09698   0.903 0.366390
+#> diameter_bin[20,25)                        -0.33211    0.09852  -3.371 0.000749
+#> diameter_bin[25,30)                        -0.47826    0.09928  -4.817 1.45e-06
+#> diameter_bin[30,35)                        -0.54237    0.09964  -5.443 5.24e-08
+#> diameter_bin[35,40)                        -0.66390    0.10040  -6.613 3.77e-11
+#> diameter_bin[40,45)                        -0.62835    0.10017  -6.273 3.54e-10
+#> diameter_bin[45,50)                        -0.71719    0.10076  -7.118 1.09e-12
+#> diameter_bin[50,55)                        -0.78835    0.10126  -7.785 6.95e-15
+#> diameter_bin[55,60)                        -0.96252    0.10264  -9.377  < 2e-16
+#> diameter_bin[60,62.31]                     -2.19878    0.12145 -18.105  < 2e-16
+#> sexMale:timepoint4W                        -0.27854    0.13644  -2.042 0.041198
+#> sexMale:timepoint8W                         0.23634    0.13616   1.736 0.082601
+#> sexMale:diameter_bin[20,25)                -0.11671    0.14083  -0.829 0.407256
+#> sexMale:diameter_bin[25,30)                -0.13041    0.14213  -0.918 0.358837
+#> sexMale:diameter_bin[30,35)                -0.12307    0.14269  -0.863 0.388397
+#> sexMale:diameter_bin[35,40)                 0.01183    0.14314   0.083 0.934139
+#> sexMale:diameter_bin[40,45)                -0.03904    0.14306  -0.273 0.784960
+#> sexMale:diameter_bin[45,50)                -0.04028    0.14399  -0.280 0.779649
+#> sexMale:diameter_bin[50,55)                -0.13697    0.14542  -0.942 0.346230
+#> sexMale:diameter_bin[55,60)                -0.13159    0.14765  -0.891 0.372801
+#> sexMale:diameter_bin[60,62.31]              0.23208    0.17122   1.355 0.175264
+#> timepoint4W:diameter_bin[20,25)            -0.11873    0.13732  -0.865 0.387263
+#> timepoint8W:diameter_bin[20,25)            -0.06373    0.13929  -0.458 0.647269
+#> timepoint4W:diameter_bin[25,30)            -0.13927    0.13831  -1.007 0.313959
+#> timepoint8W:diameter_bin[25,30)            -0.10089    0.14053  -0.718 0.472781
+#> timepoint4W:diameter_bin[30,35)            -0.23422    0.13907  -1.684 0.092140
+#> timepoint8W:diameter_bin[30,35)            -0.16149    0.14133  -1.143 0.253181
+#> timepoint4W:diameter_bin[35,40)            -0.28660    0.14024  -2.044 0.040991
+#> timepoint8W:diameter_bin[35,40)            -0.02496    0.14180  -0.176 0.860249
+#> timepoint4W:diameter_bin[40,45)            -0.42269    0.14050  -3.009 0.002625
+#> timepoint8W:diameter_bin[40,45)            -0.04929    0.14158  -0.348 0.727764
+#> timepoint4W:diameter_bin[45,50)            -0.48411    0.14162  -3.418 0.000630
+#> timepoint8W:diameter_bin[45,50)            -0.09792    0.14266  -0.686 0.492491
+#> timepoint4W:diameter_bin[50,55)            -0.54868    0.14271  -3.845 0.000121
+#> timepoint8W:diameter_bin[50,55)            -0.14908    0.14369  -1.038 0.299472
+#> timepoint4W:diameter_bin[55,60)            -0.51522    0.14454  -3.564 0.000365
+#> timepoint8W:diameter_bin[55,60)            -0.22583    0.14628  -1.544 0.122645
+#> timepoint4W:diameter_bin[60,62.31]         -0.54701    0.17282  -3.165 0.001549
+#> timepoint8W:diameter_bin[60,62.31]         -0.30675    0.17695  -1.734 0.082996
+#> sexMale:timepoint4W:diameter_bin[20,25)     0.09216    0.19636   0.469 0.638823
+#> sexMale:timepoint8W:diameter_bin[20,25)    -0.08310    0.19583  -0.424 0.671297
+#> sexMale:timepoint4W:diameter_bin[25,30)     0.19496    0.19780   0.986 0.324304
+#> sexMale:timepoint8W:diameter_bin[25,30)    -0.11313    0.19759  -0.573 0.566954
+#> sexMale:timepoint4W:diameter_bin[30,35)     0.33871    0.19857   1.706 0.088050
+#> sexMale:timepoint8W:diameter_bin[30,35)    -0.19437    0.19872  -0.978 0.328032
+#> sexMale:timepoint4W:diameter_bin[35,40)     0.29968    0.19955   1.502 0.133148
+#> sexMale:timepoint8W:diameter_bin[35,40)    -0.42153    0.19916  -2.117 0.034296
+#> sexMale:timepoint4W:diameter_bin[40,45)     0.43266    0.19983   2.165 0.030381
+#> sexMale:timepoint8W:diameter_bin[40,45)    -0.50557    0.19933  -2.536 0.011203
+#> sexMale:timepoint4W:diameter_bin[45,50)     0.46159    0.20136   2.292 0.021883
+#> sexMale:timepoint8W:diameter_bin[45,50)    -0.57859    0.20102  -2.878 0.003997
+#> sexMale:timepoint4W:diameter_bin[50,55)     0.62660    0.20311   3.085 0.002035
+#> sexMale:timepoint8W:diameter_bin[50,55)    -0.46992    0.20284  -2.317 0.020523
+#> sexMale:timepoint4W:diameter_bin[55,60)     0.65767    0.20568   3.198 0.001386
+#> sexMale:timepoint8W:diameter_bin[55,60)    -0.48771    0.20652  -2.362 0.018200
+#> sexMale:timepoint4W:diameter_bin[60,62.31]  0.63699    0.23846   2.671 0.007557
+#> sexMale:timepoint8W:diameter_bin[60,62.31] -0.46675    0.24164  -1.932 0.053412
+#>                                               
+#> (Intercept)                                ***
+#> sexMale                                       
+#> timepoint4W                                *  
+#> timepoint8W                                   
+#> diameter_bin[20,25)                        ***
+#> diameter_bin[25,30)                        ***
+#> diameter_bin[30,35)                        ***
+#> diameter_bin[35,40)                        ***
+#> diameter_bin[40,45)                        ***
+#> diameter_bin[45,50)                        ***
+#> diameter_bin[50,55)                        ***
+#> diameter_bin[55,60)                        ***
+#> diameter_bin[60,62.31]                     ***
+#> sexMale:timepoint4W                        *  
+#> sexMale:timepoint8W                        .  
+#> sexMale:diameter_bin[20,25)                   
+#> sexMale:diameter_bin[25,30)                   
+#> sexMale:diameter_bin[30,35)                   
+#> sexMale:diameter_bin[35,40)                   
+#> sexMale:diameter_bin[40,45)                   
+#> sexMale:diameter_bin[45,50)                   
+#> sexMale:diameter_bin[50,55)                   
+#> sexMale:diameter_bin[55,60)                   
+#> sexMale:diameter_bin[60,62.31]                
+#> timepoint4W:diameter_bin[20,25)               
+#> timepoint8W:diameter_bin[20,25)               
+#> timepoint4W:diameter_bin[25,30)               
+#> timepoint8W:diameter_bin[25,30)               
+#> timepoint4W:diameter_bin[30,35)            .  
+#> timepoint8W:diameter_bin[30,35)               
+#> timepoint4W:diameter_bin[35,40)            *  
+#> timepoint8W:diameter_bin[35,40)               
+#> timepoint4W:diameter_bin[40,45)            ** 
+#> timepoint8W:diameter_bin[40,45)               
+#> timepoint4W:diameter_bin[45,50)            ***
+#> timepoint8W:diameter_bin[45,50)               
+#> timepoint4W:diameter_bin[50,55)            ***
+#> timepoint8W:diameter_bin[50,55)               
+#> timepoint4W:diameter_bin[55,60)            ***
+#> timepoint8W:diameter_bin[55,60)               
+#> timepoint4W:diameter_bin[60,62.31]         ** 
+#> timepoint8W:diameter_bin[60,62.31]         .  
+#> sexMale:timepoint4W:diameter_bin[20,25)       
+#> sexMale:timepoint8W:diameter_bin[20,25)       
+#> sexMale:timepoint4W:diameter_bin[25,30)       
+#> sexMale:timepoint8W:diameter_bin[25,30)       
+#> sexMale:timepoint4W:diameter_bin[30,35)    .  
+#> sexMale:timepoint8W:diameter_bin[30,35)       
+#> sexMale:timepoint4W:diameter_bin[35,40)       
+#> sexMale:timepoint8W:diameter_bin[35,40)    *  
+#> sexMale:timepoint4W:diameter_bin[40,45)    *  
+#> sexMale:timepoint8W:diameter_bin[40,45)    *  
+#> sexMale:timepoint4W:diameter_bin[45,50)    *  
+#> sexMale:timepoint8W:diameter_bin[45,50)    ** 
+#> sexMale:timepoint4W:diameter_bin[50,55)    ** 
+#> sexMale:timepoint8W:diameter_bin[50,55)    *  
+#> sexMale:timepoint4W:diameter_bin[55,60)    ** 
+#> sexMale:timepoint8W:diameter_bin[55,60)    *  
+#> sexMale:timepoint4W:diameter_bin[60,62.31] ** 
+#> sexMale:timepoint8W:diameter_bin[60,62.31] .  
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+#> 
+#> (Dispersion parameter for Negative Binomial(41.4447) family taken to be 1)
+#> 
+#>     Null deviance: 3503.96  on 359  degrees of freedom
+#> Residual deviance:  369.98  on 300  degrees of freedom
+#> AIC: 3409.6
+#> 
+#> Number of Fisher Scoring iterations: 1
+#> 
+#> 
+#>               Theta:  41.44 
+#>           Std. Err.:  4.19 
+#> 
+#>  2 x log-likelihood:  -3287.599
+
+
+

Comparisons +

+

We will compare each trained group to their sex-matched sedentary +controls by diameter bin using the Dunnett test for comparisons against +a reference.

+
+ADIPOCYTE_SIZE_STATS <- emmeans(fit, specs = "timepoint",
+                                by = c("diameter_bin", "sex")) %>%
+  contrast(method = "dunnett") %>%
+  summary(infer = TRUE, type = "response") %>%
+  as.data.frame() %>%
+  mutate(diameter_bin = factor(diameter_bin),
+         signif = cut(p.value,
+                      breaks = c(0, 0.001, 0.01, 0.05, 1),
+                      labels = c("***", "**", "*", ""),
+                      include.lowest = TRUE, right = FALSE,
+                      ordered_result = TRUE))
+
+# Save
+usethis::use_data(ADIPOCYTE_SIZE_STATS, internal = FALSE,
+                  overwrite = TRUE, version = 3, compress = "bzip2")
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/ADIPOCYTE_SIZE_STATS_files/figure-html/unnamed-chunk-3-1.png b/articles/ADIPOCYTE_SIZE_STATS_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..51a0155 Binary files /dev/null and b/articles/ADIPOCYTE_SIZE_STATS_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/articles/ANALYTES_STATS.html b/articles/ANALYTES_STATS.html new file mode 100644 index 0000000..6aa0789 --- /dev/null +++ b/articles/ANALYTES_STATS.html @@ -0,0 +1,1063 @@ + + + + + + + +Statistical analyses of plasma clinical analytes • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + + +
+# Generate all regression diagnostic plots
+plot_lm <- function(x) {
+  par(mfrow = c(2, 3))
+  for (i in 1:6)
+    plot(x, which = i)
+  par(mfrow = c(1, 1))
+}
+
+

Regression Models +

+

Since clinical analytes are strictly positive, we will check the +mean–variance relationship with code from Dunn and Smyth[1] (pg. 429–430) and +fit an appropriate log-link GLM. This allows us to back-transform the +means without introducing bias, unlike when the response is transformed. +Also, the log-link allows us to test ratios between means, rather than +their absolute differences.

+

If there are obvious problems with the model diagnostic plots, or the +mean–variance relationship does not correspond to an exponential family +distribution, we will include reciprocal group variances as weights in a +log-link Gaussian GLM. Finally, we will remove insignificant predictors +to achieve model parsimony based on ANOVA F-tests.

+
+

Glucagon +

+
+# Plot points
+ggplot(ANALYTES, aes(x = timepoint, y = glucagon, 
+                     color = omics_subset, group = omics_subset)) +
+  geom_point(position = position_jitterdodge(jitter.width = 0.1, 
+                                             dodge.width = 0.4, 
+                                             jitter.height = 0),
+             na.rm = TRUE, alpha = 0.5) +
+  facet_grid(~ sex) +
+  scale_color_manual(values = c("red", "black"),
+                     breaks = c(TRUE, FALSE)) +
+  theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
+        legend.position = "bottom", 
+        legend.direction = "horizontal")
+

+

We will check the mean-variance relationship.

+
+mv <- filter(ANALYTES, omics_subset) %>% 
+  group_by(sex, timepoint) %>% 
+  summarise(mn = mean(glucagon, na.rm = TRUE),
+            vr = var(glucagon, na.rm = TRUE))
+
+fit.mv <- lm(log(vr) ~ log(mn), data = mv)
+coef(fit.mv)
+#> (Intercept)     log(mn) 
+#>    -2.18263     2.05315
+
+plot(log(vr) ~ log(mn), data = mv, las = 1, pch = 19, 
+     xlab = "log(group means)", ylab = "log(group variances)")
+abline(coef(fit.mv), lwd = 2)
+

+

The slope suggests a variance function approximately of the form +\(V(\mu) = \mu^{2}\), so a gamma +distribution seems appropriate.

+
+fit.glucagon <- glm(glucagon ~ sex * timepoint,
+                    family = Gamma("log"),
+                    data = filter(ANALYTES, omics_subset))
+plot_lm(fit.glucagon)
+

+

Observation 6 is outlying in the QQ-plot, and it has the largest +Cook’s distance. While there is no biological justification for removal, +doing so will bring the mean of the female 2W group closer to the mean +of the female SED group, so the results will be more conservative. +Therefore, we will remove this observation and report it in the final +results table.

+
+fit.glucagon.1 <- update(fit.glucagon, subset = -6)
+plot_lm(fit.glucagon.1)
+

+

The diagnostic plots look fine. We will try to simplify the +model.

+
+fit.glucagon <- fit.glucagon.1
+anova(fit.glucagon, test = "F")
+#> Analysis of Deviance Table
+#> 
+#> Model: Gamma, link: log
+#> 
+#> Response: glucagon
+#> 
+#> Terms added sequentially (first to last)
+#> 
+#> 
+#>               Df Deviance Resid. Df Resid. Dev       F    Pr(>F)    
+#> NULL                             58    21.1496                      
+#> sex            1  11.2187        57     9.9309 80.2205 6.843e-12 ***
+#> timepoint      4   0.9099        53     9.0210  1.6266   0.18251    
+#> sex:timepoint  4   1.6847        49     7.3363  3.0117   0.02673 *  
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+

The interaction is significant, so we will not drop any terms.

+
+summary(fit.glucagon)
+#> 
+#> Call:
+#> glm(formula = glucagon ~ sex * timepoint, family = Gamma("log"), 
+#>     data = filter(ANALYTES, omics_subset), subset = -6)
+#> 
+#> Coefficients:
+#>                     Estimate Std. Error t value Pr(>|t|)    
+#> (Intercept)          4.71238    0.15267  30.867  < 2e-16 ***
+#> sexMale             -1.09071    0.21591  -5.052 6.48e-06 ***
+#> timepoint1W         -0.08349    0.21591  -0.387  0.70065    
+#> timepoint2W         -0.11544    0.22645  -0.510  0.61248    
+#> timepoint4W         -0.71908    0.21591  -3.331  0.00165 ** 
+#> timepoint8W         -0.44665    0.21591  -2.069  0.04387 *  
+#> sexMale:timepoint1W -0.03613    0.30534  -0.118  0.90629    
+#> sexMale:timepoint2W -0.10837    0.31288  -0.346  0.73055    
+#> sexMale:timepoint4W  0.64990    0.30534   2.128  0.03835 *  
+#> sexMale:timepoint8W  0.62942    0.30534   2.061  0.04459 *  
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+#> 
+#> (Dispersion parameter for Gamma family taken to be 0.139848)
+#> 
+#>     Null deviance: 21.1496  on 58  degrees of freedom
+#> Residual deviance:  7.3363  on 49  degrees of freedom
+#> AIC: 532.04
+#> 
+#> Number of Fisher Scoring iterations: 4
+
+
+

Glucose +

+
+# Plot points
+ggplot(ANALYTES, aes(x = timepoint, y = glucose, 
+                     color = omics_subset, group = omics_subset)) +
+  geom_point(position = position_jitterdodge(jitter.width = 0.1, 
+                                             dodge.width = 0.4, 
+                                             jitter.height = 0),
+             na.rm = TRUE, alpha = 0.5) +
+  facet_grid(~ sex) +
+  scale_color_manual(values = c("red", "black"),
+                     breaks = c(TRUE, FALSE)) +
+  theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
+        legend.position = "bottom", 
+        legend.direction = "horizontal")
+

+

We will check the mean-variance relationship.

+
+mv <- filter(ANALYTES, omics_subset) %>% 
+  group_by(sex, timepoint) %>% 
+  summarise(mn = mean(glucose, na.rm = TRUE),
+            vr = var(glucose, na.rm = TRUE))
+
+fit.mv <- lm(log(vr) ~ log(mn), data = mv)
+coef(fit.mv)
+#> (Intercept)     log(mn) 
+#>    21.74539    -3.37406
+
+plot(log(vr) ~ log(mn), data = mv, las = 1, pch = 19, 
+     xlab = "log(group means)", ylab = "log(group variances)")
+abline(coef(fit.mv), lwd = 2)
+

+

The slope suggests a variance function approximately of the form +\(V(\mu) = \mu^{-3}\), which does not +correspond to any of the named distributions. We will instead +incorporate reciprocal group variances as weights in a log-link Gaussian +GLM.

+
+wt.glucose <- filter(ANALYTES, omics_subset) %>% 
+  group_by(sex, timepoint) %>% 
+  mutate(1 / var(glucose, na.rm = TRUE)) %>% 
+  pull(-1)
+
+fit.glucose <- glm(glucose ~ sex * timepoint,
+                   family = gaussian("log"),
+                   weights = wt.glucose,
+                   data = filter(ANALYTES, omics_subset))
+plot_lm(fit.glucose)
+

+

The right tail of the QQ-plot is lighter than expected, which means +that p-values will be more conservative when we perform comparisons. We +will try to simplify the model to see if that fixes things.

+
+anova(fit.glucose, test = "F")
+#> Analysis of Deviance Table
+#> 
+#> Model: gaussian, link: log
+#> 
+#> Response: glucose
+#> 
+#> Terms added sequentially (first to last)
+#> 
+#> 
+#>               Df Deviance Resid. Df Resid. Dev       F    Pr(>F)    
+#> NULL                             59    148.771                      
+#> sex            1   57.449        58     91.322 57.4488 7.472e-10 ***
+#> timepoint      4   18.338        54     72.984  4.5845 0.0031235 ** 
+#> sex:timepoint  4   22.984        50     50.000  5.7459 0.0006945 ***
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+

All terms are significant, so we will not modify the model.

+
+summary(fit.glucose)
+#> 
+#> Call:
+#> glm(formula = glucose ~ sex * timepoint, family = gaussian("log"), 
+#>     data = filter(ANALYTES, omics_subset), weights = wt.glucose)
+#> 
+#> Coefficients:
+#>                     Estimate Std. Error t value Pr(>|t|)    
+#> (Intercept)          4.93567    0.05213  94.683  < 2e-16 ***
+#> sexMale              0.24705    0.05676   4.352 6.66e-05 ***
+#> timepoint1W          0.08711    0.06379   1.366  0.17817    
+#> timepoint2W          0.01545    0.05828   0.265  0.79205    
+#> timepoint4W          0.17431    0.05431   3.209  0.00232 ** 
+#> timepoint8W          0.16318    0.05597   2.915  0.00531 ** 
+#> sexMale:timepoint1W -0.10600    0.07065  -1.500  0.13982    
+#> sexMale:timepoint2W -0.03053    0.06570  -0.465  0.64420    
+#> sexMale:timepoint4W -0.19224    0.06625  -2.902  0.00550 ** 
+#> sexMale:timepoint8W -0.18493    0.06251  -2.959  0.00471 ** 
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+#> 
+#> (Dispersion parameter for gaussian family taken to be 1)
+#> 
+#>     Null deviance: 148.77  on 59  degrees of freedom
+#> Residual deviance:  50.00  on 50  degrees of freedom
+#> AIC: 454.44
+#> 
+#> Number of Fisher Scoring iterations: 4
+
+
+

Glycerol +

+
+# Plot points
+ggplot(ANALYTES, aes(x = timepoint, y = glycerol, 
+                     color = omics_subset, group = omics_subset)) +
+  geom_point(position = position_jitterdodge(jitter.width = 0.1, 
+                                             dodge.width = 0.4, 
+                                             jitter.height = 0),
+             na.rm = TRUE, alpha = 0.5) +
+  facet_grid(~ sex) +
+  scale_color_manual(values = c("red", "black"),
+                     breaks = c(TRUE, FALSE)) +
+  theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
+        legend.position = "bottom", 
+        legend.direction = "horizontal")
+

+

There are outlying observations in the SED, 4W, and 8W female groups. +We will check the mean-variance relationship.

+
+mv <- filter(ANALYTES, omics_subset) %>% 
+  group_by(sex, timepoint) %>% 
+  summarise(mn = mean(glycerol, na.rm = TRUE),
+            vr = var(glycerol, na.rm = TRUE))
+
+fit.mv <- lm(log(vr) ~ log(mn), data = mv)
+coef(fit.mv)
+#> (Intercept)     log(mn) 
+#>   -3.473325    3.847040
+
+plot(log(vr) ~ log(mn), data = mv, las = 1, pch = 19, 
+     xlab = "log(group means)", ylab = "log(group variances)")
+abline(coef(fit.mv), lwd = 2)
+

+

The slope suggests a variance function approximately of the form +\(V(\mu) = \mu^{3.85}\), which does not +correspond to any of the named distributions. We will instead +incorporate reciprocal group variances as weights in a log-link Gaussian +GLM.

+
+wt.glycerol <- filter(ANALYTES, omics_subset) %>% 
+  group_by(sex, timepoint) %>% 
+  mutate(1 / var(glycerol, na.rm = TRUE)) %>% 
+  pull(-1)
+
+fit.glycerol <- glm(glycerol ~ sex * timepoint,
+                    family = gaussian("log"),
+                    weights = wt.glycerol,
+                    data = filter(ANALYTES, omics_subset))
+plot_lm(fit.glycerol)
+

+

The diagnostic plots look mostly fine. We will try to simplify the +model.

+
+anova(fit.glycerol, test = "F")
+#> Analysis of Deviance Table
+#> 
+#> Model: gaussian, link: log
+#> 
+#> Response: glycerol
+#> 
+#> Terms added sequentially (first to last)
+#> 
+#> 
+#>               Df Deviance Resid. Df Resid. Dev      F    Pr(>F)    
+#> NULL                             59     89.199                     
+#> sex            1   8.6943        58     80.505 8.6943 0.0048426 ** 
+#> timepoint      4   7.6795        54     72.826 1.9199 0.1216351    
+#> sex:timepoint  4  22.8255        50     50.000 5.7064 0.0007301 ***
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+

The interaction is significant, so we will not remove any terms.

+
+summary(fit.glycerol)
+#> 
+#> Call:
+#> glm(formula = glycerol ~ sex * timepoint, family = gaussian("log"), 
+#>     data = filter(ANALYTES, omics_subset), weights = wt.glycerol)
+#> 
+#> Coefficients:
+#>                     Estimate Std. Error t value Pr(>|t|)    
+#> (Intercept)          0.61158    0.10586   5.777 4.85e-07 ***
+#> sexMale             -0.52082    0.11166  -4.665 2.34e-05 ***
+#> timepoint1W         -0.41272    0.14360  -2.874 0.005935 ** 
+#> timepoint2W         -0.38179    0.12621  -3.025 0.003918 ** 
+#> timepoint4W         -0.27510    0.18268  -1.506 0.138383    
+#> timepoint8W         -0.20057    0.19138  -1.048 0.299661    
+#> sexMale:timepoint1W  0.65486    0.17215   3.804 0.000389 ***
+#> sexMale:timepoint2W  0.69427    0.15187   4.571 3.21e-05 ***
+#> sexMale:timepoint4W  0.40749    0.22648   1.799 0.078022 .  
+#> sexMale:timepoint8W  0.04261    0.21527   0.198 0.843907    
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+#> 
+#> (Dispersion parameter for gaussian family taken to be 1)
+#> 
+#>     Null deviance: 89.199  on 59  degrees of freedom
+#> Residual deviance: 50.000  on 50  degrees of freedom
+#> AIC: 36.884
+#> 
+#> Number of Fisher Scoring iterations: 5
+
+
+

Insulin +

+

It does not matter which units we use for insulin. It does not affect +the model fit or the ratios when we set up the comparisons later.

+
+# Plot points
+ggplot(ANALYTES, aes(x = timepoint, y = insulin_pm, 
+                     color = omics_subset, group = omics_subset)) +
+  geom_point(position = position_jitterdodge(jitter.width = 0.1, 
+                                             dodge.width = 0.4, 
+                                             jitter.height = 0),
+             na.rm = TRUE, alpha = 0.5) +
+  facet_grid(~ sex) +
+  scale_color_manual(values = c("red", "black"),
+                     breaks = c(TRUE, FALSE)) +
+  theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
+        legend.position = "bottom", 
+        legend.direction = "horizontal")
+

+

There are outlying values in the 2W female and 1W, 2W, and 4W male +groups. We will check the mean-variance relationship, though the male +observations are not outlying when compared to the full cohort. +Additionally, we do not observe differences between the timepoints, +though there may be sex differences.

+
+mv <- filter(ANALYTES, omics_subset) %>% 
+  group_by(sex, timepoint) %>% 
+  summarise(mn = mean(insulin_pm, na.rm = TRUE),
+            vr = var(insulin_pm, na.rm = TRUE))
+
+fit.mv <- lm(log(vr) ~ log(mn), data = mv)
+coef(fit.mv)
+#> (Intercept)     log(mn) 
+#>  -22.630533    5.147836
+
+plot(log(vr) ~ log(mn), data = mv, las = 1, pch = 19, 
+     xlab = "log(group means)", ylab = "log(group variances)")
+abline(coef(fit.mv), lwd = 2)
+

+

The slope is close to 5, which doesn’t correspond to any of the named +distributions. We will try reciprocal group variance weights with a +log-link Gaussian GLM that has only sex as a predictor.

+
+wt.ins <- filter(ANALYTES, omics_subset) %>% 
+  group_by(sex, timepoint) %>% 
+  mutate(1 / var(insulin_pm, na.rm = TRUE)) %>% 
+  pull(-1)
+
+fit.ins <- glm(insulin_pm ~ sex,
+               family = gaussian("log"),
+               weights = wt.ins,
+               data = filter(ANALYTES, omics_subset))
+plot_lm(fit.ins)
+

+

The diagnostic plots look fine.

+
+summary(fit.ins)
+#> 
+#> Call:
+#> glm(formula = insulin_pm ~ sex, family = gaussian("log"), data = filter(ANALYTES, 
+#>     omics_subset), weights = wt.ins)
+#> 
+#> Coefficients:
+#>             Estimate Std. Error t value Pr(>|t|)    
+#> (Intercept)  5.92661    0.01722 344.164  < 2e-16 ***
+#> sexMale      0.29555    0.03706   7.974 6.77e-11 ***
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+#> 
+#> (Dispersion parameter for gaussian family taken to be 1.017982)
+#> 
+#>     Null deviance: 112.733  on 59  degrees of freedom
+#> Residual deviance:  59.043  on 58  degrees of freedom
+#> AIC: 715.29
+#> 
+#> Number of Fisher Scoring iterations: 4
+
+
+

Leptin +

+
+# Plot points
+ggplot(ANALYTES, aes(x = timepoint, y = leptin, 
+                     color = omics_subset, group = omics_subset)) +
+  geom_point(position = position_jitterdodge(jitter.width = 0.1, 
+                                             dodge.width = 0.4, 
+                                             jitter.height = 0),
+             na.rm = TRUE, alpha = 0.5) +
+  facet_grid(~ sex) +
+  scale_color_manual(values = c("red", "black"),
+                     breaks = c(TRUE, FALSE)) +
+  theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
+        legend.position = "bottom", 
+        legend.direction = "horizontal")
+

+

We will check the mean-variance relationship.

+
+mv <- filter(ANALYTES, omics_subset) %>%
+  group_by(sex, timepoint) %>% 
+  summarise(mn = mean(leptin, na.rm = TRUE),
+            vr = var(leptin, na.rm = TRUE))
+
+fit.mv <- lm(log(vr) ~ log(mn), data = mv)
+coef(fit.mv)
+#> (Intercept)     log(mn) 
+#>   -5.289574    2.235023
+
+plot(log(vr) ~ log(mn), data = mv, las = 1, pch = 19, 
+     xlab = "log(group means)", ylab = "log(group variances)")
+abline(coef(fit.mv), lwd = 2)
+

+

The slope is just above 2, so a gamma GLM may be appropriate.

+
+fit.lep <- glm(leptin ~ sex * timepoint,
+               family = Gamma("log"),
+               data = filter(ANALYTES, omics_subset))
+plot_lm(fit.lep)
+

+

Observations are deviating from the right tail of the QQ-plot. We +will fit a log-link Gaussian GLM with reciprocal group variances as +weights.

+
+wt.lep <- filter(ANALYTES, omics_subset) %>% 
+  group_by(sex, timepoint) %>% 
+  mutate(1 / var(leptin, na.rm = TRUE)) %>% 
+  pull(-1)
+
+fit.lep <- glm(leptin ~ sex * timepoint,
+               family = gaussian("log"),
+               weights = wt.lep,
+               data = filter(ANALYTES, omics_subset))
+plot_lm(fit.lep)
+

+

The diagnostic plots appear mostly fine, so we will try to simplify +the model.

+
+anova(fit.lep, test = "F")
+#> Analysis of Deviance Table
+#> 
+#> Model: gaussian, link: log
+#> 
+#> Response: leptin
+#> 
+#> Terms added sequentially (first to last)
+#> 
+#> 
+#>               Df Deviance Resid. Df Resid. Dev        F    Pr(>F)    
+#> NULL                             59    242.039                       
+#> sex            1  103.955        58    138.084 103.9548 8.338e-14 ***
+#> timepoint      4   61.061        54     77.023  15.2651 3.191e-08 ***
+#> sex:timepoint  4   27.023        50     50.000   6.7558 0.0001989 ***
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+

All terms are significant at the 0.001 level.

+
+summary(fit.lep)
+#> 
+#> Call:
+#> glm(formula = leptin ~ sex * timepoint, family = gaussian("log"), 
+#>     data = filter(ANALYTES, omics_subset), weights = wt.lep)
+#> 
+#> Coefficients:
+#>                     Estimate Std. Error t value Pr(>|t|)    
+#> (Intercept)           9.8131     0.1421  69.060  < 2e-16 ***
+#> sexMale               0.8586     0.1616   5.313  2.5e-06 ***
+#> timepoint1W          -0.4927     0.1618  -3.046  0.00369 ** 
+#> timepoint2W          -0.4474     0.1565  -2.859  0.00618 ** 
+#> timepoint4W          -0.1591     0.1464  -1.087  0.28246    
+#> timepoint8W          -0.3236     0.1697  -1.907  0.06226 .  
+#> sexMale:timepoint1W   0.3547     0.1975   1.796  0.07852 .  
+#> sexMale:timepoint2W  -0.2167     0.1930  -1.123  0.26680    
+#> sexMale:timepoint4W  -0.1606     0.2349  -0.684  0.49742    
+#> sexMale:timepoint8W  -0.7648     0.2897  -2.640  0.01102 *  
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+#> 
+#> (Dispersion parameter for gaussian family taken to be 1)
+#> 
+#>     Null deviance: 242.04  on 59  degrees of freedom
+#> Residual deviance:  50.00  on 50  degrees of freedom
+#> AIC: 1188.8
+#> 
+#> Number of Fisher Scoring iterations: 5
+
+
+

NEFA +

+
+# Plot points
+ggplot(ANALYTES, aes(x = timepoint, y = nefa, 
+                     color = omics_subset, group = omics_subset)) +
+  geom_point(position = position_jitterdodge(jitter.width = 0.1, 
+                                             dodge.width = 0.4, 
+                                             jitter.height = 0),
+             na.rm = TRUE, alpha = 0.5) +
+  facet_grid(~ sex) +
+  scale_color_manual(values = c("red", "black"),
+                     breaks = c(TRUE, FALSE)) +
+  theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
+        legend.position = "bottom", 
+        legend.direction = "horizontal")
+

+

We will check the mean-variance relationship.

+
+mv <- filter(ANALYTES, omics_subset) %>% 
+  group_by(sex, timepoint) %>% 
+  summarise(mn = mean(nefa, na.rm = TRUE),
+            vr = var(nefa, na.rm = TRUE))
+
+fit.mv <- lm(log(vr) ~ log(mn), data = mv)
+coef(fit.mv)
+#> (Intercept)     log(mn) 
+#>   -2.825545    3.669896
+
+plot(log(vr) ~ log(mn), data = mv, las = 1, pch = 19, 
+     xlab = "log(group means)", ylab = "log(group variances)")
+abline(coef(fit.mv), lwd = 2)
+

+

The slope of the line is close to 3.7, which is more extreme than an +inverse Gaussian distribution. We will try a log-link Gaussian with +reciprocal group variance weights.

+
+wt.nefa <- filter(ANALYTES, omics_subset) %>% 
+  group_by(sex, timepoint) %>% 
+  mutate(1 / var(nefa, na.rm = TRUE)) %>% 
+  pull(-1)
+
+fit.nefa <- glm(nefa ~ sex * timepoint,
+                family = gaussian("log"),
+                weights = wt.nefa,
+                data = filter(ANALYTES, omics_subset))
+plot_lm(fit.nefa)
+

+

The diagnostic plots look mostly fine. We will try to simplify the +model.

+
+anova(fit.nefa, test = "F")
+#> Analysis of Deviance Table
+#> 
+#> Model: gaussian, link: log
+#> 
+#> Response: nefa
+#> 
+#> Terms added sequentially (first to last)
+#> 
+#> 
+#>               Df Deviance Resid. Df Resid. Dev      F  Pr(>F)  
+#> NULL                             59     77.011                 
+#> sex            1   0.7145        58     76.297 0.7145 0.40198  
+#> timepoint      4  11.5830        54     64.714 2.8957 0.03117 *
+#> sex:timepoint  4  14.7136        50     50.000 3.6784 0.01058 *
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+

The interaction is significant, so we will not modify the model.

+
+summary(fit.nefa)
+#> 
+#> Call:
+#> glm(formula = nefa ~ sex * timepoint, family = gaussian("log"), 
+#>     data = filter(ANALYTES, omics_subset), weights = wt.nefa)
+#> 
+#> Coefficients:
+#>                     Estimate Std. Error t value Pr(>|t|)  
+#> (Intercept)         -0.10721    0.10836  -0.989   0.3272  
+#> sexMale             -0.16285    0.11644  -1.399   0.1681  
+#> timepoint1W         -0.37082    0.14836  -2.500   0.0158 *
+#> timepoint2W         -0.23998    0.11693  -2.052   0.0454 *
+#> timepoint4W         -0.17825    0.15615  -1.141   0.2591  
+#> timepoint8W         -0.03781    0.16567  -0.228   0.8204  
+#> sexMale:timepoint1W  0.42810    0.16618   2.576   0.0130 *
+#> sexMale:timepoint2W  0.32572    0.15122   2.154   0.0361 *
+#> sexMale:timepoint4W  0.35948    0.18946   1.897   0.0636 .
+#> sexMale:timepoint8W -0.19741    0.18474  -1.069   0.2904  
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+#> 
+#> (Dispersion parameter for gaussian family taken to be 1.000008)
+#> 
+#>     Null deviance: 77.011  on 59  degrees of freedom
+#> Residual deviance: 50.000  on 50  degrees of freedom
+#> AIC: -45.983
+#> 
+#> Number of Fisher Scoring iterations: 4
+
+
+

Insulin/Glucagon +

+

Rather than fitting a model with the insulin/glucagon molar ratio as +the response, we will use the approach described by Kronmal[2] in section 3: +“ONLY DEPENDENT VARIABLE A RATIO”. First, we will look at a plot of +insulin vs. glucagon to determine their relationship. We will include a +loess curve to visualize any trends.

+
+ggplot(ANALYTES, aes(x = glucagon, y = insulin_pm)) +
+  geom_point(na.rm = TRUE, alpha = 0.5) +
+  stat_smooth(method = "loess", formula = y ~ x, na.rm = TRUE)
+

+

It does not seem like there is a relationship between insulin and +glucagon, so we will not proceed with modeling.

+
+
+
+

Comparisons +

+

We will compare the means of each trained timepoint to those of their +sex-matched sedentary controls within each age group using the Dunnett +test. Additionally, we will compare males to females by timepoint and +adjust p-values across all timepoints for a particular analyte using the +Holm method.

+
+# Create emm_list objects
+model_list <- list("Glucagon" = fit.glucagon,
+                   "Glucose" = fit.glucose,
+                   "Glycerol" = fit.glycerol,
+                   "Insulin" = fit.ins,
+                   "Leptin" = fit.lep,
+                   "NEFA" = fit.nefa)
+
+ANALYTES_EMM <- map(model_list, function(mod_i) {
+  terms_i <- attr(terms(mod_i), which = "term.labels")
+  specs <- intersect(c("timepoint", "sex"), terms_i)
+  
+  out <- map(specs, function(specs_i) {
+    by_i <- setdiff(specs, specs_i)
+    
+    if (length(by_i) == 0) {
+      by_i <- NULL
+    }
+    
+    emmeans(mod_i, specs = specs_i, by = by_i, 
+            type = "response", infer = TRUE)
+  }) %>% 
+    setNames(specs)
+  
+  return(out)
+}) %>% 
+  list_transpose() %>% 
+  map(~ .x[!map_lgl(.x, is.null)]) %>% 
+  setNames(c("timewise", "MvF"))
+
+# Extract model info
+model_df <- model_list %>% 
+  map_chr(.f = ~ paste(deparse(.x[["call"]]), collapse = "")) %>% 
+  enframe(name = "response", 
+          value = "model") %>% 
+  mutate(model = gsub("(?<=[\\s])\\s*|^\\s+|\\s+$", "", model, perl = TRUE),
+         model_type = sub("^([^\\(]+).*", "\\1", model),
+         obs_removed = ifelse(response == "Glucagon", 
+                              "10734945", NA_character_),
+         formula = sub(".*formula = ([^,]+),.*", "\\1", model),
+         family = sub(".*family = ([^\\)]+\\)),.*", "\\1", model),
+         family = ifelse(model_type == "lm", "gaussian", family),
+         # if weights were used, they were reciprocal group variances
+         weights = ifelse(grepl("weights = ", model), 
+                          "reciprocal group variances", NA)) %>% 
+  dplyr::select(-model)
+
+# Results
+ANALYTES_STATS <- ANALYTES_EMM %>% 
+  map2(.y = c("none", "holm"), function(comp_i, cross.adjust_i) {
+    map(comp_i, function(emm_i) {
+      contrast(emm_i, method = "dunnett") %>% 
+        summary(cross.adjust = cross.adjust_i) %>%
+        as.data.frame() %>%
+        rename(any_of(c(lower.CL = "asymp.LCL",
+                        upper.CL = "asymp.UCL")))
+    }) %>%
+      enframe(name = "response") %>%
+      unnest(value) %>%
+      arrange(response) %>%
+      mutate(signif = cut(p.value,
+                          breaks = c(0, 0.001, 0.01, 0.05, 1),
+                          labels = c("***", "**", "*", ""),
+                          include.lowest = TRUE, right = FALSE,
+                          ordered_result = TRUE)) %>%
+      relocate(p.value, .before = signif) %>%
+      relocate(ends_with("CL", ignore.case = FALSE), .before = null) %>%
+      left_join(model_df, by = "response") %>%
+      pivot_longer(cols = contains(".ratio"),
+                   names_to = "statistic_type",
+                   values_to = "statistic",
+                   values_drop_na = TRUE) %>%
+      relocate(starts_with("statistic"), .before = p.value)
+  })
+

See ?ANALYTES_STATS for details.

+
+print.data.frame(head(ANALYTES_STATS[["timewise"]]))
+#>   response contrast    sex     ratio        SE df null statistic_type
+#> 1 Glucagon 1W / SED Female 0.9198982 0.1986128 49    1        t.ratio
+#> 2 Glucagon 2W / SED Female 0.8909717 0.2017566 49    1        t.ratio
+#> 3 Glucagon 4W / SED Female 0.4871987 0.1051898 49    1        t.ratio
+#> 4 Glucagon 8W / SED Female 0.6397664 0.1381303 49    1        t.ratio
+#> 5 Glucagon 1W / SED   Male 0.8872549 0.1915649 49    1        t.ratio
+#> 6 Glucagon 2W / SED   Male 0.7994652 0.1726104 49    1        t.ratio
+#>    statistic     p.value signif model_type obs_removed
+#> 1 -0.3867042 0.962417071               glm    10734945
+#> 2 -0.5098029 0.928230928               glm    10734945
+#> 3 -3.3305175 0.006169046     **        glm    10734945
+#> 4 -2.0687211 0.140693984               glm    10734945
+#> 5 -0.5540476 0.913011486               glm    10734945
+#> 6 -1.0366123 0.664323646               glm    10734945
+#>                      formula       family weights
+#> 1 glucagon ~ sex * timepoint Gamma("log")    <NA>
+#> 2 glucagon ~ sex * timepoint Gamma("log")    <NA>
+#> 3 glucagon ~ sex * timepoint Gamma("log")    <NA>
+#> 4 glucagon ~ sex * timepoint Gamma("log")    <NA>
+#> 5 glucagon ~ sex * timepoint Gamma("log")    <NA>
+#> 6 glucagon ~ sex * timepoint Gamma("log")    <NA>
+print.data.frame(head(ANALYTES_STATS[["MvF"]]))
+#>   response      contrast timepoint     ratio         SE df null statistic_type
+#> 1 Glucagon Male / Female       SED 0.3359784 0.07254022 49    1        t.ratio
+#> 2 Glucagon Male / Female        1W 0.3240560 0.06996608 49    1        t.ratio
+#> 3 Glucagon Male / Female        2W 0.3014721 0.06826701 49    1        t.ratio
+#> 4 Glucagon Male / Female        4W 0.6435157 0.13893977 49    1        t.ratio
+#> 5 Glucagon Male / Female        8W 0.6304704 0.13612320 49    1        t.ratio
+#> 6  Glucose Male / Female       SED 1.2802395 0.07267275 50    1        t.ratio
+#>   statistic      p.value signif model_type obs_removed
+#> 1 -5.051742 1.942957e-05    ***        glm    10734945
+#> 2 -5.219085 1.453666e-05    ***        glm    10734945
+#> 3 -5.295215 1.395082e-05    ***        glm    10734945
+#> 4 -2.041658 7.531411e-02               glm    10734945
+#> 5 -2.136514 7.531411e-02               glm    10734945
+#> 6  4.352107 2.663012e-04    ***        glm        <NA>
+#>                      formula          family                    weights
+#> 1 glucagon ~ sex * timepoint    Gamma("log")                       <NA>
+#> 2 glucagon ~ sex * timepoint    Gamma("log")                       <NA>
+#> 3 glucagon ~ sex * timepoint    Gamma("log")                       <NA>
+#> 4 glucagon ~ sex * timepoint    Gamma("log")                       <NA>
+#> 5 glucagon ~ sex * timepoint    Gamma("log")                       <NA>
+#> 6  glucose ~ sex * timepoint gaussian("log") reciprocal group variances
+
+# Save data
+usethis::use_data(ANALYTES_STATS, internal = FALSE, overwrite = TRUE,
+                  compress = "bzip2", version = 3)
+
+usethis::use_data(ANALYTES_EMM, internal = FALSE, overwrite = TRUE,
+                  compress = "bzip2", version = 3)
+
+
+

Session Info +

+
+sessionInfo()
+#> R version 4.3.3 (2024-02-29)
+#> Platform: x86_64-pc-linux-gnu (64-bit)
+#> Running under: Ubuntu 22.04.4 LTS
+#> 
+#> Matrix products: default
+#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
+#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
+#> 
+#> locale:
+#>  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
+#>  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
+#>  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
+#> [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
+#> 
+#> time zone: UTC
+#> tzcode source: system (glibc)
+#> 
+#> attached base packages:
+#> [1] stats     graphics  grDevices utils     datasets  methods   base     
+#> 
+#> other attached packages:
+#> [1] latex2exp_0.9.6                    purrr_1.0.2                       
+#> [3] tidyr_1.3.1                        tibble_3.2.1                      
+#> [5] emmeans_1.10.0                     dplyr_1.1.4                       
+#> [7] ggplot2_3.5.0                      MotrpacRatTraining6moWATData_2.0.0
+#> 
+#> loaded via a namespace (and not attached):
+#>  [1] sass_0.4.8        utf8_1.2.4        generics_0.1.3    lattice_0.22-5   
+#>  [5] stringi_1.8.3     digest_0.6.34     magrittr_2.0.3    evaluate_0.23    
+#>  [9] grid_4.3.3        estimability_1.5  mvtnorm_1.2-4     fastmap_1.1.1    
+#> [13] Matrix_1.6-5      jsonlite_1.8.8    mgcv_1.9-1        fansi_1.0.6      
+#> [17] scales_1.3.0      textshaping_0.3.7 jquerylib_0.1.4   cli_3.6.2        
+#> [21] rlang_1.1.3       splines_4.3.3     munsell_0.5.0     withr_3.0.0      
+#> [25] cachem_1.0.8      yaml_2.3.8        tools_4.3.3       memoise_2.0.1    
+#> [29] colorspace_2.1-0  vctrs_0.6.5       R6_2.5.1          lifecycle_1.0.4  
+#> [33] stringr_1.5.1     fs_1.6.3          ragg_1.2.7        pkgconfig_2.0.3  
+#> [37] desc_1.4.3        pkgdown_2.0.7     pillar_1.9.0      bslib_0.6.1      
+#> [41] gtable_0.3.4      glue_1.7.0        systemfonts_1.0.5 xfun_0.42        
+#> [45] tidyselect_1.2.0  highr_0.10        knitr_1.45        farver_2.1.1     
+#> [49] nlme_3.1-164      htmltools_0.5.7   rmarkdown_2.25    labeling_0.4.3   
+#> [53] compiler_4.3.3
+
+
+

References +

+
+
+1. Dunn, P. K., & Smyth, G. K. (2018). Generalized +Linear Models With +Examples in R. Springer New York. https://doi.org/10.1007/978-1-4419-0118-7 +
+
+2. Kronmal, R. A. (1993). Spurious Correlation and the +Fallacy of the Ratio Standard +Revisited. Journal of the Royal Statistical Society. +Series A (Statistics in Society), 156(3), 379. https://doi.org/10.2307/2983064 +
+
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-10-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-10-1.png new file mode 100644 index 0000000..033123a Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-10-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-12-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-12-1.png new file mode 100644 index 0000000..69d56a8 Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-12-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-13-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-13-1.png new file mode 100644 index 0000000..45cf3e6 Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-13-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-16-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-16-1.png new file mode 100644 index 0000000..7c0cff6 Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-16-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-18-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-18-1.png new file mode 100644 index 0000000..89bdfa5 Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-18-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-19-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-19-1.png new file mode 100644 index 0000000..d5a9833 Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-19-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-22-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-22-1.png new file mode 100644 index 0000000..6cddaab Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-22-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-24-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-24-1.png new file mode 100644 index 0000000..ecd34ac Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-24-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-25-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-25-1.png new file mode 100644 index 0000000..69d1f1a Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-25-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-27-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-27-1.png new file mode 100644 index 0000000..dd7902b Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-27-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-29-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-29-1.png new file mode 100644 index 0000000..8985110 Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-29-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-3-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..bdbae32 Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-30-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-30-1.png new file mode 100644 index 0000000..bae4bfb Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-30-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-31-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-31-1.png new file mode 100644 index 0000000..be74baa Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-31-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-34-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-34-1.png new file mode 100644 index 0000000..b5819d4 Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-34-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-36-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-36-1.png new file mode 100644 index 0000000..228bf7f Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-36-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-37-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-37-1.png new file mode 100644 index 0000000..47f1af0 Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-37-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-40-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-40-1.png new file mode 100644 index 0000000..05d72c8 Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-40-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-5-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-5-1.png new file mode 100644 index 0000000..01cd64c Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-6-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-6-1.png new file mode 100644 index 0000000..f41c688 Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-7-1.png b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-7-1.png new file mode 100644 index 0000000..062f2df Binary files /dev/null and b/articles/ANALYTES_STATS_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/articles/FGSEA_heatmaps.html b/articles/FGSEA_heatmaps.html new file mode 100644 index 0000000..6138846 --- /dev/null +++ b/articles/FGSEA_heatmaps.html @@ -0,0 +1,359 @@ + + + + + + + +Heatmaps of FGSEA Results • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates heatmaps of the FGSEA results (Fig. 3C, D, E, +G; Extended Data Figs. 3A-D, 5A-D, F).

+
+# Required packages
+library(MotrpacRatTraining6moWATData)
+library(MotrpacRatTraining6moWAT)
+library(ComplexHeatmap)
+library(grid)
+library(dplyr)
+library(purrr)
+
+save_plots <- dir.exists(paths = file.path("..", "..", "plots"))
+
+omes <- c("METAB", "PROT", "TRNSCRPT")
+
+for (ome in omes) {
+  file <- paste0(ome, "_FGSEA")
+  fgsea_res <- get(file)
+  
+  if (ome == "METAB") {
+    fgsea_res <- map(fgsea_res,
+                     ~ mutate(.x, gs_subcat = "refmet_sub_class",
+                              pathway = refmet_sub_class,
+                              gs_description = refmet_sub_class))
+  }
+  
+  
+  if (ome %in% c("PROT", "TRNSCRPT")) {
+    heatmap_legend_side <- annotation_legend_side <- "bottom"
+    align_heatmap_legend <- align_annotation_legend <- "global_center"
+    direction <- "horizontal"
+    legend_width <- unit(90, "points")
+    legend_height <- NULL
+  } else {
+    heatmap_legend_side <- annotation_legend_side <- "right"
+    align_heatmap_legend <- align_annotation_legend <- "heatmap_top"
+    direction <- "vertical"
+    legend_width <- NULL
+    legend_height <- unit(90, "points")
+  }
+  
+  # Enrichment heatmaps ------------------------------
+  scale <- 2
+  
+  # Trained vs. SED and sex by training interaction (MvF_exercise_response)
+  res_list <- fgsea_res[c(1, 3)]
+  subcats <- unique(fgsea_res$MvF_SED$gs_subcat)
+  
+  for (subcat_i in subcats) {
+    db_i <- sub(":", "-", subcat_i)
+    
+    for (name_i in names(res_list)) {
+      if (name_i == "trained_vs_SED") {
+        column_labels <- rep(paste0(2 ^ (0:3), "W - SED"), times = 2)
+        
+        anno_df <- data.frame(Sex = rep(c("Female", "Male"), each = 4))
+        anno_colors <- list(Sex = c("Female" = "#ff6eff", "Male" = "#5555ff"))
+        
+        top_annotation <- HeatmapAnnotation(
+          df = anno_df, col = anno_colors,
+          gap = unit(0, "points"),
+          gp = gpar(col = "black"),
+          annotation_name_gp = gpar(fontsize = 7 * scale),
+          annotation_legend_param = list(
+            nrow = 2, by_row = T,
+            grid_height = unit(14, "points"),
+            grid_width = unit(14, "points"),
+            border = "black",
+            title_gp = gpar(fontsize = 7 * scale),
+            labels_gp = gpar(fontsize = 6 * scale)
+          ))
+        
+        column_split <- anno_df$Sex
+        colors <- c("#3366ff", "darkred", "grey")
+        
+      } else {
+        column_labels <- latex2exp::TeX(
+          sprintf("(%dW - SED)$_{M - F}$", 2^(0:3))
+        )
+        top_annotation <- column_split <- NULL
+        colors <- c("#ff6eff", "#5555ff", "grey")
+      }
+      
+      x <- res_list[[name_i]]
+      
+      if ("gs_description" %in% colnames(x)) {
+        x <- x %>%
+          filter(gs_subcat == subcat_i) %>%
+          mutate(
+            row_labels = cutstr(gs_description, split = " ", n = 35),
+            row_labels = ifelse(nchar(gs_description) > 35 + nchar(pathway) + 5,
+                                sprintf("%s...(%s)", row_labels, pathway),
+                                gs_description),
+            keep_ids = NULL)
+      } else {
+        x <- mutate(x, row_labels = pathway)
+      }
+      
+      enrichmat(x,
+                n_top = 20,
+                colors = colors,
+                scale_by = "row",
+                cell_size = unit(6 * scale, "points"),
+                padj_legend_title = "BH-adjusted\np-value",
+                padj_args = list(
+                  title_gp = gpar(fontsize = 7 * scale),
+                  labels_gp = gpar(fontsize = 6 * scale),
+                  grid_height = unit(6 * scale, "pt"),
+                  grid_width = unit(6 * scale, "pt")
+                ),
+                rownames_column = "row_labels",
+                heatmap_args = list(
+                  column_labels = column_labels,
+                  column_title_side = "bottom",
+                  column_split = column_split,
+                  column_title = NULL,
+                  column_names_gp = gpar(fontsize = 5.5 * scale),
+                  row_names_gp = gpar(fontsize = 5.5 * scale),
+                  top_annotation = top_annotation,
+                  heatmap_legend_param = list(
+                    title_gp = gpar(fontsize = scale * 6.5),
+                    labels_gp = gpar(fontsize = scale * 6),
+                    direction = direction,
+                    legend_width = legend_width,
+                    legend_height = legend_height
+                  )
+                ),
+                filename = sprintf(file.path("..", "..", "plots", "FGSEA_%s_%s_%s.pdf"),
+                                   ome, name_i, db_i),
+                height = scale * unit(3, "in"),
+                width = scale * unit(3, "in"),
+                units = "in",
+                draw_args = list(
+                  legend_gap = unit(0.4, "in"),
+                  gap = unit(0.5, "in"),
+                  adjust_annotation_extension = TRUE,
+                  heatmap_legend_side = heatmap_legend_side,
+                  annotation_legend_side = annotation_legend_side,
+                  align_annotation_legend = align_annotation_legend,
+                  align_heatmap_legend = align_heatmap_legend
+                ),
+                save_args = list(dpi = 400, res = 400, family = "ArialMT")
+      )
+    }
+  }
+}
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/KSEA_heatmaps.html b/articles/KSEA_heatmaps.html new file mode 100644 index 0000000..7bd2c17 --- /dev/null +++ b/articles/KSEA_heatmaps.html @@ -0,0 +1,316 @@ + + + + + + + +Heatmaps of Kinase-Substrate Enrichment Analysis Results • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates heatmaps of the KSEA results (Fig. 3E, +Extended Data Fig. 5E).

+ +
+for (group_i in names(PHOSPHO_KSEA)[c(1, 3)]) {
+  # Top ~20 most enriched kinases
+  top_kinases <- PHOSPHO_KSEA[[group_i]] %>%
+    group_by(kinase) %>%
+    summarise(min_pval = min(pval)) %>%
+    slice_min(order_by = min_pval, n = 20) %>%
+    pull(kinase)
+  
+  ## Kinase heatmap -------------------------------------------------------------
+  scale <- 2 # scale for saving heatmap
+  
+  if (group_i == "trained_vs_SED") {
+    # Column annotation (sex)
+    ca_df <- data.frame(Sex = rep(c("Female", "Male"), each = 4)) %>%
+      mutate(Sex = factor(Sex, levels = c("Female", "Male")))
+    ca_colors <- list("Sex" = c("#ff6eff", "#5555ff"))
+    names(ca_colors$Sex) <- levels(ca_df$Sex)
+    
+    top_annotation <- HeatmapAnnotation(
+      df = ca_df, col = ca_colors,
+      show_annotation_name = TRUE,
+      annotation_name_gp = gpar(fontsize = scale * 7),
+      gp = gpar(col = "black"),
+      border = TRUE, gap = 0,
+      annotation_legend_param = list(
+        border = "black",
+        grid_height = unit(14, "pt"),
+        grid_width = unit(14, "pt"),
+        title_gp = gpar(fontsize = scale * 7),
+        labels_gp = gpar(fontsize = scale * 6)
+      )
+    )
+    
+    column_labels <- rep(paste0(2 ^ (0:3), "W - SED"), times = 2)
+    column_split <- ca_df$Sex
+    colors <- c("#3366ff", "darkred", "grey")
+  } else {
+    column_labels <- latex2exp::TeX(
+      sprintf("(%dW - SED)$_{M - F}$", 2 ^ (0:3))
+    )
+    top_annotation <- column_split <- NULL
+    colors <- c("#ff6eff", "#5555ff", "grey")
+  }
+  
+  
+  # Enrichment heatmap
+  PHOSPHO_KSEA[[group_i]] %>%
+    filter(kinase %in% top_kinases) %>%
+    enrichmat(plot_sig_only = FALSE,
+              n_top = Inf,
+              colors = colors,
+              rownames_column = "kinase",
+              cell_size = unit(6 * scale, "points"),
+              padj_args = list(
+                title_gp = gpar(fontsize = 7 * scale),
+                labels_gp = gpar(fontsize = 6 * scale),
+                grid_height = unit(6 * scale, "pt"),
+                grid_width = unit(6 * scale, "pt")
+              ),
+              padj_legend_title = "BH-adjusted\np-value",
+              heatmap_args = list(
+                top_annotation = top_annotation,
+                cluster_row_slices = FALSE,
+                column_split = column_split,
+                show_parent_dend_line = FALSE,
+                column_title = NULL,
+                row_title = NULL,
+                column_labels = column_labels,
+                column_names_gp = gpar(fontsize = 5.5 * scale),
+                row_names_gp = gpar(fontsize = 5.5 * scale),
+                heatmap_legend_param = list(
+                  title_gp = gpar(fontsize = scale * 6.5),
+                  labels_gp = gpar(fontsize = scale * 6),
+                  legend_height = unit(90, "pt")
+                )),
+              height = scale * unit(2.5, "in"),
+              width = scale * unit(2.5, "in"),
+              draw_args = list(legend_gap = unit(0.4, "in"),
+                               gap = unit(0.5, "in"),
+                               adjust_annotation_extension = TRUE,
+                               heatmap_legend_side = "right", #"bottom",
+                               annotation_legend_side = "right",
+                               align_annotation_legend = "heatmap_top",
+                               align_heatmap_legend = "heatmap_top"
+              ),
+              save_args = list(dpi = 400, res = 400, family = "ArialMT"),
+              filename = sprintf(file.path("..", "..", "plots",
+                                           "PHOSPHO_kinase_heatmap_%s.pdf"),
+                                 group_i))
+}
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/MAIN_FGSEA.html b/articles/MAIN_FGSEA.html new file mode 100644 index 0000000..f26eced --- /dev/null +++ b/articles/MAIN_FGSEA.html @@ -0,0 +1,478 @@ + + + + + + + +FGSEA of Omics Datasets • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + + +
+

Overview +

+

Fast Gene Set Enrichment Analysis (FGSEA)[1] will be performed +using Entrez gene identifiers for proteomics and transcriptomics and +RefMet metabolite identifiers for metabolomics. Gene Ontology gene sets +will be used for proteomics and phosphoproteomics, while RefMet chemical +subclasses will be used to group metabolites into metabolite sets. We +assume that the majority of the white adipose tissue (WAT) proteome and +transcriptome were captured by our datasets, so we only keep gene sets +that retain the majority of their genes after filtering to what was +present in our -omics datasets. That is, only those gene sets with at +least 85% of their original genes will be used for testing. Gene sets +will be filtered further based on size so that they must contain at +least 15 genes. For metabolomics, a minimum of 10 metabolites per +chemical subclass are required, though a membership filter will not be +applied. Sets contain no more than 300 members due to pre-filtering of +MSIGDB_PATHWAYS (see help("MSIGDB_PATHWAYS") +for details).

+
+

Transcriptomics +

+

There is a one-to-many mapping between transcripts and Entrez genes, +so we will need to account for this.

+
+table(grepl(";", TRNSCRPT_DA$MvF_SED$entrez_gene))
+#> 
+#> FALSE  TRUE 
+#> 16227   177
+# 177 transcripts have multiple genes. Separate to multiple rows
+
+TRNSCRPT_DA_SEP <- TRNSCRPT_DA %>%
+  map(.f = ~ separate_rows(.x, entrez_gene, gene_symbol, sep = ";") %>%
+        filter(entrez_gene != "NA"))
+
+# Entrez to gene symbol conversion vector for leading edge
+TRNSCRPT_entrez_to_symbol <- TRNSCRPT_DA_SEP$MvF_SED %>%
+  dplyr::select(entrez_gene, gene_symbol) %>%
+  distinct() %>%
+  deframe()
+head(TRNSCRPT_entrez_to_symbol)
+#>    24379   296511   498922   296272   297738   362454 
+#>   "Gad1"   "Alx4"  "Cbln1"  "Tcf15" "Steap1"  "Hebp1"
+
+# Select gene sets that are largely unchanged when filtering
+# to only those Entrez IDs present in the results.
+TRNSCRPT_MSIGDB <- MSIGDB_PATHWAYS %>%
+  mutate(entrez_gene = map(.x = entrez_gene, .f = intersect,
+                           y = names(TRNSCRPT_entrez_to_symbol)),
+         set_size_post = lengths(entrez_gene),
+         ratio = set_size_post / set_size) %>%
+  filter(ratio >= 0.85, # at least 85% of the original set remains
+         set_size_post >= 15)
+
+table(TRNSCRPT_MSIGDB$gs_subcat) # how many gene sets remain?
+#> 
+#> GO:BP GO:CC GO:MF 
+#>  2715   320   480
+# GO:BP GO:CC GO:MF
+#  2864   347   498
+
+# FGSEA
+TRNSCRPT_FGSEA <- map(TRNSCRPT_DA_SEP, function(res_i) {
+  fgsea2(pathways = TRNSCRPT_MSIGDB,
+         stats = rank_genes(res_i, genes = "entrez_gene"),
+         seed = 0, nPermSimple = 10000,
+         adjust.globally = TRUE, nproc = 1) %>%
+    # Map Entrez IDs in leading edge subset to gene symbols
+    mutate(leadingEdge_genes = map(
+      .x = leadingEdge,
+      .f = ~ na.omit(TRNSCRPT_entrez_to_symbol[as.character(.x)])
+    )) %>%
+    # Reorder columns
+    dplyr::select(pathway, gs_subcat, gs_description, everything()) %>%
+    relocate(contrast, .before = leadingEdge)
+})
+
+
+

Proteomics +

+
+# Entrez to gene symbol conversion vector for leading edge
+PROT_entrez_to_symbol <- fData(PROT_EXP) %>%
+  dplyr::select(entrez_gene, gene_symbol) %>%
+  distinct() %>%
+  deframe()
+head(PROT_entrez_to_symbol)
+#>     26194     26195     26198     26196     26204     26199 
+#>  "Mt-nd2"  "Mt-co1"  "Mt-co2" "Mt-atp8"  "Mt-co3"  "Mt-nd3"
+
+# Select gene sets that are largely unchanged when filtering
+# to only those Entrez IDs present in the results.
+PROT_MSIGDB <- MSIGDB_PATHWAYS %>%
+  mutate(entrez_gene = map(.x = entrez_gene, .f = intersect,
+                           y = names(PROT_entrez_to_symbol)),
+         set_size_post = lengths(entrez_gene),
+         ratio = set_size_post / set_size) %>%
+  filter(ratio >= 0.85, # at least 85% of the original set remains
+         set_size_post >= 15)
+
+table(PROT_MSIGDB$gs_subcat) # how many gene sets remain?
+#> 
+#> GO:BP GO:CC GO:MF 
+#>   230    97    77
+# GO:BP GO:CC GO:MF
+#   234    99    78
+
+# FGSEA
+PROT_FGSEA <- map(PROT_DA, function(res_i) {
+  fgsea2(pathways = PROT_MSIGDB,
+         stats = rank_genes(res_i, genes = "entrez_gene"),
+         seed = 0, nPermSimple = 10000,
+         adjust.globally = TRUE, nproc = 1) %>%
+    # Map Entrez IDs in leading edge subset to gene symbols
+    mutate(leadingEdge_genes = map(
+      .x = leadingEdge,
+      .f = ~ na.omit(PROT_entrez_to_symbol[as.character(.x)])
+    )) %>%
+    # Reorder columns
+    dplyr::select(pathway, gs_subcat, gs_description, everything()) %>%
+    relocate(contrast, .before = leadingEdge)
+})
+
+
+

Metabolomics +

+

Unlike with proteomics and transcriptomics, we are not limited to +testing terms that are largely unchanged after filtering. This is +because the RefMet chemical subclasses are homogenous groups (e.g., +subsetting the acyl carnitines will still result in a group of only acyl +carnitines).

+
+# Reformat fData for use with fgsea2
+REFMET_SUBCLASSES <- fData(METAB_EXP) %>%
+  group_by(refmet_sub_class) %>%
+  summarise(feature = list(feature_ID)) %>%
+  mutate(gs_subcat = "refmet_sub_class",
+         gs_exact_source = refmet_sub_class,
+         gs_description = refmet_sub_class,
+         set_size = lengths(feature)) %>%
+  filter(set_size >= 10)
+
+nrow(REFMET_SUBCLASSES) # 19
+#> [1] 19
+
+# FGSEA
+METAB_FGSEA <- map(METAB_DA, function(res_i) {
+  fgsea2(pathways = REFMET_SUBCLASSES,
+         gene_column = "feature",
+         stats = rank_genes(res_i, genes = "feature"),
+         seed = 0, nPermSimple = 10000,
+         adjust.globally = TRUE, nproc = 1) %>%
+    # Reorder columns
+    dplyr::rename(refmet_sub_class = pathway) %>%
+    dplyr::select(-starts_with("gs_")) %>%
+    relocate(contrast, .before = leadingEdge)
+})
+
+# Save
+usethis::use_data(TRNSCRPT_FGSEA, internal = FALSE, overwrite = TRUE,
+                  version = 3, compress = "bzip2")
+
+usethis::use_data(PROT_FGSEA, internal = FALSE, overwrite = TRUE,
+                  version = 3, compress = "bzip2")
+
+usethis::use_data(METAB_FGSEA, internal = FALSE, overwrite = TRUE,
+                  version = 3, compress = "bzip2")
+
+
+
+

Session Info +

+
+sessionInfo()
+#> R version 4.3.3 (2024-02-29)
+#> Platform: x86_64-pc-linux-gnu (64-bit)
+#> Running under: Ubuntu 22.04.4 LTS
+#> 
+#> Matrix products: default
+#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
+#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
+#> 
+#> locale:
+#>  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
+#>  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
+#>  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
+#> [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
+#> 
+#> time zone: UTC
+#> tzcode source: system (glibc)
+#> 
+#> attached base packages:
+#> [1] stats     graphics  grDevices utils     datasets  methods   base     
+#> 
+#> other attached packages:
+#> [1] purrr_1.0.2                        tibble_3.2.1                      
+#> [3] tidyr_1.3.1                        dplyr_1.1.4                       
+#> [5] MotrpacRatTraining6moWAT_1.0.0     Biobase_2.62.0                    
+#> [7] BiocGenerics_0.48.1                MotrpacRatTraining6moWATData_2.0.0
+#> 
+#> loaded via a namespace (and not attached):
+#>   [1] RColorBrewer_1.1-3      rstudioapi_0.15.0       jsonlite_1.8.8         
+#>   [4] shape_1.4.6.1           magrittr_2.0.3          ggbeeswarm_0.7.2       
+#>   [7] rmarkdown_2.25          GlobalOptions_0.1.2     fs_1.6.3               
+#>  [10] zlibbioc_1.48.0         ragg_1.2.7              vctrs_0.6.5            
+#>  [13] memoise_2.0.1           RCurl_1.98-1.14         base64enc_0.1-3        
+#>  [16] rstatix_0.7.2           htmltools_0.5.7         dynamicTreeCut_1.63-1  
+#>  [19] curl_5.2.1              broom_1.0.5             Formula_1.2-5          
+#>  [22] sass_0.4.8              bslib_0.6.1             htmlwidgets_1.6.4      
+#>  [25] desc_1.4.3              impute_1.76.0           cachem_1.0.8           
+#>  [28] lifecycle_1.0.4         iterators_1.0.14        pkgconfig_2.0.3        
+#>  [31] Matrix_1.6-5            R6_2.5.1                fastmap_1.1.1          
+#>  [34] GenomeInfoDbData_1.2.11 clue_0.3-65             digest_0.6.34          
+#>  [37] colorspace_2.1-0        patchwork_1.2.0         AnnotationDbi_1.64.1   
+#>  [40] S4Vectors_0.40.2        textshaping_0.3.7       Hmisc_5.1-1            
+#>  [43] RSQLite_2.3.5           ggpubr_0.6.0            filelock_1.0.3         
+#>  [46] latex2exp_0.9.6         fansi_1.0.6             httr_1.4.7             
+#>  [49] abind_1.4-5             compiler_4.3.3          withr_3.0.0            
+#>  [52] bit64_4.0.5             doParallel_1.0.17       htmlTable_2.4.2        
+#>  [55] backports_1.4.1         BiocParallel_1.36.0     carData_3.0-5          
+#>  [58] DBI_1.2.2               ggsignif_0.6.4          rjson_0.2.21           
+#>  [61] tools_4.3.3             vipor_0.4.7             foreign_0.8-86         
+#>  [64] beeswarm_0.4.0          msigdbr_7.5.1           nnet_7.3-19            
+#>  [67] glue_1.7.0              grid_4.3.3              checkmate_2.3.1        
+#>  [70] cluster_2.1.6           fgsea_1.28.0            generics_0.1.3         
+#>  [73] gtable_0.3.4            preprocessCore_1.64.0   data.table_1.15.2      
+#>  [76] WGCNA_1.72-5            car_3.1-2               utf8_1.2.4             
+#>  [79] XVector_0.42.0          foreach_1.5.2           pillar_1.9.0           
+#>  [82] stringr_1.5.1           babelgene_22.9          limma_3.58.1           
+#>  [85] circlize_0.4.16         splines_4.3.3           BiocFileCache_2.10.1   
+#>  [88] lattice_0.22-5          survival_3.5-8          bit_4.0.5              
+#>  [91] tidyselect_1.2.0        GO.db_3.18.0            ComplexHeatmap_2.18.0  
+#>  [94] locfit_1.5-9.9          Biostrings_2.70.2       knitr_1.45             
+#>  [97] gridExtra_2.3           IRanges_2.36.0          edgeR_4.0.16           
+#> [100] stats4_4.3.3            xfun_0.42               statmod_1.5.0          
+#> [103] matrixStats_1.2.0       stringi_1.8.3           yaml_2.3.8             
+#> [106] evaluate_0.23           codetools_0.2-19        cli_3.6.2              
+#> [109] ontologyIndex_2.12      rpart_4.1.23            systemfonts_1.0.5      
+#> [112] munsell_0.5.0           jquerylib_0.1.4         Rcpp_1.0.12            
+#> [115] GenomeInfoDb_1.38.6     dbplyr_2.4.0            png_0.1-8              
+#> [118] fastcluster_1.2.6       parallel_4.3.3          pkgdown_2.0.7          
+#> [121] ggplot2_3.5.0           blob_1.2.4              bitops_1.0-7           
+#> [124] scales_1.3.0            crayon_1.5.2            GetoptLong_1.0.5       
+#> [127] rlang_1.1.3             cowplot_1.1.3           fastmatch_1.1-4        
+#> [130] KEGGREST_1.42.0
+
+
+

References +

+
+
+1. Korotkevich, G., Sukhov, V., & Sergushichev, A. (2019). Fast gene +set enrichment analysis. bioRxiv. https://doi.org/10.1101/060012 +
+
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/METAB_TAG_heatmap.html b/articles/METAB_TAG_heatmap.html new file mode 100644 index 0000000..ad060ff --- /dev/null +++ b/articles/METAB_TAG_heatmap.html @@ -0,0 +1,303 @@ + + + + + + + +Heatmap of total triacylglycerol concentrations • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates a heatmap of total TAG concentrations (Fig. +5E).

+ +
+# Scaling factor for plot elements
+scale <- 2
+
+# Barplot annotation
+TG_hm <- HeatmapAnnotation(`Median \nTotal TAG \n(ug/mg tissue)` =
+                             anno_barplot(METAB_TG_CONC$median_total_TG,
+                                          bar_width = 1, # 0.85
+                                          height = unit(45 * scale, "pt")),
+                           annotation_name_gp = gpar(fontsize = 7 * scale))
+
+# Column annotation
+ha <- select(pData(METAB_TG_CONC), sex, timepoint) %>%
+  transmute(Sex = sex,
+            Timepoint = timepoint) %>%
+  HeatmapAnnotation(
+    df = .,
+    border = TRUE,
+    gp = gpar(col = "black"),
+    gap = 0,
+    which = "column",
+    height = unit(6 * 2, "pt") * scale,
+    col = list(
+      Sex = c("Female" = "#ff6eff",
+              "Male" = "#5555ff"),
+      Timepoint = c("SED" = "white",
+                    "1W" = "#F7FCB9",
+                    "2W" = "#ADDD8E",
+                    "4W" = "#238443",
+                    "8W" = "#002612")
+    ),
+    annotation_name_gp = gpar(fontsize = 7 * scale),
+    annotation_legend_param = list(Timepoint = list(
+      at = c("SED", "1W", "2W", "4W", "8W")),
+      border = "black",
+      labels_gp = gpar(fontsize = 6.5 * scale),
+      title_gp = gpar(fontsize = 7 * scale, fontface = "bold")
+    )
+  )
+
+# Subset to top 20 metabolites
+METAB_TG_CONC <- METAB_TG_CONC[order(fData(METAB_TG_CONC)[["rank"]]), ][1:20, ]
+
+ht <- exprs(METAB_TG_CONC) %>%
+  Heatmap(matrix = .,
+          col = circlize::colorRamp2(
+            breaks = c(-1.9, 0, 2.1),
+            colors = c("#3366ff", "white", "darkred")
+          ),
+          cluster_columns = FALSE,
+          cluster_rows = FALSE,
+          show_column_names = FALSE,
+          row_labels = fData(METAB_TG_CONC)[["name_in_figures"]],
+          top_annotation = ha,
+          border = "black",
+          row_names_gp = gpar(fontsize = 5 * scale),
+          height = nrow(.) * unit(5.5, "pt") * scale,
+          width = ncol(.) * unit(5.5, "pt") * scale,
+          column_split = rep(1:2, each = 5),
+          column_title = NULL,
+          heatmap_legend_param = list(
+            title = "Standardized\nMedian\nConcentration",
+            at = c(-1.9, -1:1, 2.1),
+            title_gp = gpar(fontsize = 7 * scale,
+                            fontface = "bold"),
+            labels_gp = gpar(fontsize = 6 * scale),
+            legend_height = 5 * scale * unit(8, "pt"),
+            border = "black"
+          ))
+
+# Stack barplot on top of heatmap
+ht <- TG_hm %v% ht
+
+# Save
+pdf(file = file.path("..", "..", "plots", "total_TAG_heatmap.pdf"),
+    width = 2.5 * scale, height = 2.5 * scale, family = "ArialMT")
+draw(ht, merge_legends = TRUE,
+     align_heatmap_legend = "heatmap_top",
+     align_annotation_legend = "heatmap_top")
+dev.off()
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/MitoCarta_FGSEA_heatmaps.html b/articles/MitoCarta_FGSEA_heatmaps.html new file mode 100644 index 0000000..e12c7f3 --- /dev/null +++ b/articles/MitoCarta_FGSEA_heatmaps.html @@ -0,0 +1,356 @@ + + + + + + + +Plots of MitoCarta 3.0 FGSEA Results • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates a scatterplot and heatmap of the MitoCarta 3.0 +FGSEA results (Fig. 5A–B).

+ +
+## SED MvF plot ---------------------------------------------------------------
+x <- PROT_MITOCARTA_FGSEA$MvF_SED %>%
+  filter(padj < 0.05) %>%
+  arrange(NES) %>%
+  mutate(pathway = factor(pathway, levels = unique(pathway)),
+         leading_edge_size = lengths(leadingEdge),
+         top_genes = unlist(lapply(leadingEdge_genes, function(x)
+           paste(head(x, 6), collapse = ", ")
+         )),
+         top_genes = ifelse(leading_edge_size > 6,
+                            paste0(top_genes, ", ..."), top_genes))
+
+p1 <- ggplot(x, aes(x = NES, y = as.numeric(pathway),
+                    size = leading_edge_size)) +
+  geom_point(color = "#5555ff", alpha = 0.7, shape = 16) +
+  scale_size_area(name = "Leading Edge Size:",
+                  max_size = 4) +
+  scale_x_continuous(breaks = seq(1.6, 2.2, 0.2),
+                     limits = c(1.5, 2.2)) +
+  scale_y_continuous(breaks = 1:length(x$pathway),
+                     labels = levels(x$pathway),
+                     expand = expansion(add = 0.5)) +
+  labs(x = latex2exp::TeX("NES: (Male - Female)$_{SED}$"),
+       y = NULL) +
+  theme_pub() +
+  theme(panel.grid.minor = element_blank(),
+        # panel.grid.major.x = element_blank(),
+        axis.ticks.y = element_blank(),
+        axis.text.y.right = element_text(size = 5, color = "black"),
+        legend.margin = margin(t = -2, unit = "pt"),
+        panel.border = element_rect(color = "black", linewidth = 0.3,
+                                    fill = NA),
+        axis.line = element_blank(),
+        legend.direction = "horizontal", 
+        legend.position = "bottom",
+        legend.key.size = unit(10, "pt"))
+
+p1
+

+
+ggsave(file.path("..", "..", "plots", "MitoCarta_FGSEA_MvF.pdf"), p1, family = "ArialMT",
+       height = 2.8, width = 2.2, dpi = 400, bg = "white")
+
+## Timewise 4W and 8W comparison heatmap -------------------------------------
+scale <- 2
+heatmap_legend_side <- annotation_legend_side <- "right"
+align_heatmap_legend <- align_annotation_legend <- "heatmap_top"
+direction <- "vertical"
+legend_width <- NULL
+legend_height <- unit(90, "points")
+
+column_labels <- rep(paste0(2 ^ (0:3), "W - SED"), times = 2)
+
+anno_df <- data.frame(Sex = rep(c("Female", "Male"), each = 4))
+anno_colors <- list(Sex = c("Female" = "#ff6eff", "Male" = "#5555ff"))
+
+top_annotation <- HeatmapAnnotation(
+  df = anno_df,
+  col = anno_colors,
+  gap = unit(0, "points"),
+  gp = gpar(col = "black"),
+  annotation_name_gp = gpar(fontsize = 7 * scale),
+  annotation_legend_param = list(
+    nrow = 2, by_row = T,
+    grid_height = unit(14, "points"),
+    grid_width = unit(14, "points"),
+    border = "black",
+    title_gp = gpar(fontsize = 7 * scale),
+    labels_gp = gpar(fontsize = 6 * scale)
+  )
+)
+column_split <- anno_df$Sex
+
+colors <- c("#3366ff", "darkred", "grey")
+
+# Get terms that are enriched in later timepoints
+late_terms <- PROT_MITOCARTA_FGSEA$trained_vs_SED %>%
+  filter(grepl("4|8", contrast)) %>%
+  group_by(pathway) %>%
+  summarise(any_sig = any(padj < 0.05),
+            max_val = max(-log10(padj), na.rm = TRUE)) %>%
+  filter(any_sig) %>%
+  slice_max(order_by = max_val, n = 20) %>%
+  pull(pathway)
+
+PROT_MITOCARTA_FGSEA$trained_vs_SED %>%
+  filter(pathway %in% late_terms) %>%
+  enrichmat(n_top = 20,
+            colors = colors,
+            scale_by = "row",
+            cell_size = unit(6 * scale , "points"),
+            padj_legend_title = "BH-adjusted\np-value",
+            padj_args = list(
+              title_gp = gpar(fontsize = 7 * scale),
+              labels_gp = gpar(fontsize = 6 * scale),
+              grid_height = unit(6 * scale, "pt"),
+              grid_width = unit(6 * scale, "pt")
+            ),
+            rownames_column = "pathway",
+            heatmap_args = list(
+              column_labels = column_labels,
+              column_title_side = "bottom",
+              column_split = column_split,
+              column_title = NULL,
+              column_names_gp = gpar(fontsize = 5.5 * scale),
+              row_names_gp = gpar(fontsize = 5.5 * scale),
+              top_annotation = top_annotation,
+              heatmap_legend_param = list(
+                title_gp = gpar(fontsize = scale * 6.5),
+                labels_gp = gpar(fontsize = scale * 6),
+                direction = direction,
+                legend_width = legend_width,
+                legend_height = legend_height
+              )
+            ),
+            filename = file.path("..", "..", "plots",
+                                 "MitoCarta_FGSEA_timewise.pdf"),
+            height = scale * unit(2.5, "in"),
+            width = scale * unit(3.2, "in"),
+            units = "in",
+            draw_args = list(
+              legend_gap = unit(0.4, "in"),
+              gap = unit(0.5, "in"),
+              adjust_annotation_extension = TRUE,
+              heatmap_legend_side = heatmap_legend_side,
+              annotation_legend_side = annotation_legend_side,
+              align_annotation_legend = align_annotation_legend,
+              align_heatmap_legend = align_heatmap_legend
+            ),
+            save_args = list(res = 400, dpi = 400, family = "ArialMT")
+  )
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/MitoCarta_FGSEA_heatmaps_files/figure-html/unnamed-chunk-2-1.png b/articles/MitoCarta_FGSEA_heatmaps_files/figure-html/unnamed-chunk-2-1.png new file mode 100644 index 0000000..a1d5322 Binary files /dev/null and b/articles/MitoCarta_FGSEA_heatmaps_files/figure-html/unnamed-chunk-2-1.png differ diff --git a/articles/PHENO_WAT_STATS.html b/articles/PHENO_WAT_STATS.html new file mode 100644 index 0000000..a66d9eb --- /dev/null +++ b/articles/PHENO_WAT_STATS.html @@ -0,0 +1,786 @@ + + + + + + + +Statistical analyses of post - pre training differences • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + + +
+# Generate all regression diagnostic plots
+plot_lm <- function(x) {
+  par(mfrow = c(2, 3))
+  for (i in 1:6)
+    plot(x, which = i)
+  par(mfrow = c(1, 1))
+}
+
+

Regression Models +

+

We will fit OLS or WLS regression models with sex, timepoint, and +their interaction as predictors of the (post - pre) training differences +for each phenotypic measure. Only those samples selected for -omics +analysis will be considered. If a WLS model is used, the weights will be +reciprocal group variances.

+
+

NMR Weight +

+
+# Plot points
+ggplot(PHENO_WAT, aes(x = timepoint, y = post_weight - pre_weight,
+                      color = omics_analysis)) +
+  geom_point(position = position_jitterdodge(jitter.width = 0.15, 
+                                             jitter.height = 0, 
+                                             dodge.width = 0.4),
+             na.rm = TRUE, alpha = 0.5) +
+  facet_grid(~ sex, drop = TRUE) +
+  labs(y = "NMR weight (post - pre)") +
+  scale_color_manual(values = c("red", "black"),
+                     breaks = c(TRUE, FALSE)) +
+  theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
+        legend.position = "bottom", 
+        legend.direction = "horizontal")
+

+

There is one negative outlying value in the SED male group that may +affect the model fit. We will start with a WLS model, since we observe +different group variances.

+
+wt.weight <- filter(PHENO_WAT, omics_analysis) %>% 
+  group_by(sex, timepoint) %>% 
+  mutate(1 / var(post_weight - pre_weight, na.rm = TRUE)) %>% 
+  pull(-1)
+
+fit.weight <- lm(I(post_weight - pre_weight) ~ sex * timepoint,
+                 weights = wt.weight,
+                 data = filter(PHENO_WAT, omics_analysis))
+plot_lm(fit.weight)
+

+

The diagnostic plots appear relatively fine. We will try to simplify +the model.

+
+anova(fit.weight, test = "F")
+#> Analysis of Variance Table
+#> 
+#> Response: I(post_weight - pre_weight)
+#>               Df  Sum Sq Mean Sq  F value    Pr(>F)    
+#> sex            1 277.235 277.235 277.2347 < 2.2e-16 ***
+#> timepoint      2  44.945  22.472  22.4723 1.086e-06 ***
+#> sex:timepoint  2   8.390   4.195   4.1949   0.02475 *  
+#> Residuals     30  30.000   1.000                       
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+

All terms are significant. We will not change the model.

+
+summary(fit.weight)
+#> 
+#> Call:
+#> lm(formula = I(post_weight - pre_weight) ~ sex * timepoint, data = filter(PHENO_WAT, 
+#>     omics_analysis), weights = wt.weight)
+#> 
+#> Weighted Residuals:
+#>      Min       1Q   Median       3Q      Max 
+#> -1.82069 -0.69316  0.03128  0.59206  1.63424 
+#> 
+#> Coefficients:
+#>                     Estimate Std. Error t value Pr(>|t|)    
+#> (Intercept)           22.583      1.897  11.902 6.85e-13 ***
+#> sexMale               -5.383      8.521  -0.632 0.532317    
+#> timepoint4W          -16.933      3.071  -5.514 5.46e-06 ***
+#> timepoint8W          -12.550      3.154  -3.980 0.000404 ***
+#> sexMale:timepoint4W   -9.117     10.888  -0.837 0.409040    
+#> sexMale:timepoint8W  -22.317      8.994  -2.481 0.018915 *  
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+#> 
+#> Residual standard error: 1 on 30 degrees of freedom
+#> Multiple R-squared:  0.9168, Adjusted R-squared:  0.9029 
+#> F-statistic: 66.11 on 5 and 30 DF,  p-value: 2.764e-15
+
+
+

NMR Fat Mass +

+
+# Plot points
+ggplot(PHENO_WAT, aes(x = timepoint, y = post_fat - pre_fat,
+                      color = omics_analysis)) +
+  geom_point(position = position_jitterdodge(jitter.width = 0.15, 
+                                             jitter.height = 0, 
+                                             dodge.width = 0.4),
+             na.rm = TRUE, alpha = 0.5) +
+  facet_grid(~ sex, drop = TRUE) +
+  labs(y = "NMR Fat (post - pre)") +
+  scale_color_manual(values = c("red", "black"),
+                     breaks = c(TRUE, FALSE)) +
+  theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
+        legend.position = "bottom", 
+        legend.direction = "horizontal")
+

+

We observe unequal group variances, and an outlying value in the 4W +males. We will fit a WLS model with reciprocal group variances as +weights.

+
+wt.fat <- filter(PHENO_WAT, omics_analysis) %>% 
+  group_by(sex, timepoint) %>% 
+  mutate(1 / var(post_fat - pre_fat, na.rm = TRUE)) %>% 
+  pull(-1)
+
+fit.fat <- lm(I(post_fat - pre_fat) ~ sex * timepoint,
+              weights = wt.fat,
+              data = filter(PHENO_WAT, omics_analysis))
+plot_lm(fit.fat)
+

+

The diagnostic plots seem mostly fine. We will try to simplify the +model.

+
+anova(fit.fat, test = "F")
+#> Analysis of Variance Table
+#> 
+#> Response: I(post_fat - pre_fat)
+#>               Df  Sum Sq Mean Sq F value    Pr(>F)    
+#> sex            1  41.089  41.089  41.089 4.458e-07 ***
+#> timepoint      2 117.838  58.919  58.919 4.074e-11 ***
+#> sex:timepoint  2  40.251  20.125  20.125 2.865e-06 ***
+#> Residuals     30  30.000   1.000                      
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+

All terms are significant.

+
+summary(fit.fat)
+#> 
+#> Call:
+#> lm(formula = I(post_fat - pre_fat) ~ sex * timepoint, data = filter(PHENO_WAT, 
+#>     omics_analysis), weights = wt.fat)
+#> 
+#> Weighted Residuals:
+#>      Min       1Q   Median       3Q      Max 
+#> -1.94173 -0.68699  0.06809  0.64668  1.85904 
+#> 
+#> Coefficients:
+#>                     Estimate Std. Error t value Pr(>|t|)    
+#> (Intercept)            5.057      1.108   4.562 8.01e-05 ***
+#> sexMale               -1.248      1.694  -0.737  0.46704    
+#> timepoint4W           -6.519      1.229  -5.303 9.90e-06 ***
+#> timepoint8W           -4.952      1.738  -2.850  0.00783 ** 
+#> sexMale:timepoint4W   -2.122      3.931  -0.540  0.59335    
+#> sexMale:timepoint8W  -15.505      2.499  -6.203 7.91e-07 ***
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+#> 
+#> Residual standard error: 1 on 30 degrees of freedom
+#> Multiple R-squared:  0.8691, Adjusted R-squared:  0.8473 
+#> F-statistic: 39.84 on 5 and 30 DF,  p-value: 2.299e-12
+
+
+

NMR % Fat +

+
+# Plot points
+ggplot(PHENO_WAT, aes(x = timepoint, y = post_fat_pct - pre_fat_pct,
+                      color = omics_analysis)) +
+  geom_point(position = position_jitterdodge(jitter.width = 0.15, 
+                                             jitter.height = 0, 
+                                             dodge.width = 0.4),
+             na.rm = TRUE, alpha = 0.5) +
+  facet_grid(~ sex, drop = TRUE) +
+  labs(y = "NMR % Fat (post - pre)") +
+  scale_color_manual(values = c("red", "black"),
+                     breaks = c(TRUE, FALSE)) +
+  theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
+        legend.position = "bottom", 
+        legend.direction = "horizontal")
+

+

We observe the same outlying value in the 4W male group. We will fit +an OLS model first.

+
+fit.fat_pct <- lm(I(post_fat_pct - pre_fat_pct) ~ sex * timepoint,
+                  data = filter(PHENO_WAT, omics_analysis))
+plot_lm(fit.fat_pct)
+

+

We will incorporate reciprocal group variances as weights.

+
+wt.fat_pct <- filter(PHENO_WAT, omics_analysis) %>% 
+  group_by(sex, timepoint) %>% 
+  mutate(1 / var(post_fat_pct - pre_fat_pct, na.rm = TRUE)) %>% 
+  pull(-1)
+
+fit.fat_pct <- update(fit.fat_pct, weights = wt.fat_pct)
+plot_lm(fit.fat_pct)
+

+

The diagnostic plots look better, though still not great. We will try +to simplify the model.

+
+anova(fit.fat_pct, test = "F")
+#> Analysis of Variance Table
+#> 
+#> Response: I(post_fat_pct - pre_fat_pct)
+#>               Df  Sum Sq Mean Sq F value    Pr(>F)    
+#> sex            1  28.815  28.815 28.8154 8.241e-06 ***
+#> timepoint      2 150.158  75.079 75.0792 2.099e-12 ***
+#> sex:timepoint  2  13.206   6.603  6.6028  0.004205 ** 
+#> Residuals     30  30.000   1.000                      
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+

All terms are significant, so we will not update the model.

+
+summary(fit.fat_pct)
+#> 
+#> Call:
+#> lm(formula = I(post_fat_pct - pre_fat_pct) ~ sex * timepoint, 
+#>     data = filter(PHENO_WAT, omics_analysis), weights = wt.fat_pct)
+#> 
+#> Weighted Residuals:
+#>      Min       1Q   Median       3Q      Max 
+#> -1.96425 -0.64972  0.05565  0.63247  1.87436 
+#> 
+#> Coefficients:
+#>                     Estimate Std. Error t value Pr(>|t|)    
+#> (Intercept)           2.8000     0.6143   4.558 8.09e-05 ***
+#> sexMale              -1.6833     0.7208  -2.335  0.02641 *  
+#> timepoint4W          -3.6000     0.6797  -5.296 1.01e-05 ***
+#> timepoint8W          -2.6667     0.9687  -2.753  0.00993 ** 
+#> sexMale:timepoint4W   0.8833     1.3278   0.665  0.51095    
+#> sexMale:timepoint8W  -3.4167     1.1011  -3.103  0.00415 ** 
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+#> 
+#> Residual standard error: 1 on 30 degrees of freedom
+#> Multiple R-squared:  0.865,  Adjusted R-squared:  0.8425 
+#> F-statistic: 38.44 on 5 and 30 DF,  p-value: 3.636e-12
+
+
+

VO\(_2\)max Relative to Body +Mass +

+

We will look at VO\(_2\)max (\(\text{mL} \cdot (\text{kg body mass})^{-1} \cdot +\text{min}^{-1}\)).

+
+# Plot points
+ggplot(PHENO_WAT, aes(x = timepoint, 
+                      y = post_vo2max_ml_kg_min - pre_vo2max_ml_kg_min,
+                      color = omics_analysis)) +
+  geom_point(position = position_jitterdodge(jitter.width = 0.15, 
+                                             jitter.height = 0, 
+                                             dodge.width = 0.4),
+             na.rm = TRUE, alpha = 0.5) +
+  facet_grid(~ sex, drop = TRUE) +
+  labs(y = "Absolute VO2max (post - pre)") +
+  scale_color_manual(values = c("red", "black"),
+                     breaks = c(TRUE, FALSE)) +
+  theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
+        legend.position = "bottom", 
+        legend.direction = "horizontal")
+

+

The SED female group has a large outlying value. We will begin by +fitting an OLS model.

+
+fit.vo2max_rel <- lm(I(post_vo2max_ml_kg_min - pre_vo2max_ml_kg_min) ~ 
+                       sex * timepoint,
+                     data = filter(PHENO_WAT, omics_analysis))
+plot_lm(fit.vo2max_rel)
+

+

We will incorporate reciprocal group variances as weights.

+
+wt.vo2max_rel <- filter(PHENO_WAT, omics_analysis) %>% 
+  group_by(sex, timepoint) %>% 
+  mutate(1 / var(post_vo2max_ml_kg_min - pre_vo2max_ml_kg_min, 
+                 na.rm = TRUE)) %>% 
+  pull(-1)
+
+fit.vo2max_rel <- update(fit.vo2max_rel, weights = wt.vo2max_rel)
+plot_lm(fit.vo2max_rel)
+

+

The diagnostic plots look mostly fine. We will try to simplify the +model.

+
+anova(fit.vo2max_rel, test = "F")
+#> Analysis of Variance Table
+#> 
+#> Response: I(post_vo2max_ml_kg_min - pre_vo2max_ml_kg_min)
+#>               Df Sum Sq Mean Sq F value    Pr(>F)    
+#> sex            1  0.560  0.5598  0.5598    0.4602    
+#> timepoint      2 48.662 24.3311 24.3311 5.252e-07 ***
+#> sex:timepoint  2  4.093  2.0464  2.0464    0.1469    
+#> Residuals     30 30.000  1.0000                      
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+

Only timepoint appears significant.

+
+fit.vo2max_rel.1 <- update(fit.vo2max_rel, formula = . ~ timepoint)
+anova(fit.vo2max_rel.1, fit.vo2max_rel, test = "F")
+#> Analysis of Variance Table
+#> 
+#> Model 1: I(post_vo2max_ml_kg_min - pre_vo2max_ml_kg_min) ~ timepoint
+#> Model 2: I(post_vo2max_ml_kg_min - pre_vo2max_ml_kg_min) ~ sex * timepoint
+#>   Res.Df    RSS Df Sum of Sq      F Pr(>F)
+#> 1     33 34.093                           
+#> 2     30 30.000  3    4.0927 1.3642 0.2726
+

There is no significant difference between the models, so we will use +the simpler one.

+
+fit.vo2max_rel <- fit.vo2max_rel.1
+plot_lm(fit.vo2max_rel)
+

+

The diagnostic plots look mostly fine.

+
+summary(fit.vo2max_rel)
+#> 
+#> Call:
+#> lm(formula = I(post_vo2max_ml_kg_min - pre_vo2max_ml_kg_min) ~ 
+#>     timepoint, data = filter(PHENO_WAT, omics_analysis), weights = wt.vo2max_rel)
+#> 
+#> Weighted Residuals:
+#>     Min      1Q  Median      3Q     Max 
+#> -1.6005 -0.6198 -0.1728  0.6841  2.0732 
+#> 
+#> Coefficients:
+#>             Estimate Std. Error t value Pr(>|t|)    
+#> (Intercept)   -4.151      1.647  -2.521 0.016724 *  
+#> timepoint4W    6.864      1.757   3.907 0.000438 ***
+#> timepoint8W   15.809      2.310   6.844 8.23e-08 ***
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+#> 
+#> Residual standard error: 1.016 on 33 degrees of freedom
+#> Multiple R-squared:  0.5908, Adjusted R-squared:  0.566 
+#> F-statistic: 23.82 on 2 and 33 DF,  p-value: 3.954e-07
+
+
+

VO\(_2\)max Relative to Lean +Mass +

+

We will look at VO\(_2\)max (\(\text{mL} \cdot (\text{kg lean mass})^{-1} \cdot +\text{min}^{-1}\)).

+
+# Plot points
+ggplot(PHENO_WAT, aes(x = timepoint, 
+                      y = post_vo2max_ml_kg_lean_min - pre_vo2max_ml_kg_lean_min,
+                      color = omics_analysis)) +
+  geom_point(position = position_jitterdodge(jitter.width = 0.15, 
+                                             jitter.height = 0, 
+                                             dodge.width = 0.4),
+             na.rm = TRUE, alpha = 0.5) +
+  facet_grid(~ sex, drop = TRUE) +
+  labs(y = "Relative VO2max (post - pre)") +
+  scale_color_manual(values = c("red", "black"),
+                     breaks = c(TRUE, FALSE)) +
+  theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
+        legend.position = "bottom", 
+        legend.direction = "horizontal")
+

+

There is a large outlying value in the SED female group, though it is +comparable to observations of samples not selected for -omics analyses. +We will fit a WLS model with reciprocal group variances as weights.

+
+wt.vo2max_rel_lean <- filter(PHENO_WAT, omics_analysis) %>% 
+  group_by(sex, timepoint) %>% 
+  mutate(1 / var(post_vo2max_ml_kg_lean_min - pre_vo2max_ml_kg_lean_min, 
+                 na.rm = TRUE)) %>% 
+  pull(-1)
+
+fit.vo2max_rel_lean <- lm(I(post_vo2max_ml_kg_lean_min - 
+                              pre_vo2max_ml_kg_lean_min) ~ 
+                            sex * timepoint,
+                          weights = wt.vo2max_rel_lean,
+                          data = filter(PHENO_WAT, omics_analysis))
+plot_lm(fit.vo2max_rel_lean)
+

+

The diagnostic plots look fine. We will try to simplify the +model.

+
+anova(fit.vo2max_rel_lean, test = "F")
+#> Analysis of Variance Table
+#> 
+#> Response: I(post_vo2max_ml_kg_lean_min - pre_vo2max_ml_kg_lean_min)
+#>               Df  Sum Sq Mean Sq F value   Pr(>F)   
+#> sex            1 12.0459 12.0459 12.0459 0.001596 **
+#> timepoint      2 14.5324  7.2662  7.2662 0.002671 **
+#> sex:timepoint  2  1.1653  0.5827  0.5827 0.564598   
+#> Residuals     30 30.0000  1.0000                    
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+

The interaction is not significant.

+
+fit.vo2max_rel_lean <- update(fit.vo2max_rel_lean, 
+                              formula = . ~ sex + timepoint)
+plot_lm(fit.vo2max_rel_lean)
+

+

The diagnostic plots look mostly fine.

+
+summary(fit.vo2max_rel_lean)
+#> 
+#> Call:
+#> lm(formula = I(post_vo2max_ml_kg_lean_min - pre_vo2max_ml_kg_lean_min) ~ 
+#>     sex + timepoint, data = filter(PHENO_WAT, omics_analysis), 
+#>     weights = wt.vo2max_rel_lean)
+#> 
+#> Weighted Residuals:
+#>     Min      1Q  Median      3Q     Max 
+#> -1.5507 -0.7169 -0.2395  0.6610  1.7870 
+#> 
+#> Coefficients:
+#>             Estimate Std. Error t value Pr(>|t|)   
+#> (Intercept)   7.6791     3.8610   1.989   0.0553 . 
+#> sexMale      -8.9977     3.3551  -2.682   0.0115 * 
+#> timepoint4W   0.6332     3.6393   0.174   0.8630   
+#> timepoint8W  13.2604     4.3147   3.073   0.0043 **
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+#> 
+#> Residual standard error: 0.9869 on 32 degrees of freedom
+#> Multiple R-squared:  0.4603, Adjusted R-squared:  0.4097 
+#> F-statistic: 9.097 on 3 and 32 DF,  p-value: 0.0001679
+
+
+
+

Comparisons +

+

We will test whether the mean of each timepoint is significantly +different from 0 by sex, if sex was included as a predictor. P-values +will be adjusted across each set of 3 comparisons by sex using the Holm +method.

+
+## Create emm_list objects
+model_list <- list("NMR Weight" = fit.weight,
+                   "NMR Fat Mass" = fit.fat,
+                   "NMR % Fat" = fit.fat_pct,
+                   "VO2max (relative to body mass)" = fit.vo2max_rel,
+                   "VO2max (relative to lean mass)" = fit.vo2max_rel_lean)
+
+# Extract model info
+model_df <- model_list %>% 
+  map_chr(.f = ~ paste(deparse(.x[["call"]]), collapse = "")) %>% 
+  enframe(name = "response", 
+          value = "model") %>% 
+  mutate(model = gsub("(?<=[\\s])\\s*|^\\s+|\\s+$", "", model, perl = TRUE),
+         model_type = sub("^([^\\(]+).*", "\\1", model),
+         formula = sub(".*formula = ([^,]+),.*", "\\1", model),
+         family = sub(".*family = ([^\\)]+\\)),.*", "\\1", model),
+         family = ifelse(model_type == "lm", "gaussian", family),
+         # if weights were used, they were reciprocal group variances
+         weights = ifelse(grepl("weights = ", model), 
+                          "reciprocal group variances", NA)) %>% 
+  dplyr::select(-model)
+
+# Results
+PHENO_WAT_STATS <- map(model_list, function(mod_i) {
+  terms_i <- attr(terms(mod_i), which = "term.labels")
+  by <- intersect("sex", terms_i)
+  
+  if (length(by) == 0) {
+    by <- NULL
+  }
+  
+  emmeans(mod_i, specs = "timepoint", by = by, 
+          infer = TRUE, adjust = "holm") %>% 
+    summary() %>% 
+    as.data.frame()
+}) %>%
+  enframe(name = "response") %>% 
+  unnest(value) %>%
+  mutate(signif = cut(p.value, 
+                      breaks = c(0, 0.001, 0.01, 0.05, 1),
+                      labels = c("***", "**", "*", ""),
+                      include.lowest = TRUE, right = FALSE,
+                      ordered_result = TRUE)) %>% 
+  relocate(p.value, .before = signif) %>% 
+  left_join(model_df, by = "response") %>% 
+  pivot_longer(cols = contains(".ratio"), 
+               names_to = "statistic_type", 
+               values_to = "statistic", 
+               values_drop_na = TRUE) %>% 
+  relocate(starts_with("statistic"), .before = p.value)
+

See ?PHENO_WAT_STATS for details.

+
+print.data.frame(head(PHENO_WAT_STATS))
+#>     response timepoint    sex    emmean       SE df    lower.CL   upper.CL
+#> 1 NMR Weight       SED Female  22.58333 1.897440 30  17.7719163  27.394750
+#> 2 NMR Weight        4W Female   5.65000 2.414781 30  -0.4732603  11.773260
+#> 3 NMR Weight        8W Female  10.03333 2.518818 30   3.6462616  16.420405
+#> 4 NMR Weight       SED   Male  17.20000 8.306985 30  -3.8643675  38.264368
+#> 5 NMR Weight        4W   Male  -8.85000 6.333443 30 -24.9099749   7.209975
+#> 6 NMR Weight        8W   Male -17.66667 1.390603 30 -21.1928775 -14.140456
+#>   statistic_type  statistic      p.value signif model_type
+#> 1        t.ratio  11.902003 2.054156e-12    ***         lm
+#> 2        t.ratio   2.339757 2.614292e-02      *         lm
+#> 3        t.ratio   3.983350 7.994337e-04    ***         lm
+#> 4        t.ratio   2.070547 9.420456e-02                lm
+#> 5        t.ratio  -1.397344 1.725599e-01                lm
+#> 6        t.ratio -12.704317 3.972948e-13    ***         lm
+#>                                         formula   family
+#> 1 I(post_weight - pre_weight) ~ sex * timepoint gaussian
+#> 2 I(post_weight - pre_weight) ~ sex * timepoint gaussian
+#> 3 I(post_weight - pre_weight) ~ sex * timepoint gaussian
+#> 4 I(post_weight - pre_weight) ~ sex * timepoint gaussian
+#> 5 I(post_weight - pre_weight) ~ sex * timepoint gaussian
+#> 6 I(post_weight - pre_weight) ~ sex * timepoint gaussian
+#>                      weights
+#> 1 reciprocal group variances
+#> 2 reciprocal group variances
+#> 3 reciprocal group variances
+#> 4 reciprocal group variances
+#> 5 reciprocal group variances
+#> 6 reciprocal group variances
+
+
+

Session Info +

+
+sessionInfo()
+#> R version 4.3.3 (2024-02-29)
+#> Platform: x86_64-pc-linux-gnu (64-bit)
+#> Running under: Ubuntu 22.04.4 LTS
+#> 
+#> Matrix products: default
+#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
+#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
+#> 
+#> locale:
+#>  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
+#>  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
+#>  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
+#> [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
+#> 
+#> time zone: UTC
+#> tzcode source: system (glibc)
+#> 
+#> attached base packages:
+#> [1] stats     graphics  grDevices utils     datasets  methods   base     
+#> 
+#> other attached packages:
+#> [1] purrr_1.0.2                        tidyr_1.3.1                       
+#> [3] tibble_3.2.1                       emmeans_1.10.0                    
+#> [5] dplyr_1.1.4                        ggplot2_3.5.0                     
+#> [7] MotrpacRatTraining6moWATData_2.0.0
+#> 
+#> loaded via a namespace (and not attached):
+#>  [1] gtable_0.3.4      jsonlite_1.8.8    highr_0.10        compiler_4.3.3   
+#>  [5] tidyselect_1.2.0  stringr_1.5.1     jquerylib_0.1.4   systemfonts_1.0.5
+#>  [9] scales_1.3.0      textshaping_0.3.7 yaml_2.3.8        fastmap_1.1.1    
+#> [13] R6_2.5.1          labeling_0.4.3    generics_0.1.3    knitr_1.45       
+#> [17] desc_1.4.3        munsell_0.5.0     bslib_0.6.1       pillar_1.9.0     
+#> [21] rlang_1.1.3       utf8_1.2.4        cachem_1.0.8      stringi_1.8.3    
+#> [25] xfun_0.42         fs_1.6.3          sass_0.4.8        estimability_1.5 
+#> [29] memoise_2.0.1     cli_3.6.2         withr_3.0.0       pkgdown_2.0.7    
+#> [33] magrittr_2.0.3    digest_0.6.34     grid_4.3.3        mvtnorm_1.2-4    
+#> [37] lifecycle_1.0.4   vctrs_0.6.5       evaluate_0.23     glue_1.7.0       
+#> [41] farver_2.1.1      ragg_1.2.7        fansi_1.0.6       colorspace_2.1-0 
+#> [45] rmarkdown_2.25    pkgconfig_2.0.3   tools_4.3.3       htmltools_0.5.7
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-11-1.png b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-11-1.png new file mode 100644 index 0000000..f7b84a7 Binary files /dev/null and b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-11-1.png differ diff --git a/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-12-1.png b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-12-1.png new file mode 100644 index 0000000..de1266a Binary files /dev/null and b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-12-1.png differ diff --git a/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-13-1.png b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-13-1.png new file mode 100644 index 0000000..352bfbe Binary files /dev/null and b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-13-1.png differ diff --git a/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-16-1.png b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-16-1.png new file mode 100644 index 0000000..dd4eece Binary files /dev/null and b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-16-1.png differ diff --git a/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-17-1.png b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-17-1.png new file mode 100644 index 0000000..a987d3a Binary files /dev/null and b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-17-1.png differ diff --git a/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-18-1.png b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-18-1.png new file mode 100644 index 0000000..c2c4234 Binary files /dev/null and b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-18-1.png differ diff --git a/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-21-1.png b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-21-1.png new file mode 100644 index 0000000..0803e48 Binary files /dev/null and b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-21-1.png differ diff --git a/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-23-1.png b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-23-1.png new file mode 100644 index 0000000..18d6fda Binary files /dev/null and b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-23-1.png differ diff --git a/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-24-1.png b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-24-1.png new file mode 100644 index 0000000..4e0aef7 Binary files /dev/null and b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-24-1.png differ diff --git a/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-26-1.png b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-26-1.png new file mode 100644 index 0000000..b2a8741 Binary files /dev/null and b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-26-1.png differ diff --git a/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-3-1.png b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..b242353 Binary files /dev/null and b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-4-1.png b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-4-1.png new file mode 100644 index 0000000..cdda8f5 Binary files /dev/null and b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-7-1.png b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-7-1.png new file mode 100644 index 0000000..eec82e9 Binary files /dev/null and b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-8-1.png b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-8-1.png new file mode 100644 index 0000000..7b852a6 Binary files /dev/null and b/articles/PHENO_WAT_STATS_files/figure-html/unnamed-chunk-8-1.png differ diff --git a/articles/PHOSPHO_KSEA.html b/articles/PHOSPHO_KSEA.html new file mode 100644 index 0000000..07e6a3c --- /dev/null +++ b/articles/PHOSPHO_KSEA.html @@ -0,0 +1,474 @@ + + + + + + + +Kinase-Substrate Enrichment Analysis • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + + +
+# Reformat DEA results
+human_res <- PHOSPHO_DA %>%
+  map(function(res_i) {
+    filter(res_i, !is.na(human_uniprot)) %>%
+      mutate(num_sites = str_count(human_site, ";") + 1) %>%
+      separate_rows(human_site) %>% # single-site-level data
+      mutate(human_feature = paste0(human_uniprot, "_", human_site)) %>%
+      dplyr::select(contrast, human_feature, logFC, P.Value, num_sites) %>%
+      distinct()
+  })
+
+map(human_res, head)
+#> $trained_vs_SED
+#> # A tibble: 6 × 5
+#>   contrast     human_feature   logFC P.Value num_sites
+#>   <fct>        <chr>           <dbl>   <dbl>     <dbl>
+#> 1 F_1W - F_SED Q9UHL9_S448   -0.105    0.669         1
+#> 2 F_1W - F_SED P02545_S12     0.189    0.344         1
+#> 3 F_1W - F_SED P02545_S143    0.157    0.448         1
+#> 4 F_1W - F_SED P02545_S153   -0.0221   0.937         1
+#> 5 F_1W - F_SED P02545_S17     0.0838   0.607         1
+#> 6 F_1W - F_SED P02545_S18    -0.0247   0.834         1
+#> 
+#> $MvF_SED
+#> # A tibble: 6 × 5
+#>   contrast      human_feature   logFC P.Value num_sites
+#>   <fct>         <chr>           <dbl>   <dbl>     <dbl>
+#> 1 M_SED - F_SED Q9UHL9_S448   -0.123  0.657           1
+#> 2 M_SED - F_SED P02545_S12     0.193  0.378           1
+#> 3 M_SED - F_SED P02545_S143   -0.789  0.00131         1
+#> 4 M_SED - F_SED P02545_S153   -0.0890 0.800           1
+#> 5 M_SED - F_SED P02545_S17    -0.366  0.0401          1
+#> 6 M_SED - F_SED P02545_S18    -0.161  0.216           1
+#> 
+#> $MvF_exercise_response
+#> # A tibble: 6 × 5
+#>   contrast                        human_feature   logFC P.Value num_sites
+#>   <fct>                           <chr>           <dbl>   <dbl>     <dbl>
+#> 1 (M_1W - M_SED) - (F_1W - F_SED) Q9UHL9_S448    0.289    0.474         1
+#> 2 (M_1W - M_SED) - (F_1W - F_SED) P02545_S12    -0.339    0.264         1
+#> 3 (M_1W - M_SED) - (F_1W - F_SED) P02545_S143    0.130    0.689         1
+#> 4 (M_1W - M_SED) - (F_1W - F_SED) P02545_S153   -0.355    0.431         1
+#> 5 (M_1W - M_SED) - (F_1W - F_SED) P02545_S17    -0.0562   0.817         1
+#> 6 (M_1W - M_SED) - (F_1W - F_SED) P02545_S18    -0.0172   0.923         1
+
+# List of substrate sites by kinase (379 kinases before filtering)
+KS_sets <- PSP_KINASE_SUBSTRATE %>%
+  transmute(kinase = GENE,
+            substrate = paste0(SUB_ACC_ID, "_", SUB_MOD_RSD)) %>%
+  # Filter to what is in the DEA results
+  filter(substrate %in% human_res$MvF_SED$human_feature) %>%
+  group_by(kinase) %>%
+  summarise(substrate = list(substrate)) %>%
+  deframe()
+head(KS_sets)
+#> $AAK1
+#> [1] "Q96CW1_T156"
+#> 
+#> $ABL1
+#> [1] "P49023_Y118" "P46109_Y207" "Q03135_Y14"  "Q14498_Y95"  "P16333_Y105"
+#> [6] "P46108_Y251" "P52566_Y130"
+#> 
+#> $AKT1
+#>  [1] "O60343_S318"  "Q2PPJ7_T715"  "P19634_S703"  "Q8TDN4_T415"  "P62136_T320" 
+#>  [6] "P98177_S262"  "P08727_S35"   "Q9Y3M2_S20"   "P53396_S455"  "O60825_S466" 
+#> [11] "Q07352_S92"   "Q14315_S2233" "P98177_T32"   "Q13131_S496"  "P04150_S134" 
+#> [16] "P14618_S97"   "Q53EL6_S457"  "P26373_S106"  "Q96F86_S161"  "Q99623_S91"  
+#> [21] "Q9UBP6_S27"   "P49815_S981"  "Q12778_S256"  "P53396_T447"  "O60343_S570" 
+#> [26] "P46937_S127"  "P45985_S80"   "Q96QB1_S766"  "Q16875_S461"  "Q12778_T24"  
+#> [31] "P26358_S143"  "Q92934_S99"   "O60825_S483"  "Q9BZQ8_S602"  "P09651_S199" 
+#> [36] "P42858_S419"  "P49840_S21"   "P04792_S82"   "O15151_S367"  "Q7Z5H3_S16"  
+#> [41] "P02545_S404"  "Q3V6T2_S1417" "Q13045_S436"  "P19634_S796"  "Q9UN36_T348" 
+#> [46] "P29474_S1177" "P49815_S939"  "P49841_S9"    "Q9UN36_S332"  "Q9H6Z4_S126" 
+#> [51] "Q96B36_T246"  "Q5XUX0_S33"   "O43524_T32"   "O60343_S341"  "P98177_S197" 
+#> [56] "Q12778_S319"  "P15056_S365"  "P62753_S236"  "Q9P0V3_S246"  "O00429_S616" 
+#> [61] "P54253_S775"  "Q9BRS8_S451"  "P14618_S202"  "P21333_S2152" "O60343_T642" 
+#> [66] "P08670_S39"   "P20749_S41"   "O60343_S588"  "P46527_S10"   "Q96QB1_S1004"
+#> [71] "Q9UNN5_S582"  "Q2PPJ7_S486"  "O60331_S555"  "P35222_S552"  "P02545_S301" 
+#> [76] "Q9Y4P1_S34"   "Q8WX93_S1118" "Q9Y2I7_S307"  "Q7Z6J0_S304"  "O43524_S253" 
+#> [81] "P05787_S432"  "Q7Z589_S209"  "Q15121_S116" 
+#> 
+#> $AKT2
+#>  [1] "Q9Y3M2_S20"   "Q14315_S2233" "Q96F86_S161"  "Q04656_S1466" "Q99623_S91"  
+#>  [6] "Q9Y4H2_S306"  "O60331_S555"  "P35222_S552"  "Q9Y4H2_S577"  "Q7Z6J0_S304" 
+#> 
+#> $AKT3
+#> [1] "Q9UKV8_S387" "P15056_S365" "Q7Z589_S209"
+#> 
+#> $ALK
+#> [1] "P40763_Y705" "P50552_Y39"  "Q06124_Y542"
+
+# How many substrates are in PSP?
+table(unique(human_res$MvF_SED$human_feature) %in% unlist(KS_sets))
+#> 
+#> FALSE  TRUE 
+#> 18019  1118
+# FALSE  TRUE
+# 18019  1118
+

Only about 5.8% of the substrates in the phosphoproteomics data are +in PhosphoSitePlus.

+
+# How many will pass the size filter?
+KS_sets <- KS_sets[lengths(KS_sets) >= 3]
+length(KS_sets) # 121 kinases
+#> [1] 121
+
+# Removing small kinase sets drops some substrate sites
+table(unique(human_res$MvF_SED$human_feature) %in% unlist(KS_sets))
+#> 
+#> FALSE  TRUE 
+#> 18063  1074
+# FALSE  TRUE
+# 18063  1074
+
+## Conversion vectors for KSEA leadingEdge
+# Uniprot to gene symbol sites
+human_uniprot_to_symbol <- PSP_KINASE_SUBSTRATE %>%
+  transmute(across(c(SUB_ACC_ID, SUB_GENE),
+                   ~ paste0(.x, "_", SUB_MOD_RSD))) %>%
+  distinct() %>%
+  deframe()
+head(human_uniprot_to_symbol)
+#>    P05198_S52    P05198_S49   Q9UQL6_S259 P18433-2_S204    P10415_S70 
+#>  "EIF2S1_S52"  "EIF2S1_S49"  "HDAC5_S259"  "PTPRA_S204"    "BCL2_S70" 
+#>   P61978_S302 
+#> "HNRNPK_S302"
+
+# Map human to rat sites (single-site level)
+human_to_rat <- fData(PHOSPHO_EXP) %>%
+  filter(!is.na(human_uniprot)) %>%
+  separate_rows(site, human_site, sep = ";") %>%
+  transmute(human = paste0(human_uniprot, "_", human_site),
+            rat = paste0(gene_symbol, "_", site)) %>%
+  distinct() %>%
+  deframe()
+head(human_to_rat)
+#>     Q9UHL9_S448      P02545_S12     P02545_S143     P02545_S153      P02545_S17 
+#> "Gtf2ird1_S448"      "Lmna_S12"     "Lmna_S143"     "Lmna_S153"      "Lmna_S17" 
+#>      P02545_S18 
+#>      "Lmna_S18"
+
+# KSEA
+PHOSPHO_KSEA <- map(human_res, function(res_i)
+{
+  rank_list <- rank_genes(res_i, genes = "human_feature")
+
+  map(names(rank_list), function(contr_i) {
+    set.seed(0)
+    fgseaMultilevel(pathways = KS_sets,
+                    stats = rank_list[[contr_i]],
+                    minSize = 3,
+                    nproc = 1, nPermSimple = 10000) %>%
+      mutate(contrast = contr_i)
+  }) %>%
+    rbindlist() %>%
+    mutate(padj = p.adjust(pval, method = "BH"),
+           contrast = factor(contrast, levels = unique(contrast)),
+           gs_subcat = "kinase",
+           leadingEdge_symbol = map(.x = leadingEdge,
+                                    .f = ~ human_uniprot_to_symbol[.x]),
+           leadingEdge_rno = map(.x = leadingEdge,
+                                 .f = ~ human_to_rat[.x])) %>%
+    dplyr::rename(kinase = pathway) %>%
+    relocate(contrast, .before = leadingEdge) %>%
+    dplyr::select(-gs_subcat)
+})
+
+# Save
+usethis::use_data(PHOSPHO_KSEA, internal = FALSE,
+                  overwrite = TRUE, version = 3, compress = "bzip2")
+
+

Session Info +

+
+sessionInfo()
+#> R version 4.3.3 (2024-02-29)
+#> Platform: x86_64-pc-linux-gnu (64-bit)
+#> Running under: Ubuntu 22.04.4 LTS
+#> 
+#> Matrix products: default
+#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
+#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
+#> 
+#> locale:
+#>  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
+#>  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
+#>  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
+#> [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
+#> 
+#> time zone: UTC
+#> tzcode source: system (glibc)
+#> 
+#> attached base packages:
+#> [1] stats     graphics  grDevices utils     datasets  methods   base     
+#> 
+#> other attached packages:
+#>  [1] fgsea_1.28.0                       data.table_1.15.2                 
+#>  [3] stringr_1.5.1                      purrr_1.0.2                       
+#>  [5] tibble_3.2.1                       tidyr_1.3.1                       
+#>  [7] dplyr_1.1.4                        MotrpacRatTraining6moWAT_1.0.0    
+#>  [9] Biobase_2.62.0                     BiocGenerics_0.48.1               
+#> [11] MotrpacRatTraining6moWATData_2.0.0
+#> 
+#> loaded via a namespace (and not attached):
+#>   [1] RColorBrewer_1.1-3      rstudioapi_0.15.0       jsonlite_1.8.8         
+#>   [4] shape_1.4.6.1           magrittr_2.0.3          ggbeeswarm_0.7.2       
+#>   [7] rmarkdown_2.25          GlobalOptions_0.1.2     fs_1.6.3               
+#>  [10] zlibbioc_1.48.0         ragg_1.2.7              vctrs_0.6.5            
+#>  [13] memoise_2.0.1           RCurl_1.98-1.14         base64enc_0.1-3        
+#>  [16] rstatix_0.7.2           htmltools_0.5.7         dynamicTreeCut_1.63-1  
+#>  [19] curl_5.2.1              broom_1.0.5             Formula_1.2-5          
+#>  [22] sass_0.4.8              bslib_0.6.1             htmlwidgets_1.6.4      
+#>  [25] desc_1.4.3              impute_1.76.0           cachem_1.0.8           
+#>  [28] lifecycle_1.0.4         iterators_1.0.14        pkgconfig_2.0.3        
+#>  [31] Matrix_1.6-5            R6_2.5.1                fastmap_1.1.1          
+#>  [34] GenomeInfoDbData_1.2.11 clue_0.3-65             digest_0.6.34          
+#>  [37] colorspace_2.1-0        patchwork_1.2.0         AnnotationDbi_1.64.1   
+#>  [40] S4Vectors_0.40.2        textshaping_0.3.7       Hmisc_5.1-1            
+#>  [43] RSQLite_2.3.5           ggpubr_0.6.0            filelock_1.0.3         
+#>  [46] latex2exp_0.9.6         fansi_1.0.6             httr_1.4.7             
+#>  [49] abind_1.4-5             compiler_4.3.3          withr_3.0.0            
+#>  [52] bit64_4.0.5             doParallel_1.0.17       htmlTable_2.4.2        
+#>  [55] backports_1.4.1         BiocParallel_1.36.0     carData_3.0-5          
+#>  [58] DBI_1.2.2               ggsignif_0.6.4          rjson_0.2.21           
+#>  [61] tools_4.3.3             vipor_0.4.7             foreign_0.8-86         
+#>  [64] beeswarm_0.4.0          msigdbr_7.5.1           nnet_7.3-19            
+#>  [67] glue_1.7.0              grid_4.3.3              checkmate_2.3.1        
+#>  [70] cluster_2.1.6           generics_0.1.3          gtable_0.3.4           
+#>  [73] preprocessCore_1.64.0   WGCNA_1.72-5            car_3.1-2              
+#>  [76] utf8_1.2.4              XVector_0.42.0          foreach_1.5.2          
+#>  [79] pillar_1.9.0            babelgene_22.9          limma_3.58.1           
+#>  [82] circlize_0.4.16         splines_4.3.3           BiocFileCache_2.10.1   
+#>  [85] lattice_0.22-5          survival_3.5-8          bit_4.0.5              
+#>  [88] tidyselect_1.2.0        GO.db_3.18.0            ComplexHeatmap_2.18.0  
+#>  [91] locfit_1.5-9.9          Biostrings_2.70.2       knitr_1.45             
+#>  [94] gridExtra_2.3           IRanges_2.36.0          edgeR_4.0.16           
+#>  [97] stats4_4.3.3            xfun_0.42               statmod_1.5.0          
+#> [100] matrixStats_1.2.0       stringi_1.8.3           yaml_2.3.8             
+#> [103] evaluate_0.23           codetools_0.2-19        cli_3.6.2              
+#> [106] ontologyIndex_2.12      rpart_4.1.23            systemfonts_1.0.5      
+#> [109] munsell_0.5.0           jquerylib_0.1.4         Rcpp_1.0.12            
+#> [112] GenomeInfoDb_1.38.6     dbplyr_2.4.0            png_0.1-8              
+#> [115] fastcluster_1.2.6       parallel_4.3.3          pkgdown_2.0.7          
+#> [118] ggplot2_3.5.0           blob_1.2.4              bitops_1.0-7           
+#> [121] scales_1.3.0            crayon_1.5.2            GetoptLong_1.0.5       
+#> [124] rlang_1.1.3             cowplot_1.1.3           fastmatch_1.1-4        
+#> [127] KEGGREST_1.42.0
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/PROT_MITOCARTA_FGSEA.html b/articles/PROT_MITOCARTA_FGSEA.html new file mode 100644 index 0000000..d7e5913 --- /dev/null +++ b/articles/PROT_MITOCARTA_FGSEA.html @@ -0,0 +1,382 @@ + + + + + + + +Proteomics MitoCarta FGSEA • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +
+library(MotrpacRatTraining6moData)
+library(MotrpacRatTraining6moWATData)
+library(MotrpacRatTraining6moWAT)
+#> Loading required package: Biobase
+#> Loading required package: BiocGenerics
+#> 
+#> Attaching package: 'BiocGenerics'
+#> The following objects are masked from 'package:stats':
+#> 
+#>     IQR, mad, sd, var, xtabs
+#> The following objects are masked from 'package:base':
+#> 
+#>     anyDuplicated, aperm, append, as.data.frame, basename, cbind,
+#>     colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
+#>     get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
+#>     match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
+#>     Position, rank, rbind, Reduce, rownames, sapply, setdiff, sort,
+#>     table, tapply, union, unique, unsplit, which.max, which.min
+#> Welcome to Bioconductor
+#> 
+#>     Vignettes contain introductory material; view with
+#>     'browseVignettes()'. To cite Bioconductor, see
+#>     'citation("Biobase")', and for packages 'citation("pkgname")'.
+#> 
+library(dplyr)
+#> 
+#> Attaching package: 'dplyr'
+#> The following object is masked from 'package:Biobase':
+#> 
+#>     combine
+#> The following objects are masked from 'package:BiocGenerics':
+#> 
+#>     combine, intersect, setdiff, union
+#> The following objects are masked from 'package:stats':
+#> 
+#>     filter, lag
+#> The following objects are masked from 'package:base':
+#> 
+#>     intersect, setdiff, setequal, union
+library(tidyr)
+library(tibble)
+library(purrr)
+library(fgsea)
+
+# Entrez to gene symbol conversion vector for leading edge
+entrez_to_symbol <- pluck(PROT_DA, "MvF_SED") %>%
+  filter(!is.na(entrez_gene)) %>%
+  dplyr::select(entrez_gene, gene_symbol) %>%
+  deframe()
+head(entrez_to_symbol)
+#>     26194     26195     26198     26196     26204     26199 
+#>  "Mt-nd2"  "Mt-co1"  "Mt-co2" "Mt-atp8"  "Mt-co3"  "Mt-nd3"
+
+# Human to rat gene conversion
+human_to_rat <- RAT_TO_HUMAN_GENE %>%
+  dplyr::select(HUMAN_ORTHOLOG_SYMBOL, RAT_NCBI_GENE_ID) %>%
+  distinct() %>%
+  deframe()
+head(human_to_rat)
+#>   A1BG   NAT2    ADA   CDH2   AKT3   MED6 
+#> 140656 116632  24165  83501  29414 299180
+
+# Convert human gene symbols to rat Entrez IDs
+PROT_MITOCARTA <- MITOCARTA_HS %>%
+  mutate(rat_entrez = map(human_genes,
+                          ~ as.character(na.omit(human_to_rat[.x]))),
+         set_size = lengths(rat_entrez),
+         rat_entrez = map(rat_entrez, intersect, names(entrez_to_symbol)),
+         set_size_post = lengths(rat_entrez),
+         ratio = set_size_post / set_size) %>%
+  filter(ratio >= 0.85,
+         set_size <= 300, # Same as MSIGDB_PATHWAYS filter
+         set_size_post >= 5)
+
+# List of pathways to test
+MITOCARTA_PATHWAYS <- PROT_MITOCARTA %>%
+  dplyr::select(pathway, rat_entrez) %>%
+  deframe()
+length(MITOCARTA_PATHWAYS) # 68
+#> [1] 68
+head(MITOCARTA_PATHWAYS)
+#> $`mt-tRNA modifications`
+#>  [1] "362766" "252827" "291978" "290633" "63864"  "300852" "361191" "314548"
+#>  [9] "304567" "64016"  "315550" "303067" "362586" "288914" "304012" "362754"
+#> [17] "362976" "312616" "319113"
+#> 
+#> $`mt-rRNA modifications`
+#>  [1] "295985" "305845" "502632" "304323" "360569" "307050" "499191" "298426"
+#>  [9] "360796" "362416" "315550" "308140" "362586" "366012"
+#> 
+#> $Translation
+#>   [1] "301254"    "498179"    "361184"    "361005"    "498000"    "681219"   
+#>   [7] "295238"    "304919"    "367172"    "361641"    "362759"    "306879"   
+#>  [13] "301463"    "288916"    "297113"    "361974"    "360821"    "114017"   
+#>  [19] "294672"    "305256"    "312054"    "305317"    "307491"    "364070"   
+#>  [25] "292028"    "363172"    "313867"    "297082"    "311748"    "305845"   
+#>  [31] "315141"    "304323"    "360569"    "289491"    "691075"    "293666"   
+#>  [37] "303746"    "299938"    "301250"    "297799"    "293754"    "171061"   
+#>  [43] "292244"    "297372"    "301240"    "680747"    "309140"    "287302"   
+#>  [49] "64360"     "295224"    "287635"    "497876"    "300974"    "301352"   
+#>  [55] "291206"    "100363539" "290632"    "56281"     "303685"    "684304"   
+#>  [61] "363023"    "287962"    "296551"    "299743"    "309440"    "301552"   
+#>  [67] "287656"    "293054"    "294963"    "293149"    "309176"    "362517"   
+#>  [73] "297601"    "361037"    "362388"    "299628"    "287356"    "691814"   
+#>  [79] "303673"    "310653"    "363187"    "499185"    "292758"    "289143"   
+#>  [85] "298517"    "688912"    "288621"    "301249"    "294230"    "289469"   
+#>  [91] "362094"    "689432"    "683519"    "360594"    "498406"    "297459"   
+#>  [97] "362216"    "361883"    "689025"    "294767"    "290850"    "296995"   
+#> [103] "287126"    "297727"    "294696"    "296134"    "100360017" "113958"   
+#> [109] "301371"    "311903"    "363289"    "100910751" "296462"    "305606"   
+#> [115] "684274"    "683897"    "686234"    "361473"    "293128"    "499191"   
+#> [121] "298426"    "691393"    "313429"    "690214"    "310856"    "500199"   
+#> [127] "362681"    "309911"    "297969"    "307235"    "292268"    "292759"   
+#> [133] "688717"    "360645"    "310672"    "308140"    "307210"    "679068"   
+#> [139] "293481"    "309596"    "690654"    "287924"   
+#> 
+#> $`Mitochondrial ribosome`
+#>  [1] "361005"    "295238"    "288916"    "289491"    "691075"    "293666"   
+#>  [7] "303746"    "299938"    "301250"    "297799"    "293754"    "171061"   
+#> [13] "292244"    "297372"    "301240"    "680747"    "309140"    "287302"   
+#> [19] "64360"     "295224"    "287635"    "497876"    "300974"    "301352"   
+#> [25] "291206"    "100363539" "290632"    "56281"     "303685"    "684304"   
+#> [31] "363023"    "287962"    "296551"    "299743"    "309440"    "301552"   
+#> [37] "287656"    "293054"    "294963"    "293149"    "309176"    "362517"   
+#> [43] "297601"    "361037"    "362388"    "299628"    "287356"    "691814"   
+#> [49] "303673"    "310653"    "363187"    "499185"    "292758"    "289143"   
+#> [55] "298517"    "688912"    "288621"    "301249"    "294230"    "289469"   
+#> [61] "362094"    "689432"    "683519"    "360594"    "498406"    "297459"   
+#> [67] "362216"    "361883"    "689025"    "294767"    "290850"    "296995"   
+#> [73] "287126"    "297727"    "294696"    "296134"    "100360017" "113958"   
+#> [79] "301371"    "500199"   
+#> 
+#> $`Translation factors`
+#>  [1] "498179" "498000" "681219" "114017" "294672" "303673" "311903" "305606"
+#>  [9] "684274" "686234" "361473" "360645" "307210" "679068" "293481"
+#> 
+#> $`mt-tRNA synthetases`
+#>  [1] "301254" "361184" "304919" "361641" "306879" "297113" "361974" "360821"
+#>  [9] "307491" "364070" "292028" "363172" "293128" "313429" "309911" "297969"
+#> [17] "292759" "310672" "309596" "690654" "287924"
+
+## FGSEA
+PROT_MITOCARTA_FGSEA <- map(PROT_DA, function(res_i) {
+  stats <- rank_genes(res_i, genes = "entrez_gene")
+
+  map(names(stats), function(contrast_i) {
+    message(contrast_i)
+    set.seed(0)
+    fgseaMultilevel(pathways = MITOCARTA_PATHWAYS,
+                    stats = stats[[contrast_i]],
+                    nPermSimple = 10000, nproc = 1) %>%
+      mutate(contrast = contrast_i)
+  }) %>%
+    data.table::rbindlist() %>%
+    mutate(contrast = factor(contrast, levels = unique(contrast)),
+           padj = p.adjust(pval, method = "BH"),
+           leadingEdge_genes = map(leadingEdge,
+                                   ~ na.omit(entrez_to_symbol[.x])),
+           leadingEdge = map(leadingEdge, as.numeric)) %>% # consistency
+    left_join(dplyr::select(PROT_MITOCARTA, pathway, hierarchy),
+              by = "pathway") %>%
+    relocate(hierarchy, .after = pathway) %>%
+    relocate(contrast, .before = leadingEdge)
+})
+
+# Save
+usethis::use_data(PROT_MITOCARTA_FGSEA, internal = FALSE,
+                  overwrite = TRUE, version = 3, compress = "bzip2")
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/WAT_DA.html b/articles/WAT_DA.html new file mode 100644 index 0000000..cff387d --- /dev/null +++ b/articles/WAT_DA.html @@ -0,0 +1,449 @@ + + + + + + + +Differential Analysis of Omics Datasets • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +
+

Overview +

+

We will use a wrapper around functions from the limma +package[1] to perform +differential analysis on several sets of contrasts. See +help("limma_full", package = "MotrpacRatTraining6moWAT") +for more details. Volcano plots are created in a separate article.

+ +
+

Contrasts to test +

+
+# Sex-specific training differences
+contr_train <- sprintf("%s_%s - %s_SED",
+                       rep(c("F", "M"), each = 4),
+                       rep(paste0(2^(0:3), "W"), times = 2),
+                       rep(c("F", "M"), each = 4))
+
+# Training-induced sexual dimorphism (sex by timepoint interaction)
+contr_diff <- sprintf("(%s) - (%s)",
+                      contr_train[5:8],
+                      contr_train[1:4])
+
+# List of contrast groups
+contr_list <- list("trained_vs_SED" = contr_train,
+                   "MvF_SED" = "M_SED - F_SED",
+                   "MvF_exercise_response" = contr_diff)
+contr_list
+
#> $trained_vs_SED
+#> [1] "F_1W - F_SED" "F_2W - F_SED" "F_4W - F_SED" "F_8W - F_SED" "M_1W - M_SED"
+#> [6] "M_2W - M_SED" "M_4W - M_SED" "M_8W - M_SED"
+#> 
+#> $MvF_SED
+#> [1] "M_SED - F_SED"
+#> 
+#> $MvF_exercise_response
+#> [1] "(M_1W - M_SED) - (F_1W - F_SED)" "(M_2W - M_SED) - (F_2W - F_SED)"
+#> [3] "(M_4W - M_SED) - (F_4W - F_SED)" "(M_8W - M_SED) - (F_8W - F_SED)"
+
+
+

Proteomics +

+
+PROT_DA <- map2(contr_list, c(TRUE, FALSE, FALSE), function(contrasts, plot) {
+  limma_full(object = PROT_EXP,
+             model.str = "~ 0 + exp_group",
+             coef.str = "exp_group",
+             contrasts = contrasts,
+             var.group = "viallabel",
+             plot = plot) %>%
+    arrange(contrast, feature) %>%
+    dplyr::select(-B)
+}, .progress = TRUE)
+

+
+
+

Phosphoproteomics +

+
+PHOSPHO_DA <- map2(
+  contr_list, c(TRUE, FALSE, FALSE), function(contrasts, plot) {
+    limma_full(object = PHOSPHO_EXP,
+               model.str = "~ 0 + exp_group",
+               coef.str = "exp_group",
+               contrasts = contrasts,
+               var.group = "vialLabel",
+               plot = plot) %>%
+      arrange(contrast, feature) %>%
+      dplyr::select(-B)
+  }, .progress = TRUE)
+

+
+
+

Transcriptomics +

+
+# Covariates included in https://doi.org/10.1101/2022.09.21.508770,
+# processed in the same way
+covariates <- "rin + pct_globin + pct_umi_dup + median_5_3_bias"
+
+TRNSCRPT_DA <- map2(
+  contr_list, c(TRUE, FALSE, FALSE), function(contrasts, plot) {
+    limma_full(object = TRNSCRPT_EXP,
+               model.str = sprintf("~ 0 + exp_group + %s", covariates),
+               coef.str = "exp_group",
+               contrasts = contrasts,
+               var.group = "viallabel",
+               plot = plot) %>%
+      arrange(contrast, feature) %>%
+      dplyr::select(-B)
+    # entrez_gene is of type character because of the one-to-many
+    # transcript to gene mapping. Keep this in mind.
+  })
+

+
+
+

Metabolomics +

+

We will run differential analysis separately for each platform and +then combine the results. This way, we can estimate separate +mean-variance trends for each platform.

+
+# Platforms for DEA
+assays <- unique(fData(METAB_EXP)[["dataset"]])
+
+# Differential analysis results list
+METAB_DA <- map(contr_list, function(contrasts) {
+  map(assays, function(assay) {
+    message(assay)
+    # subset to features in group to model separate mean-variance trends
+    METAB_EXP[fData(METAB_EXP)[["dataset"]] == assay, ] %>%
+      limma_full(model.str = "~ 0 + exp_group",
+                 coef.str = "exp_group",
+                 contrasts = contrasts,
+                 var.group = "vialLabel") %>%
+      arrange(contrast, feature) %>%
+      dplyr::select(-B)
+  }) %>%
+    data.table::rbindlist() %>%
+    mutate(contrast = factor(contrast, levels = unique(contrast)),
+           adj.P.Val = p.adjust(P.Value, method = "BH")) %>%
+    arrange(contrast, feature)
+})
+
+# Save results
+usethis::use_data(PROT_DA, internal = FALSE, overwrite = TRUE,
+                  version = 3, compress = "bzip2")
+
+usethis::use_data(PHOSPHO_DA, internal = FALSE, overwrite = TRUE,
+                  version = 3, compress = "bzip2")
+
+usethis::use_data(TRNSCRPT_DA, internal = FALSE, overwrite = TRUE,
+                  version = 3, compress = "bzip2")
+
+usethis::use_data(METAB_DA, internal = FALSE, overwrite = TRUE,
+                  version = 3, compress = "bzip2")
+
+
+
+

Session Info +

+ +
#> R version 4.3.3 (2024-02-29)
+#> Platform: x86_64-pc-linux-gnu (64-bit)
+#> Running under: Ubuntu 22.04.4 LTS
+#> 
+#> Matrix products: default
+#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
+#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
+#> 
+#> locale:
+#>  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
+#>  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
+#>  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
+#> [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
+#> 
+#> time zone: UTC
+#> tzcode source: system (glibc)
+#> 
+#> attached base packages:
+#> [1] stats     graphics  grDevices utils     datasets  methods   base     
+#> 
+#> other attached packages:
+#> [1] purrr_1.0.2                        dplyr_1.1.4                       
+#> [3] MotrpacRatTraining6moWAT_1.0.0     Biobase_2.62.0                    
+#> [5] BiocGenerics_0.48.1                MotrpacRatTraining6moWATData_2.0.0
+#> 
+#> loaded via a namespace (and not attached):
+#>   [1] RColorBrewer_1.1-3      rstudioapi_0.15.0       jsonlite_1.8.8         
+#>   [4] shape_1.4.6.1           magrittr_2.0.3          ggbeeswarm_0.7.2       
+#>   [7] rmarkdown_2.25          GlobalOptions_0.1.2     fs_1.6.3               
+#>  [10] zlibbioc_1.48.0         ragg_1.2.7              vctrs_0.6.5            
+#>  [13] memoise_2.0.1           RCurl_1.98-1.14         base64enc_0.1-3        
+#>  [16] rstatix_0.7.2           htmltools_0.5.7         dynamicTreeCut_1.63-1  
+#>  [19] curl_5.2.1              broom_1.0.5             Formula_1.2-5          
+#>  [22] sass_0.4.8              bslib_0.6.1             htmlwidgets_1.6.4      
+#>  [25] desc_1.4.3              impute_1.76.0           cachem_1.0.8           
+#>  [28] lifecycle_1.0.4         iterators_1.0.14        pkgconfig_2.0.3        
+#>  [31] Matrix_1.6-5            R6_2.5.1                fastmap_1.1.1          
+#>  [34] GenomeInfoDbData_1.2.11 clue_0.3-65             digest_0.6.34          
+#>  [37] colorspace_2.1-0        patchwork_1.2.0         AnnotationDbi_1.64.1   
+#>  [40] S4Vectors_0.40.2        textshaping_0.3.7       Hmisc_5.1-1            
+#>  [43] RSQLite_2.3.5           ggpubr_0.6.0            filelock_1.0.3         
+#>  [46] latex2exp_0.9.6         fansi_1.0.6             httr_1.4.7             
+#>  [49] abind_1.4-5             compiler_4.3.3          withr_3.0.0            
+#>  [52] bit64_4.0.5             doParallel_1.0.17       htmlTable_2.4.2        
+#>  [55] backports_1.4.1         BiocParallel_1.36.0     carData_3.0-5          
+#>  [58] DBI_1.2.2               highr_0.10              ggsignif_0.6.4         
+#>  [61] rjson_0.2.21            tools_4.3.3             vipor_0.4.7            
+#>  [64] foreign_0.8-86          beeswarm_0.4.0          msigdbr_7.5.1          
+#>  [67] nnet_7.3-19             glue_1.7.0              grid_4.3.3             
+#>  [70] checkmate_2.3.1         cluster_2.1.6           fgsea_1.28.0           
+#>  [73] generics_0.1.3          gtable_0.3.4            preprocessCore_1.64.0  
+#>  [76] tidyr_1.3.1             data.table_1.15.2       WGCNA_1.72-5           
+#>  [79] car_3.1-2               utf8_1.2.4              XVector_0.42.0         
+#>  [82] foreach_1.5.2           pillar_1.9.0            stringr_1.5.1          
+#>  [85] babelgene_22.9          limma_3.58.1            circlize_0.4.16        
+#>  [88] splines_4.3.3           BiocFileCache_2.10.1    lattice_0.22-5         
+#>  [91] survival_3.5-8          bit_4.0.5               tidyselect_1.2.0       
+#>  [94] GO.db_3.18.0            ComplexHeatmap_2.18.0   locfit_1.5-9.9         
+#>  [97] Biostrings_2.70.2       knitr_1.45              gridExtra_2.3          
+#> [100] IRanges_2.36.0          edgeR_4.0.16            stats4_4.3.3           
+#> [103] xfun_0.42               statmod_1.5.0           matrixStats_1.2.0      
+#> [106] stringi_1.8.3           yaml_2.3.8              evaluate_0.23          
+#> [109] codetools_0.2-19        tibble_3.2.1            cli_3.6.2              
+#> [112] ontologyIndex_2.12      rpart_4.1.23            systemfonts_1.0.5      
+#> [115] munsell_0.5.0           jquerylib_0.1.4         Rcpp_1.0.12            
+#> [118] GenomeInfoDb_1.38.6     dbplyr_2.4.0            png_0.1-8              
+#> [121] fastcluster_1.2.6       parallel_4.3.3          pkgdown_2.0.7          
+#> [124] ggplot2_3.5.0           blob_1.2.4              bitops_1.0-7           
+#> [127] scales_1.3.0            crayon_1.5.2            GetoptLong_1.0.5       
+#> [130] rlang_1.1.3             cowplot_1.1.3           fastmatch_1.1-4        
+#> [133] KEGGREST_1.42.0
+
+
+

References +

+
+
+1. Ritchie, M. E., Phipson, B., Wu, D., Hu, Y., Law, C. W., Shi, W., +& Smyth, G. K. (2015). limma powers +differential expression analyses for RNA-sequencing and +microarray studies. Nucleic Acids Research, 43(7), +e47. https://doi.org/10.1093/nar/gkv007 +
+
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/WAT_DA_files/figure-html/phospho-DA-1.png b/articles/WAT_DA_files/figure-html/phospho-DA-1.png new file mode 100644 index 0000000..fde35a1 Binary files /dev/null and b/articles/WAT_DA_files/figure-html/phospho-DA-1.png differ diff --git a/articles/WAT_DA_files/figure-html/phospho-DA-2.png b/articles/WAT_DA_files/figure-html/phospho-DA-2.png new file mode 100644 index 0000000..a2417aa Binary files /dev/null and b/articles/WAT_DA_files/figure-html/phospho-DA-2.png differ diff --git a/articles/WAT_DA_files/figure-html/prot-DA-1.png b/articles/WAT_DA_files/figure-html/prot-DA-1.png new file mode 100644 index 0000000..1d23afe Binary files /dev/null and b/articles/WAT_DA_files/figure-html/prot-DA-1.png differ diff --git a/articles/WAT_DA_files/figure-html/prot-DA-2.png b/articles/WAT_DA_files/figure-html/prot-DA-2.png new file mode 100644 index 0000000..031e6fa Binary files /dev/null and b/articles/WAT_DA_files/figure-html/prot-DA-2.png differ diff --git a/articles/WAT_DA_files/figure-html/unnamed-chunk-3-1.png b/articles/WAT_DA_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..9c0ee9c Binary files /dev/null and b/articles/WAT_DA_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/articles/WAT_DA_files/figure-html/unnamed-chunk-3-2.png b/articles/WAT_DA_files/figure-html/unnamed-chunk-3-2.png new file mode 100644 index 0000000..eb71e20 Binary files /dev/null and b/articles/WAT_DA_files/figure-html/unnamed-chunk-3-2.png differ diff --git a/articles/WAT_DA_files/figure-html/unnamed-chunk-3-3.png b/articles/WAT_DA_files/figure-html/unnamed-chunk-3-3.png new file mode 100644 index 0000000..890f7ba Binary files /dev/null and b/articles/WAT_DA_files/figure-html/unnamed-chunk-3-3.png differ diff --git a/articles/WAT_DA_files/figure-html/unnamed-chunk-3-4.png b/articles/WAT_DA_files/figure-html/unnamed-chunk-3-4.png new file mode 100644 index 0000000..1c15eab Binary files /dev/null and b/articles/WAT_DA_files/figure-html/unnamed-chunk-3-4.png differ diff --git a/articles/WAT_WGCNA.html b/articles/WAT_WGCNA.html new file mode 100644 index 0000000..a7c40fe --- /dev/null +++ b/articles/WAT_WGCNA.html @@ -0,0 +1,373 @@ + + + + + + + +WGCNA of Omics Datasets • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + + +
+

Metabolomics +

+
+# This is quick to run
+METAB_WGCNA <- run_WGCNA(object = METAB_EXP,
+                         power = 12,
+                         module_prefix = "M")
+#> ..connectivity..
+#> ..matrix multiplication (system BLAS)..
+#> ..normalization..
+#> ..done.
+#>  ..done.
+

+
#>  mergeCloseModules: Merging modules whose distance is less than 0.15
+#>    Calculating new MEs...
+#>    multiSetMEs: Calculating module MEs.
+#>      Working on set 1 ...
+#>      moduleEigengenes: Calculating 8 module eigengenes in given set.
+#>       ..principal component calculation for module red failed with the following error:
+#>            Error in impute.knn(datModule, k = min(10, nrow(datModule) - 1)) : 
+#>   a column has more than 80 % missing values!
+#>        ..hub genes will be used instead of principal components.
+
+table(METAB_WGCNA$modules$moduleID)
+#> 
+#>  M0  M1  M2  M3  M4  M5  M6  M7 
+#>   6 415 221 137  99  86  69  30
+# M0  M1  M2  M3  M4  M5  M6  M7
+#  6 415 221 137  99  86  69  30
+

+
+
+

Proteomics +

+
+# Proportion of missing values?
+prop.table(table(is.na(exprs(PROT_EXP)))) # ~5.7% of values are missing
+
+## NOT RUN WHEN BUILDING VIGNETTE (too slow)
+PROT_WGCNA <- run_WGCNA(object = PROT_EXP,
+                        power = 12,
+                        module_prefix = "P")
+
+table(PROT_WGCNA$modules$moduleID)
+#   P1   P2   P3   P4   P5   P6   P7   P8   P9  P10  P11
+# 3984 1444 1412  734  696  440  435  235  227  192  165
+
+
+

Transcriptomics +

+
+# Convert filtered counts to normalized log2 counts-per-million reads
+dge <- DGEList(counts = exprs(TRNSCRPT_EXP),
+               samples = pData(TRNSCRPT_EXP),
+               group = TRNSCRPT_EXP$exp_group)
+dge <- calcNormFactors(dge, method = "TMM")
+exprs(TRNSCRPT_EXP) <- cpm(dge, log = TRUE)
+
+## NOT RUN WHEN BUILDING VIGNETTE (too slow: ~1 hr)
+TRNSCRPT_WGCNA <- run_WGCNA(object = TRNSCRPT_EXP,
+                            power = 25, # use power = 20:30 to see plots
+                            module_prefix = "T")
+
+table(TRNSCRPT_WGCNA$modules$moduleID)
+#   T0   T1   T2   T3   T4   T5   T6   T7   T8   T9  T10  T11  T12  T13  T14
+# 2587 4683 3251 2134 1517  541  448  325  226  210  186  114   98   51   33
+
+# Save
+usethis::use_data(METAB_WGCNA, internal = FALSE, overwrite = TRUE,
+                  version = 3, compress = "bzip2")
+
+usethis::use_data(PROT_WGCNA, internal = FALSE, overwrite = TRUE,
+                  version = 3, compress = "bzip2")
+
+usethis::use_data(TRNSCRPT_WGCNA, internal = FALSE, overwrite = TRUE,
+                  version = 3, compress = "bzip2")
+
+
+

Session Info +

+
+sessionInfo()
+#> R version 4.3.3 (2024-02-29)
+#> Platform: x86_64-pc-linux-gnu (64-bit)
+#> Running under: Ubuntu 22.04.4 LTS
+#> 
+#> Matrix products: default
+#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
+#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
+#> 
+#> locale:
+#>  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
+#>  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
+#>  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
+#> [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
+#> 
+#> time zone: UTC
+#> tzcode source: system (glibc)
+#> 
+#> attached base packages:
+#> [1] stats     graphics  grDevices utils     datasets  methods   base     
+#> 
+#> other attached packages:
+#> [1] edgeR_4.0.16                       limma_3.58.1                      
+#> [3] MotrpacRatTraining6moWAT_1.0.0     Biobase_2.62.0                    
+#> [5] BiocGenerics_0.48.1                MotrpacRatTraining6moWATData_2.0.0
+#> 
+#> loaded via a namespace (and not attached):
+#>   [1] RColorBrewer_1.1-3      rstudioapi_0.15.0       jsonlite_1.8.8         
+#>   [4] shape_1.4.6.1           magrittr_2.0.3          ggbeeswarm_0.7.2       
+#>   [7] rmarkdown_2.25          GlobalOptions_0.1.2     fs_1.6.3               
+#>  [10] zlibbioc_1.48.0         ragg_1.2.7              vctrs_0.6.5            
+#>  [13] memoise_2.0.1           RCurl_1.98-1.14         base64enc_0.1-3        
+#>  [16] rstatix_0.7.2           htmltools_0.5.7         dynamicTreeCut_1.63-1  
+#>  [19] curl_5.2.1              broom_1.0.5             Formula_1.2-5          
+#>  [22] sass_0.4.8              bslib_0.6.1             htmlwidgets_1.6.4      
+#>  [25] desc_1.4.3              impute_1.76.0           cachem_1.0.8           
+#>  [28] lifecycle_1.0.4         iterators_1.0.14        pkgconfig_2.0.3        
+#>  [31] Matrix_1.6-5            R6_2.5.1                fastmap_1.1.1          
+#>  [34] GenomeInfoDbData_1.2.11 clue_0.3-65             digest_0.6.34          
+#>  [37] colorspace_2.1-0        patchwork_1.2.0         AnnotationDbi_1.64.1   
+#>  [40] S4Vectors_0.40.2        textshaping_0.3.7       Hmisc_5.1-1            
+#>  [43] RSQLite_2.3.5           ggpubr_0.6.0            filelock_1.0.3         
+#>  [46] latex2exp_0.9.6         fansi_1.0.6             httr_1.4.7             
+#>  [49] abind_1.4-5             compiler_4.3.3          bit64_4.0.5            
+#>  [52] doParallel_1.0.17       htmlTable_2.4.2         backports_1.4.1        
+#>  [55] BiocParallel_1.36.0     carData_3.0-5           DBI_1.2.2              
+#>  [58] highr_0.10              ggsignif_0.6.4          rjson_0.2.21           
+#>  [61] tools_4.3.3             vipor_0.4.7             foreign_0.8-86         
+#>  [64] beeswarm_0.4.0          msigdbr_7.5.1           nnet_7.3-19            
+#>  [67] glue_1.7.0              grid_4.3.3              checkmate_2.3.1        
+#>  [70] cluster_2.1.6           fgsea_1.28.0            generics_0.1.3         
+#>  [73] gtable_0.3.4            preprocessCore_1.64.0   tidyr_1.3.1            
+#>  [76] data.table_1.15.2       WGCNA_1.72-5            car_3.1-2              
+#>  [79] utf8_1.2.4              XVector_0.42.0          foreach_1.5.2          
+#>  [82] pillar_1.9.0            stringr_1.5.1           babelgene_22.9         
+#>  [85] circlize_0.4.16         splines_4.3.3           dplyr_1.1.4            
+#>  [88] BiocFileCache_2.10.1    lattice_0.22-5          survival_3.5-8         
+#>  [91] bit_4.0.5               tidyselect_1.2.0        GO.db_3.18.0           
+#>  [94] ComplexHeatmap_2.18.0   locfit_1.5-9.9          Biostrings_2.70.2      
+#>  [97] knitr_1.45              gridExtra_2.3           IRanges_2.36.0         
+#> [100] stats4_4.3.3            xfun_0.42               statmod_1.5.0          
+#> [103] matrixStats_1.2.0       stringi_1.8.3           yaml_2.3.8             
+#> [106] evaluate_0.23           codetools_0.2-19        tibble_3.2.1           
+#> [109] cli_3.6.2               ontologyIndex_2.12      rpart_4.1.23           
+#> [112] systemfonts_1.0.5       munsell_0.5.0           jquerylib_0.1.4        
+#> [115] Rcpp_1.0.12             GenomeInfoDb_1.38.6     dbplyr_2.4.0           
+#> [118] png_0.1-8               fastcluster_1.2.6       parallel_4.3.3         
+#> [121] pkgdown_2.0.7           ggplot2_3.5.0           blob_1.2.4             
+#> [124] bitops_1.0-7            scales_1.3.0            purrr_1.0.2            
+#> [127] crayon_1.5.2            GetoptLong_1.0.5        rlang_1.1.3            
+#> [130] cowplot_1.1.3           fastmatch_1.1-4         KEGGREST_1.42.0
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/WAT_WGCNA_files/figure-html/unnamed-chunk-2-1.png b/articles/WAT_WGCNA_files/figure-html/unnamed-chunk-2-1.png new file mode 100644 index 0000000..113dcb0 Binary files /dev/null and b/articles/WAT_WGCNA_files/figure-html/unnamed-chunk-2-1.png differ diff --git a/articles/WAT_WGCNA_files/figure-html/unnamed-chunk-2-2.png b/articles/WAT_WGCNA_files/figure-html/unnamed-chunk-2-2.png new file mode 100644 index 0000000..68175b8 Binary files /dev/null and b/articles/WAT_WGCNA_files/figure-html/unnamed-chunk-2-2.png differ diff --git a/articles/WAT_WGCNA_files/figure-html/unnamed-chunk-2-3.png b/articles/WAT_WGCNA_files/figure-html/unnamed-chunk-2-3.png new file mode 100644 index 0000000..da92212 Binary files /dev/null and b/articles/WAT_WGCNA_files/figure-html/unnamed-chunk-2-3.png differ diff --git a/articles/WGCNA_METAB_module_heatmaps.html b/articles/WGCNA_METAB_module_heatmaps.html new file mode 100644 index 0000000..5b8d481 --- /dev/null +++ b/articles/WGCNA_METAB_module_heatmaps.html @@ -0,0 +1,379 @@ + + + + + + + +Heatmaps of Metabolites Grouped by WGCNA Module • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates heatmaps of metabolites/lipids grouped by +their WGCNA modules (Fig. 5F; Extended Data Fig. 4A–C).

+ +
+# Values for heatmaps
+x <- METAB_WGCNA$modules %>%
+  merge(exprs(METAB_EXP) %>% 
+          as.data.frame() %>%
+          rownames_to_column("feature_ID"),
+        by = "feature_ID") %>%
+  pivot_longer(cols = matches(as.character(METAB_EXP$pid)),
+               names_to = "pid") %>%
+  filter(!is.na(value)) %>%
+  mutate(pid = as.numeric(pid)) %>%
+  group_by(feature_ID) %>%
+  mutate(value = scale(value)[,1]) %>%
+  left_join(pData(METAB_EXP), by = "pid") %>%
+  group_by(exp_group, feature_ID, name_in_figures,
+           refmet_sub_class, moduleID) %>%
+  summarise(value = mean(value)) %>%
+  # select(feature, name_in_figures, refmet_sub_class, value) %>%
+  pivot_wider(names_from = "exp_group",
+              values_from = "value")
+
+# Add asterisks to indicate significance of timewise comparisons
+label_mat <- METAB_DA$trained_vs_SED %>%
+  filter(feature_ID %in% x$feature_ID) %>%
+  mutate(timepoint = sub("[FM]_([^ ]+).*", "\\1", contrast),
+         sex = ifelse(grepl("F", contrast), "F", "M"),
+         group = paste0(sex, "_", timepoint),
+         label = ifelse(adj.P.Val < 0.05, "*", "")) %>%
+  pivot_wider(id_cols = feature_ID, 
+              names_from = group,
+              values_from = label, 
+              values_fill = "") %>%
+  column_to_rownames("feature_ID") %>%
+  mutate(F_SED = "",
+         M_SED = "") %>%
+  as.matrix() %>%
+  .[x$feature_ID, levels(METAB_EXP$exp_group)]
+
+## Create heatmaps -----
+scale <- 2
+
+ha <- distinct(pData(METAB_EXP), sex, timepoint) %>%
+  transmute(Sex = sex,
+            Timepoint = timepoint) %>%
+  HeatmapAnnotation(
+    df = .,
+    border = TRUE,
+    gp = gpar(col = "black"),
+    gap = 0,
+    which = "column",
+    height = unit(6*2, "pt") * scale,
+    col = list(
+      Sex = c("Female" = "#ff6eff", "Male" = "#5555ff"),
+      Timepoint = c('SED' = 'white',
+                    '1W' = '#F7FCB9',
+                    '2W' = '#ADDD8E',
+                    '4W' = '#238443',
+                    '8W' = '#002612')
+    ),
+    annotation_name_gp = gpar(fontsize = 7 * scale),
+    annotation_legend_param = list(Timepoint = list(
+      at = c("SED", "1W", "2W", "4W", "8W")),
+      border = "black",
+      labels_gp = gpar(fontsize = 6.5 * scale),
+      title_gp = gpar(fontsize = 7 * scale, fontface = "bold")
+    )
+  )
+
+features <- c("Acyl carnitines", "Amino acids", "Acyl CoAs", "Nucleotides")
+nucleotides <- c(paste0(rep(c("A", "G", "U", "C"), each = 3),
+                        rep(c("M", "D", "T"), times = 4), "P"),
+                 paste0("NAD", c("+", "H", "P+", "PH")))
+heights <- c(3.7, 5.3, 5.5, 1.8)
+widths <- c(2.9, 2.9, 3, 2.7)
+min_val <- c(-1.6, -1.8, -1.7, -1.4)
+max_val <- c(1.8, 1.9, 2, 1.6)
+
+for (i in seq_along(features)) {
+  
+  if (features[i] == "Nucleotides") {
+    x_sub <- x %>%
+      column_to_rownames("feature_ID") %>%
+      select(name_in_figures, moduleID,
+             matches(levels(METAB_EXP$exp_group))) %>%
+      .[nucleotides, ] %>% # reorder
+      droplevels.data.frame()
+    
+    cluster_rows <- merge_legends <- FALSE
+  } else {
+    x_sub <- x %>%
+      filter(refmet_sub_class == features[i]) %>%
+      column_to_rownames("feature_ID") %>%
+      select(name_in_figures, moduleID,
+             matches(levels(METAB_EXP$exp_group))) %>%
+      droplevels.data.frame() %>%
+      arrange(moduleID)
+    
+    cluster_rows <- merge_legends <- TRUE
+  }
+  
+  label_mat_i <- label_mat[rownames(x_sub), ]
+  
+  if (features[i] == "Acyl carnitines") {
+    row_title <- unique(x_sub$moduleID)
+  } else {
+    row_title <- NULL
+  }
+  
+  ht <- select(x_sub, -c(name_in_figures, moduleID)) %>%
+    as.matrix() %>%
+    Heatmap(matrix = .,
+            col = circlize::colorRamp2(
+              breaks = c(min_val[i], 0, max_val[i]),
+              colors = c("#3366ff", "white", "darkred")
+            ),
+            cluster_columns = FALSE,
+            cluster_rows = cluster_rows,
+            show_column_names = FALSE,
+            row_labels = x_sub$name_in_figures,
+            split = x_sub$moduleID,
+            row_title = row_title,
+            row_title_gp = gpar(fontsize = 6 * scale),
+            row_title_rot = 0,
+            cluster_row_slices = FALSE,
+            top_annotation = ha,
+            border = "black",
+            row_names_gp = gpar(fontsize = 5 * scale),
+            height = nrow(.) * unit(5.5, "pt") * scale,
+            width = ncol(.) * unit(5.5, "pt") * scale,
+            column_split = rep(1:2, each = 5),
+            column_title = NULL,
+            heatmap_legend_param = list(
+              title = "Mean\nZ-Score",
+              at = c(min_val[i], -1:1, max_val[i]),
+              title_gp = gpar(fontsize = 7 * scale,
+                              fontface = "bold"),
+              labels_gp = gpar(fontsize = 6 * scale),
+              legend_height = 6 * scale * unit(8, "pt"),
+              border = "black"
+            ))
+  
+  feature_name <- gsub(" ", "_", tolower(features[i]))
+  
+  # Save heatmap
+  pdf(file = sprintf(file.path("..", "..", "plots", "METAB_module_%s.pdf"), feature_name),
+      width = widths[i] * scale, 
+      height = heights[i] * scale,
+      family = "ArialMT")
+  draw(ht, merge_legends = merge_legends,
+       align_heatmap_legend = "heatmap_top",
+       align_annotation_legend = "heatmap_top")
+  dev.off()
+}
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/WGCNA_MODULE_ORA.html b/articles/WGCNA_MODULE_ORA.html new file mode 100644 index 0000000..fa6ce37 --- /dev/null +++ b/articles/WGCNA_MODULE_ORA.html @@ -0,0 +1,1678 @@ + + + + + + + +WGCNA Module ORA • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + + +
+

Proteomics +

+
+# Map Entrez IDs to gene symbols
+PROT_entrez_to_symbol <- pluck(PROT_WGCNA, "modules") %>%
+  dplyr::select(entrez_gene, gene_symbol) %>%
+  distinct() %>%
+  deframe()
+head(PROT_entrez_to_symbol)
+#>     26194     26195     26198     26196     26204     26199 
+#>  "Mt-nd2"  "Mt-co1"  "Mt-co2" "Mt-atp8"  "Mt-co3"  "Mt-nd3"
+
+# Genes by module
+PROT_MOD_LIST <- pluck(PROT_WGCNA, "modules") %>%
+  filter(moduleColor != "grey") %>%
+  group_by(moduleID) %>%
+  summarise(feature = list(unique(entrez_gene))) %>%
+  deframe()
+map(PROT_MOD_LIST, head)
+#> $P1
+#> [1]  26194  26196  26199  26201 362277 308900
+#> 
+#> $P2
+#> [1] 292126 361458  60374 311551 360518 406230
+#> 
+#> $P3
+#> [1] 406864 406163 287699 287700 309622 361710
+#> 
+#> $P4
+#> [1] 365022 282844 295692 308576 361967 314313
+#> 
+#> $P5
+#> [1] 315452 360548 363327 432360 406161 296654
+#> 
+#> $P6
+#> [1] 406868 290783 293852 295490 299799 300046
+#> 
+#> $P7
+#> [1] 300741 288923 295231 314246  24907 287432
+#> 
+#> $P8
+#> [1] 288532 288652 291469 361977 287278 309452
+#> 
+#> $P9
+#> [1]  26195  26198  26204  26192 315509 289217
+#> 
+#> $P10
+#> [1] 444984 117526 192218 289504 300782 288718
+#> 
+#> $P11
+#> [1] 408236 408247 296562 288416 304546 360504
+
+# Number of unique genes in each module
+lengths(PROT_MOD_LIST)
+#>   P1   P2   P3   P4   P5   P6   P7   P8   P9  P10  P11 
+#> 3860 1403 1391  728  667  434  414  233  227  191  159
+#   P1   P2   P3   P4   P5   P6   P7   P8   P9  P10  P11
+# 3860 1403 1391  728  667  434  414  233  227  191  159
+
+# all genes
+PROT_UNIVERSE <- unique(unlist(PROT_MOD_LIST))
+head(PROT_UNIVERSE)
+#> [1]  26194  26196  26199  26201 362277 308900
+
+# Select gene sets that are largely unchanged when filtering
+# to only those Entrez IDs present in the results.
+PROT_MSIGDB <- MSIGDB_PATHWAYS %>%
+  mutate(entrez_gene = map(entrez_gene, intersect, y = PROT_UNIVERSE),
+         set_size_post = lengths(entrez_gene),
+         ratio = set_size_post / set_size) %>%
+  filter(ratio >= 0.85, # at least 85% of the original set remains
+         set_size_post >= 15)
+head(PROT_MSIGDB)
+#>   gs_subcat gs_exact_source
+#> 1     GO:BP      GO:0006103
+#> 2     GO:BP      GO:0006085
+#> 3     GO:BP      GO:0006084
+#> 4     GO:BP      GO:0043038
+#> 5     GO:BP      GO:0046033
+#> 6     GO:BP      GO:0019884
+#>                                             gs_description  entrez_gene
+#> 1                         2-oxoglutarate metabolic process 29416, 3....
+#> 2                          acetyl-CoA biosynthetic process 25014, 2....
+#> 3                             acetyl-CoA metabolic process 29416, 2....
+#> 4                                    Amino acid activation 292023, ....
+#> 5                                    AMP metabolic process 24165, 2....
+#> 6 Antigen processing and presentation of exogenous antigen 309969, ....
+#>   set_size set_size_post     ratio
+#> 1       17            16 0.9411765
+#> 2       17            17 1.0000000
+#> 3       32            29 0.9062500
+#> 4       45            42 0.9333333
+#> 5       25            24 0.9600000
+#> 6       35            30 0.8571429
+
+# How many sets in each category remain?
+table(PROT_MSIGDB$gs_subcat)
+#> 
+#> GO:BP GO:CC GO:MF 
+#>   230    97    77
+# GO:BP GO:CC GO:MF
+#   230    97    77
+
+# ORA
+PROT_MODULE_ORA <- fora2(pathways = PROT_MSIGDB,
+                         genes = PROT_MOD_LIST,
+                         universe = PROT_UNIVERSE,
+                         adjust.method = "scale",
+                         adjust.globally = TRUE) %>%
+  mutate(overlapGenes_symbol = map(
+    .x = overlapGenes,
+    .f = ~ na.omit(PROT_entrez_to_symbol[as.character(.x)])
+  )) %>%
+  relocate(module, gs_subcat, pathway, gs_description) %>%
+  relocate(overlap, maxOverlap, overlapRatio, .after = size)
+
+head(PROT_MODULE_ORA)
+#>    module gs_subcat    pathway                               gs_description
+#>    <fctr>    <char>     <char>                                       <char>
+#> 1:     P1     GO:CC GO:0098798     Mitochondrial protein-containing complex
+#> 2:     P1     GO:CC GO:0098800 Inner mitochondrial membrane protein complex
+#> 3:     P1     GO:CC GO:0005840                                     Ribosome
+#> 4:     P1     GO:MF GO:0003735           Structural constituent of ribosome
+#> 5:     P1     GO:BP GO:0006119                    Oxidative phosphorylation
+#> 6:     P1     GO:CC GO:0044391                            Ribosomal subunit
+#>            pval         padj  size overlap maxOverlap overlapRatio overlapGenes
+#>           <num>        <num> <int>   <int>      <int>        <num>       <list>
+#> 1: 1.301385e-16 1.624359e-16   247     164        164    0.9939394 307350, ....
+#> 2: 2.749959e-17 9.188149e-11   130     100        164    0.6060606 307350, ....
+#> 3: 2.123303e-12 2.753016e-09   183     121        164    0.7333333 192210, ....
+#> 4: 3.701938e-14 4.975619e-09   142     102        164    0.6181818 691075, ....
+#> 5: 5.900244e-16 7.547399e-09   113      88        164    0.5333333 363516, ....
+#> 6: 2.228687e-12 2.778986e-08   157     107        164    0.6484848 502531, ....
+#>    overlapGenes_symbol
+#>                 <list>
+#> 1:        Afg3l2, ....
+#> 2:        Afg3l2, ....
+#> 3:        Dnajc21,....
+#> 4:        Mrpl10, ....
+#> 5:        Abcd1, A....
+#> 6:        Eif2a, F....
+
+
+

Transcriptomics +

+
+TRNSCRPT_MODULES <- pluck(TRNSCRPT_WGCNA, "modules") %>%
+  separate_rows(entrez_gene, gene_symbol, sep = ";") %>%
+  filter(entrez_gene != "NA",
+         moduleColor != "grey")
+head(TRNSCRPT_MODULES)
+#> # A tibble: 6 × 5
+#>   moduleColor moduleID feature_ID         gene_symbol entrez_gene
+#>   <chr>       <fct>    <chr>              <chr>       <chr>      
+#> 1 turquoise   T1       ENSRNOG00000000007 Gad1        24379      
+#> 2 blue        T2       ENSRNOG00000000008 Alx4        296511     
+#> 3 yellow      T4       ENSRNOG00000000010 Cbln1       498922     
+#> 4 green       T5       ENSRNOG00000000012 Tcf15       296272     
+#> 5 turquoise   T1       ENSRNOG00000000017 Steap1      297738     
+#> 6 green       T5       ENSRNOG00000000024 Hebp1       362454
+
+# Entrez to gene symbol conversion vector
+TRNSCRPT_entrez_to_symbol <- TRNSCRPT_MODULES %>%
+  dplyr::select(entrez_gene, gene_symbol) %>%
+  distinct() %>%
+  deframe()
+head(TRNSCRPT_entrez_to_symbol)
+#>    24379   296511   498922   296272   297738   362454 
+#>   "Gad1"   "Alx4"  "Cbln1"  "Tcf15" "Steap1"  "Hebp1"
+
+# Genes by module
+TRNSCRPT_MOD_LIST <- TRNSCRPT_MODULES %>%
+  group_by(moduleID) %>%
+  summarise(feature = list(unique(entrez_gene))) %>%
+  deframe()
+map(TRNSCRPT_MOD_LIST, head)
+#> $T1
+#> [1] "24379"  "297738" "305095" "83628"  "81659"  "64832" 
+#> 
+#> $T2
+#> [1] "296511" "64076"  "360904" "306338" "85435"  "502585"
+#> 
+#> $T3
+#> [1] "25419"  "305633" "290923" "81660"  "691729" "287561"
+#> 
+#> $T4
+#> [1] "498922" "305101" "289424" "295568" "313806" "291359"
+#> 
+#> $T5
+#> [1] "296272" "362454" "312754" "289883" "24184"  "81718" 
+#> 
+#> $T6
+#> [1] "317628" "309626" "81773"  "81729"  "361856" "83474" 
+#> 
+#> $T7
+#> [1] "140608" "362607" "301111" "294320" "294362" "288615"
+#> 
+#> $T8
+#> [1] "362841" "29513"  "304555" "171387" "252860" "689074"
+#> 
+#> $T9
+#> [1] "309760" "309772" "499430" "364147" "117052" "302920"
+#> 
+#> $T10
+#> [1] "365542" "690865" "24699"  "361795" "25008"  "171075"
+#> 
+#> $T11
+#> [1] "100365935" "309659"    "361831"    "25177"     "29353"     "304469"   
+#> 
+#> $T12
+#> [1] "361811" "81917"  "360811" "360466" "287773" "317343"
+#> 
+#> $T13
+#> [1] "360731" "246334" "305307" "287701" "296188" "305078"
+#> 
+#> $T14
+#> [1] "360800" "81829"  "363790" "25405"  "299104" "287644"
+
+# Number of unique genes in each module
+lengths(TRNSCRPT_MOD_LIST)
+#>   T1   T2   T3   T4   T5   T6   T7   T8   T9  T10  T11  T12  T13  T14 
+#> 4425 3061 2014 1435  528  418  314  221  202  153  112   97   49   32
+#   T1   T2   T3   T4   T5   T6   T7   T8   T9  T10  T11  T12  T13  T14
+# 4425 3061 2014 1435  528  418  314  221  202  153  112   97   49   32
+
+# all genes
+TRNSCRPT_UNIVERSE <- unique(unlist(TRNSCRPT_MOD_LIST))
+head(TRNSCRPT_UNIVERSE)
+#> [1] "24379"  "297738" "305095" "83628"  "81659"  "64832"
+
+# Select gene sets that are largely unchanged when filtering
+# to only those Entrez IDs present in the results.
+TRNSCRPT_MSIGDB <- MSIGDB_PATHWAYS %>%
+  mutate(entrez_gene = map(entrez_gene, intersect, y = TRNSCRPT_UNIVERSE),
+         set_size_post = lengths(entrez_gene),
+         ratio = set_size_post / set_size) %>%
+  filter(ratio >= 0.85, # at least 85% of the original set remains
+         set_size_post >= 15)
+
+# How many sets in each category remain?
+table(TRNSCRPT_MSIGDB$gs_subcat)
+#> 
+#> GO:BP GO:CC GO:MF 
+#>   927   110   158
+# GO:BP GO:CC GO:MF
+#   927   110   158
+
+# ORA
+TRNSCRPT_MODULE_ORA <- fora2(pathways = TRNSCRPT_MSIGDB,
+                             genes = TRNSCRPT_MOD_LIST,
+                             universe = TRNSCRPT_UNIVERSE,
+                             adjust.method = "scale",
+                             adjust.globally = TRUE) %>%
+  mutate(overlapGenes_symbol = map(
+    .x = overlapGenes,
+    .f = ~ na.omit(TRNSCRPT_entrez_to_symbol[as.character(.x)])
+  )) %>%
+  relocate(module, gs_subcat, pathway, gs_description) %>%
+  relocate(overlap, maxOverlap, overlapRatio, .after = size)
+
+head(TRNSCRPT_MODULE_ORA)
+#>    module gs_subcat    pathway
+#>    <fctr>    <char>     <char>
+#> 1:     T1     GO:BP GO:0048193
+#> 2:     T1     GO:CC GO:0098798
+#> 3:     T1     GO:CC GO:0000313
+#> 4:     T1     GO:BP GO:0006888
+#> 5:     T1     GO:CC GO:0140534
+#> 6:     T1     GO:BP GO:0007030
+#>                                               gs_description         pval
+#>                                                       <char>        <num>
+#> 1:                                   Golgi vesicle transport 1.312359e-18
+#> 2:                  Mitochondrial protein-containing complex 7.043475e-15
+#> 3:                                       Organellar ribosome 2.924571e-27
+#> 4: Endoplasmic reticulum to Golgi vesicle-mediated transport 1.001808e-19
+#> 5:          Endoplasmic reticulum protein-containing complex 2.318285e-17
+#> 6:                                        Golgi organization 1.024182e-12
+#>            padj  size overlap maxOverlap overlapRatio overlapGenes
+#>           <num> <int>   <int>      <int>        <num>       <list>
+#> 1: 1.708758e-18   255     155        155    0.9935897 114024, ....
+#> 2: 1.616504e-13   242     141        155    0.9038462 307350, ....
+#> 3: 1.240926e-12    75      70        155    0.4487179 290645, ....
+#> 4: 5.883736e-11   110      84        155    0.5384615 300674, ....
+#> 5: 1.803222e-09   112      82        155    0.5256410 362031, ....
+#> 6: 8.478755e-07   120      79        155    0.5064103 246150, ....
+#>    overlapGenes_symbol
+#>                 <list>
+#> 1:        Acsl3, A....
+#> 2:        Afg3l2, ....
+#> 3:        Mpv17l2,....
+#> 4:        Arcn1, A....
+#> 5:        Alg14, A....
+#> 6:        Akap9, A....
+
+
+

Metabolomics +

+
+# List of features by module
+METAB_MOD_LIST <- pluck(METAB_WGCNA, "modules") %>%
+  filter(moduleColor != "grey") %>%
+  group_by(moduleID) %>%
+  summarise(feature = list(unique(feature_ID))) %>%
+  deframe()
+head(METAB_MOD_LIST)
+#> $M1
+#>   [1] "adenosine"                                                                                                
+#>   [2] "Anserine"                                                                                                 
+#>   [3] "C12 carnitine"                                                                                            
+#>   [4] "C12:1 carnitine"                                                                                          
+#>   [5] "C14 carnitine"                                                                                            
+#>   [6] "C14:1 carnitine"                                                                                          
+#>   [7] "C14:2 carnitine"                                                                                          
+#>   [8] "C18:1 carnitine"                                                                                          
+#>   [9] "C18:2 carnitine"                                                                                          
+#>  [10] "C2 carnitine"                                                                                             
+#>  [11] "C20 carnitine"                                                                                            
+#>  [12] "C3 carnitine"                                                                                             
+#>  [13] "Carnosine"                                                                                                
+#>  [14] "Cer(d34:1)>Cer(d18:1/16:0)_feature1"                                                                      
+#>  [15] "choline"                                                                                                  
+#>  [16] "creatine"                                                                                                 
+#>  [17] "deoxycholate"                                                                                             
+#>  [18] "C34:1 DAG"                                                                                                
+#>  [19] "gamma-glutamylleucine"                                                                                    
+#>  [20] "glutathione reduced"                                                                                      
+#>  [21] "inosine"                                                                                                  
+#>  [22] "kynurenate"                                                                                               
+#>  [23] "LPC(20:3)_a_b"                                                                                            
+#>  [24] "N-acetylleucine"                                                                                          
+#>  [25] "PC(30:0)"                                                                                                 
+#>  [26] "PC(32:2)"                                                                                                 
+#>  [27] "PC(36:2)"                                                                                                 
+#>  [28] "SM(d34:0)_feature1"                                                                                       
+#>  [29] "SM(d34:2)_feature1"                                                                                       
+#>  [30] "sphinganine"                                                                                              
+#>  [31] "sphingosine-1P (C18)"                                                                                     
+#>  [32] "urocanate"                                                                                                
+#>  [33] "xanthine"                                                                                                 
+#>  [34] "alpha-Amino-N-butyric-acid"                                                                               
+#>  [35] "CoA(10:2)"                                                                                                
+#>  [36] "CoA(12:0-OH)"                                                                                             
+#>  [37] "CoA(12:3)"                                                                                                
+#>  [38] "CoA(16:0)"                                                                                                
+#>  [39] "CoA(16:1)"                                                                                                
+#>  [40] "CoA(19:3)"                                                                                                
+#>  [41] "CoA(21:3)"                                                                                                
+#>  [42] "CoA(9:1)"                                                                                                 
+#>  [43] "NaMN"                                                                                                     
+#>  [44] "ZMP"                                                                                                      
+#>  [45] "dTTP"                                                                                                     
+#>  [46] "13-HpODE"                                                                                                 
+#>  [47] "9-HOTrE"                                                                                                  
+#>  [48] "LTB4"                                                                                                     
+#>  [49] "3-(1-pyrazolyl)-alanine_feature1"                                                                         
+#>  [50] "Car(18:2)_feature1"                                                                                       
+#>  [51] "Cer(d36:2)>Cer(d18:2/18:0)_feature1"                                                                      
+#>  [52] "Cer(d40:1)>Cer(d18:1/22:0)_feature2"                                                                      
+#>  [53] "Cer(d41:1)>Cer(d18:1/23:0)_feature1"                                                                      
+#>  [54] "Cer(d42:1)>Cer(d18:1/24:0)_feature3"                                                                      
+#>  [55] "Cer(d44:2)>Cer(d18:1/26:1)_feature2"                                                                      
+#>  [56] "LPC(20:1/0:0)_and_LPC(0:0/20:1)_feature3"                                                                 
+#>  [57] "PC(30:0)_feature1"                                                                                        
+#>  [58] "PC(34:4)_feature2"                                                                                        
+#>  [59] "PC(35:2)_feature2"                                                                                        
+#>  [60] "PC(35:3)_feature1"                                                                                        
+#>  [61] "PC(35:3)_feature3"                                                                                        
+#>  [62] "PC(36:0)_feature3"                                                                                        
+#>  [63] "PC(36:1)_feature1"                                                                                        
+#>  [64] "PC(36:2)_feature3"                                                                                        
+#>  [65] "PC(36:4)_feature3"                                                                                        
+#>  [66] "PC(36:5)_feature1"                                                                                        
+#>  [67] "PC(36:5)_feature2"                                                                                        
+#>  [68] "PC(37:3)_feature2"                                                                                        
+#>  [69] "PC(37:6)_feature4"                                                                                        
+#>  [70] "PC(42:6)_feature2"                                                                                        
+#>  [71] "PC(O-36:2)_feature3"                                                                                      
+#>  [72] "PC(O-38:6)_feature1"                                                                                      
+#>  [73] "PE(34:2)_feature2"                                                                                        
+#>  [74] "PE(36:5)_feature5"                                                                                        
+#>  [75] "PE(38:5)>PE(18:1_20:4)_feature7"                                                                          
+#>  [76] "PE(38:5)>PE(18:1_20:4)_feature8"                                                                          
+#>  [77] "PE(O-40:7)>PE(O-18:2/22:5)_feature4"                                                                      
+#>  [78] "PS(40:4)_feature1"                                                                                        
+#>  [79] "PS(40:6)_feature2"                                                                                        
+#>  [80] "SM(d36:0)_feature1"                                                                                       
+#>  [81] "SM(d38:1)_feature2"                                                                                       
+#>  [82] "SM(d39:1)_feature2"                                                                                       
+#>  [83] "SM(d41:1)_feature1"                                                                                       
+#>  [84] "SM(d44:2)_feature1"                                                                                       
+#>  [85] "TG(36:1)>TG(8:0_10:0_18:1)_and_TG(10:0_10:0_16:1)_feature3"                                               
+#>  [86] "TG(36:2)_M+NH3_feature2"                                                                                  
+#>  [87] "TG(38:2)>TG(4:0_16:1_18:1)_and_TG(4:0_16:0_18:2)_M+NH3_feature1"                                          
+#>  [88] "TG(38:2)>TG(4:0_16:1_18:1)_and_TG(4:0_16:0_18:2)_feature3"                                                
+#>  [89] "TG(39:1)_M+NH3_feature1"                                                                                  
+#>  [90] "TG(40:4)>TG(4:0_18:2_18:2)_M+NH3_feature1"                                                                
+#>  [91] "TG(40:5)>TG(4:0_18:2_18:3)_M+NH3_feature1"                                                                
+#>  [92] "TG(41:3)>TG(5:0_18:1_18:2)_M+NH3_feature1"                                                                
+#>  [93] "TG(42:1)_feature1"                                                                                        
+#>  [94] "TG(42:2)_M+NH3_feature2"                                                                                  
+#>  [95] "TG(42:3)>TG(6:0_18:1_18:2)_feature2"                                                                      
+#>  [96] "TG(42:3)_M+NH3_feature1"                                                                                  
+#>  [97] "TG(42:5)_M+NH3_feature1"                                                                                  
+#>  [98] "TG(42:5)_M+NH3_feature2"                                                                                  
+#>  [99] "TG(43:2)>TG(10:0_15:0_18:2)_M+NH3_feature1"                                                               
+#> [100] "TG(44:1)>TG(10:0_16:0_18:1)_M+NH3_feature1"                                                               
+#> [101] "TG(44:1)>TG(10:0_16:0_18:1)_feature3"                                                                     
+#> [102] "TG(44:2)>TG(10:0_16:1_18:1)_M+NH3_feature1"                                                               
+#> [103] "TG(44:2)>TG(10:0_16:1_18:1)_feature2"                                                                     
+#> [104] "TG(44:3)>TG(8:0_18:1_18:2)_and_TG(10:0_16:1_18:2)_feature1"                                               
+#> [105] "TG(44:4)>TG(8:0_18:2_18:2)_feature1"                                                                      
+#> [106] "TG(45:2)_M+NH3_feature1"                                                                                  
+#> [107] "TG(45:3)>TG(10:0_17:1_18:2)_and_TG(9:0_18:1_18:2)_M+NH3_feature1"                                         
+#> [108] "TG(46:3)>TG(10:0_18:1_18:2)_and_TG(12:0_16:1_18:2)_feature1"                                              
+#> [109] "TG(46:4)>TG(10:0_18:2_18:2)_feature1"                                                                     
+#> [110] "TG(46:5)>TG(10:0_18:2_18:3)_feature1"                                                                     
+#> [111] "TG(46:5)>TG(10:0_18:2_18:3)_feature2"                                                                     
+#> [112] "TG(46:6)>TG(8:0_16:0_22:6)_M+NH3_feature1"                                                                
+#> [113] "TG(46:6)>TG(8:0_18:2_20:4)_M+NH3_feature2"                                                                
+#> [114] "TG(47:3)_M+NH3_feature2"                                                                                  
+#> [115] "TG(48:1)>TG(16:0_16:0_16:1)_and_TG(14:0_16:0_18:1)_feature3"                                              
+#> [116] "TG(48:2)>TG(14:0_16:0_18:2)_and_TG(14:0_16:1_18:1)_M+NH3_feature2"                                        
+#> [117] "TG(48:2)>TG(14:0_16:0_18:2)_and_TG(14:0_16:1_18:1)_feature3"                                              
+#> [118] "TG(48:3)_M+NH3_feature1"                                                                                  
+#> [119] "TG(48:5)_feature1"                                                                                        
+#> [120] "TG(48:6)>TG(10:0_16:0_22:6)_M+NH3_feature2"                                                               
+#> [121] "TG(48:6)>TG(10:0_18:2_20:4)_M+NH3_feature1"                                                               
+#> [122] "TG(49:0)>TG(16:0_16:0_17:0)_and_TG(15:0_16:0_18:0)_and_TG(14:0_16:0_19:0)_M+NH3_feature1"                 
+#> [123] "TG(49:1)>TG(15:0_16:0_18:0)_and_TG(16:0_16:0_17:1)_and_>TG(16:0_16:1_17:0)_M+NH3_feature1"                
+#> [124] "TG(49:2)_M+NH3_feature3"                                                                                  
+#> [125] "TG(49:3)_M+NH3_feature1"                                                                                  
+#> [126] "TG(49:3)_feature2"                                                                                        
+#> [127] "TG(49:4)_M+NH3_feature1"                                                                                  
+#> [128] "TG(50:1)>TG(16:0_16:0_18:1)_feature4"                                                                     
+#> [129] "TG(50:1)_M+NH3_feature2"                                                                                  
+#> [130] "TG(50:2)>TG(16:0_16:0_18:2)_and_TG(16:0_16:1_18:1)_M+NH3_feature1"                                        
+#> [131] "TG(50:2)>TG(16:0_16:0_18:2)_and_TG(16:0_16:1_18:1)_M+NH3_feature2"                                        
+#> [132] "TG(50:2)>TG(16:0_16:0_18:2)_and_TG(16:0_16:1_18:1)_M+NH3_feature3"                                        
+#> [133] "TG(50:3)_M+NH3_feature4"                                                                                  
+#> [134] "TG(50:3)_feature3"                                                                                        
+#> [135] "TG(50:4)>TG(16:1_16:1_18:2)_feature2"                                                                     
+#> [136] "TG(50:5)_M+NH3_feature1"                                                                                  
+#> [137] "TG(50:5)_feature2"                                                                                        
+#> [138] "TG(50:6)_feature2"                                                                                        
+#> [139] "TG(50:7)>TG(10:0_18:2_22:5)_M+NH3_feature1"                                                               
+#> [140] "TG(50:8)>TG(10:0_18:2_22:6)_and_TG(50:8)>TG(10:0_20:4_20:4)_M+NH3_feature1"                               
+#> [141] "TG(51:0)>TG(16:0_17:0_18:0)_and_TG(16:0_16:0_19:0)_and_TG(15:0_17:0_19:0)_M+NH3_feature1"                 
+#> [142] "TG(51:2)>TG(15:0_18:1_18:1)_and_TG(16:0_17:1_18:1)_and_TG(16:1_17:0_18:1)_M+NH3_feature2"                 
+#> [143] "TG(51:3)>TG(15:0_18:1_18:2)_and_TG(16:0_17:1_18:2)_and_TG(16:1_17:1_18:1)_feature3"                       
+#> [144] "TG(51:4)>TG(16:1_17:1_18:2)_and_TG(15:0_18:2_18:2)_and_TG(15:1_18:1_18:2)_feature1"                       
+#> [145] "TG(51:5)>TG(15:0_18:2_18:3)_and_TG(15:1_18:2_18:2)_M+NH3_feature2"                                        
+#> [146] "TG(52:1)_M+NH3_feature3"                                                                                  
+#> [147] "TG(52:2)>TG(16:0_18:1_18:1)_and_TG(16:0_18:0_18:2)_M+NH3_feature5"                                        
+#> [148] "TG(52:2)>TG(16:0_18:1_18:1)_and_TG(16:0_18:0_18:2)_M+NH3_feature7"                                        
+#> [149] "TG(52:3)>TG(16:0_18:1_18:2)_and_TG(16:1_18:1_18:1)_feature3"                                              
+#> [150] "TG(52:4)>TG(16:0_16:0_20:4)_and_TG(16:1_18:1_18:2)_and_TG(16:0_18:1_18:2)_M+NH3_feature6"                 
+#> [151] "TG(52:4)>TG(16:1_18:1_18:2)_M+NH3_feature1"                                                               
+#> [152] "TG(52:4)>TG(16:1_18:1_18:2)_M+NH3_feature4"                                                               
+#> [153] "TG(52:4)>TG(16:1_18:1_18:2)_M+NH3_feature5"                                                               
+#> [154] "TG(52:5)>TG(16:0_18:2_18:3)_M+NH3_feature5"                                                               
+#> [155] "TG(52:5)>TG(16:1_18:2_18:2)_feature3"                                                                     
+#> [156] "TG(52:6)>TG(16:1_18:2_18:3)_and_TG(16:2_18:2_18:2)_feature3"                                              
+#> [157] "TG(52:6)_feature4"                                                                                        
+#> [158] "TG(52:7)_M+NH3_feature2"                                                                                  
+#> [159] "TG(53:1)>TG(16:0_18:1_19:0)_and_TG(17:0_18:0_18:1)_M+NH3_feature4"                                        
+#> [160] "TG(53:2)_feature4"                                                                                        
+#> [161] "TG(53:3)>TG(17:0_18:1_18:2)_and_TG(17:1_18:1_18:1)_and_TG(16:1_18:1_19:1)_and_TG(16:0_18:1_19:2)_feature5"
+#> [162] "TG(53:4)>TG(17:0_18:2_18:2)_and_TG(17:1_18:1_18:2)_M+NH3_feature3"                                        
+#> [163] "TG(53:5)>TG(17:1_18:2_18:2)_feature1"                                                                     
+#> [164] "TG(53:6)>TG(17:2_18:2_18:2)_and_TG(17:1_18:2_18:3)_feature1"                                              
+#> [165] "TG(54:1)>TG(18:0_18:0_18:1)_and_TG(16:1_18:0_20:0)_and_TG(16:0_18:0_20:1)_M+NH13_feature4"                
+#> [166] "TG(54:3)>TG(18:0_18:1_18:2)_and_TG(18:1/18:1/18:1)_and_TG(16:0_18:2_20:1)_feature9"                       
+#> [167] "TG(54:3)>TG(18:1/18:1/18:1)_M+NH3_feature2"                                                               
+#> [168] "TG(54:3)>TG(18:1/18:1/18:1)_M+NH3_feature3"                                                               
+#> [169] "TG(54:3)>TG(18:1/18:1/18:1)_M+NH3_feature8"                                                               
+#> [170] "TG(54:4)>TG(18:1_18:1_18:2)_M+NH3_feature4"                                                               
+#> [171] "TG(54:4)>TG(18:1_18:1_18:2)_M+NH3_feature5"                                                               
+#> [172] "TG(54:4)>TG(18:1_18:1_18:2)_and_TG(18:0_18:2_18:2)_M+NH3_feature3"                                        
+#> [173] "TG(54:5)>TG(18:1_18:2_18:2)_M+NH3_feature1"                                                               
+#> [174] "TG(54:5)>TG(18:1_18:2_18:2)_M+NH3_feature3"                                                               
+#> [175] "TG(54:5)>TG(18:1_18:2_18:2)_M+NH3_feature4"                                                               
+#> [176] "TG(54:5)>TG(18:1_18:2_18:2)_and_TG(16:0_16:0_22:5)_and_TG(16:0_18:1_20:4)_feature5"                       
+#> [177] "TG(54:6)>TG(16:0_16:0_22:6)_M+NH5_feature6"                                                               
+#> [178] "TG(54:6)>TG(18:2/18:2/18:2)_M+NH3_feature1"                                                               
+#> [179] "TG(54:6)>TG(18:2/18:2/18:2)_and_TG(18:1_18:2_18:3)_M+NH3_feature4"                                        
+#> [180] "TG(54:7)>TG(18:2_18:2_18:3)_feature2"                                                                     
+#> [181] "TG(54:8)_M+NH3_feature3"                                                                                  
+#> [182] "TG(54:8)_feature1"                                                                                        
+#> [183] "TG(55:2)_M+NH3_feature2"                                                                                  
+#> [184] "TG(55:3)>TG(18:1_18:1_19:1)_and_TG(18:1_18:2_19:0)_feature3"                                              
+#> [185] "TG(55:4)>TG(18:1_18:2_19:1)_and_TG(18:2_18:2_19:0)_and_TG(18:1_18:1_19:2)_M+NH3_feature1"                 
+#> [186] "TG(55:4)>TG(18:1_18:2_19:1)_and_TG(18:2_18:2_19:0)_and_TG(18:1_18:1_19:2)_feature2"                       
+#> [187] "TG(55:5)>TG(18:2_18:2_19:1)_and_TG(18:1_18:2_19:2)_M+NH3_feature1"                                        
+#> [188] "TG(55:5)>TG(18:2_18:2_19:1)_and_TG(18:1_18:2_19:2)_feature4"                                              
+#> [189] "TG(55:7)_M+NH3_feature2"                                                                                  
+#> [190] "TG(56:10)>TG(18:2_18:3_20:5)_M+NH3_feature1"                                                              
+#> [191] "TG(56:4)>TG(18:1_18:2_20:1)_and_TG(18:1_18:1_20:2)_M+NH3_feature1"                                        
+#> [192] "TG(56:4)>TG(18:1_18:2_20:1)_and_TG(18:1_18:1_20:2)_M+NH3_feature5"                                        
+#> [193] "TG(56:4)>TG(18:1_18:2_20:1)_and_TG(18:1_18:1_20:2)_feature4"                                              
+#> [194] "TG(56:5)>TG(16:0_18:1_22:4)_M+NH3_feature1"                                                               
+#> [195] "TG(56:5)>TG(16:0_18:1_22:4)_M+NH3_feature4"                                                               
+#> [196] "TG(56:5)>TG(16:0_18:1_22:4)_M+NH3_feature5"                                                               
+#> [197] "TG(56:6)>TG(18:0_16:0_22:6)_M+NH3_feature5"                                                               
+#> [198] "TG(56:6)>TG(18:1_18:1_20:4)_and_TG(16:0_18:1_22:5)_and_TG(18:1_18:2_20:3)_M+NH3_feature1"                 
+#> [199] "TG(56:6)>TG(18:1_18:1_20:4)_and_TG(16:0_18:1_22:5)_and_TG(18:1_18:2_20:3)_M+NH3_feature3"                 
+#> [200] "TG(56:7)>TG(16:0_18:1_22:6)_M+NH3_feature7"                                                               
+#> [201] "TG(56:7)_M+NH3_feature1"                                                                                  
+#> [202] "TG(56:7)_feature5"                                                                                        
+#> [203] "TG(56:8)>TG(16:0_18:2_22:6)_M+NH3_feature5"                                                               
+#> [204] "TG(56:8)>TG(18:2_18:2_20:4)_feature3"                                                                     
+#> [205] "TG(56:9)_M+NH3_feature2"                                                                                  
+#> [206] "TG(57:1)>TG(16:0_18:1_23:0)_and_TG(18:0_18:1_21:0)_M+NH3_feature1"                                        
+#> [207] "TG(57:2)_M+NH3_feature1"                                                                                  
+#> [208] "TG(57:3)_M+NH3_feature2"                                                                                  
+#> [209] "TG(57:4)_M+NH3_feature2"                                                                                  
+#> [210] "TG(57:4)_M+NH3_feature3"                                                                                  
+#> [211] "TG(58:1)>TG(16:0_18:1_24:0)_and_TG(16:0_16:0_26:1)_and_TG(18:0_18:1_22:0)_M+NH3_feature1"                 
+#> [212] "TG(58:10)_M+NH3_feature1"                                                                                 
+#> [213] "TG(58:10)_M+NH3_feature2"                                                                                 
+#> [214] "TG(58:11)_M+NH3_feature1"                                                                                 
+#> [215] "TG(58:11)_M+NH3_feature2"                                                                                 
+#> [216] "TG(58:2)_feature3"                                                                                        
+#> [217] "TG(58:3)_M+NH3_feature1"                                                                                  
+#> [218] "TG(58:4)_M+NH3_feature5"                                                                                  
+#> [219] "TG(58:4)_feature6"                                                                                        
+#> [220] "TG(58:5)_M+NH3_feature6"                                                                                  
+#> [221] "TG(58:6)>TG(18:0_18:0_22:6)_M+NH3_feature7"                                                               
+#> [222] "TG(58:6)_M+NH3_feature1"                                                                                  
+#> [223] "TG(58:6)_M+NH3_feature5"                                                                                  
+#> [224] "TG(58:6)_M+NH3_feature6"                                                                                  
+#> [225] "TG(58:7)>TG(18:0_18:1_22:6)_M+NH3_feature5"                                                               
+#> [226] "TG(58:7)>TG(18:0_18:1_22:6)_feature3"                                                                     
+#> [227] "TG(58:8)>TG(18:2_18:2_22:4)_feature4"                                                                     
+#> [228] "TG(58:9)_M+NH3_feature1"                                                                                  
+#> [229] "TG(58:9)_M+NH3_feature2"                                                                                  
+#> [230] "TG(58:9)_M+NH3_feature3"                                                                                  
+#> [231] "TG(60:10)>TG(18:0_20:4_22:6)_M+NH3_feature3"                                                              
+#> [232] "TG(60:10)>TG(18:0_20:4_22:6)_M+NH3_feature4"                                                              
+#> [233] "TG(60:3)_M+NH3_feature2"                                                                                  
+#> [234] "TG(60:4)_feature1"                                                                                        
+#> [235] "ubiquinol Q9 _feature1"                                                                                   
+#> [236] "CL(72:8)_feature1"                                                                                        
+#> [237] "Cer(d34:1)_M+H2CO2_feature1"                                                                              
+#> [238] "Cer(d36:1)_M+H2CO2_feature1"                                                                              
+#> [239] "Cer(d36:2)_M+H2CO2_feature1"                                                                              
+#> [240] "Cer(d40:2)_M+H2CO2_feature2"                                                                              
+#> [241] "Cer(d41:2)_M+H2CO2_feature2"                                                                              
+#> [242] "Cer(d42:2)_M+H2CO2_feature3"                                                                              
+#> [243] "FA(22:6)_feature1"                                                                                        
+#> [244] "LPE(O-15:0)_feature1"                                                                                     
+#> [245] "PC(32:0)>PC(16:0_16:0)_M+H2CO2_feature2"                                                                  
+#> [246] "PC(34:2)>PC(16:0_18:2)_M+H2CO2_feature1"                                                                  
+#> [247] "PC(35:2)>PC(17:0_18:2)_M+H2CO2_feature2"                                                                  
+#> [248] "PC(36:0)>PC(18:0/18:0)_M+H2CO2_feature3"                                                                  
+#> [249] "PC(36:2)>PC(18:0_18:2)_M+H2CO2_feature3"                                                                  
+#> [250] "PC(36:3)>PC(18:1_18:2)_M+H2CO2_feature2"                                                                  
+#> [251] "PC(36:4)>PC(18:2/18:2)_M+H2CO2_feature2"                                                                  
+#> [252] "PC(40:6)>PC(18:0_22:6) _M+H2CO2_feature3"                                                                 
+#> [253] "PE(34:1)>PE(16:0_18:1)_feature1"                                                                          
+#> [254] "PE(34:2)>PE(16:0_18:2)_feature2"                                                                          
+#> [255] "PE(36:2)>PE(18:0_18:2)_feature2"                                                                          
+#> [256] "PE(36:2)>PE(18:1/18:1)_feature2"                                                                          
+#> [257] "PE(36:3)>PE(18:1_18:2)_feature1"                                                                          
+#> [258] "PE(36:4)>(16:0_20:4)_feature3"                                                                            
+#> [259] "PE(38:4)>PE(16:0_22:4)_feature4"                                                                          
+#> [260] "PE(38:5)>PE(16:0_22:5)_and_PE(38:5)>PE(18:1_20:4)_feature3"                                               
+#> [261] "PE(O-34:3)>PE(O-16:1/18:2)_feature1"                                                                      
+#> [262] "PS(36:2)>PS(18:0_18:2)_feature4"                                                                          
+#> [263] "PS(38:4)>PS(18:0_20:4)_feature6"                                                                          
+#> [264] "SM(d40:2)_M+H2CO2_feature2"                                                                               
+#> [265] "SM(d41:2)_M+H2CO2_feature1"                                                                               
+#> [266] "SM(d42:2)_M+H2CO2_feature1and2"                                                                           
+#> [267] "1-methylnicotinamide"                                                                                     
+#> [268] "2'-deoxycytidine"                                                                                         
+#> [269] "2-aminoisobutyrate"                                                                                       
+#> [270] "4-aminohippurate"                                                                                         
+#> [271] "4-pyridoxate"                                                                                             
+#> [272] "5-methylcytidine"                                                                                         
+#> [273] "7-methylguanine"                                                                                          
+#> [274] "ADMA"                                                                                                     
+#> [275] "C-glycosyltryptophan"                                                                                     
+#> [276] "C16-OH carnitine"                                                                                         
+#> [277] "C16:0 LPE"                                                                                                
+#> [278] "C16:0 SM"                                                                                                 
+#> [279] "C16:1 SM"                                                                                                 
+#> [280] "C18:0 LPC"                                                                                                
+#> [281] "C18:0 LPE A"                                                                                              
+#> [282] "C18:0 SM"                                                                                                 
+#> [283] "C18:1 LPC"                                                                                                
+#> [284] "C18:1 LPE"                                                                                                
+#> [285] "C18:1 SM"                                                                                                 
+#> [286] "C18:1-OH carnitine"                                                                                       
+#> [287] "C18:2 LPC"                                                                                                
+#> [288] "C18:2 LPE"                                                                                                
+#> [289] "C18:3 LPE"                                                                                                
+#> [290] "C20:0 LPE"                                                                                                
+#> [291] "C20:1 LPC"                                                                                                
+#> [292] "C20:4 LPC A"                                                                                              
+#> [293] "C20:4 LPC B"                                                                                              
+#> [294] "C20:4 LPE"                                                                                                
+#> [295] "C20:5 LPC"                                                                                                
+#> [296] "C24:1 ceramide (d18:1)"                                                                                   
+#> [297] "C3-DC carnitine"                                                                                          
+#> [298] "C34:2 PE"                                                                                                 
+#> [299] "C34:2 PE plasmalogen"                                                                                     
+#> [300] "C34:3 PC plasmalogen"                                                                                     
+#> [301] "C34:3 PE plasmalogen"                                                                                     
+#> [302] "C36:2 PE"                                                                                                 
+#> [303] "C36:3 PE plasmalogen"                                                                                     
+#> [304] "C36:4 PE"                                                                                                 
+#> [305] "C36:5 PE plasmalogen"                                                                                     
+#> [306] "C38:4 PE"                                                                                                 
+#> [307] "C38:5 PE plasmalogen"                                                                                     
+#> [308] "C38:6 PE plasmalogen"                                                                                     
+#> [309] "C38:7 PC plasmalogen"                                                                                     
+#> [310] "L-alpha-glutamyl-L-Lysine"                                                                                
+#> [311] "N-acetylaspartate"                                                                                        
+#> [312] "N-acetylserotonin"                                                                                        
+#> [313] "N-carbamoyl-beta-alanine"                                                                                 
+#> [314] "N-lauroylglycine"                                                                                         
+#> [315] "N-methylproline"                                                                                          
+#> [316] "N1-methyl-2-pyridone-5-carboxamide"                                                                       
+#> [317] "N6,N6-dimethyllysine"                                                                                     
+#> [318] "N6-acetyllysine"                                                                                          
+#> [319] "N6-methyllysine"                                                                                          
+#> [320] "S-methyl-L-cysteine-S-oxide"                                                                              
+#> [321] "acisoga"                                                                                                  
+#> [322] "ala-ala"                                                                                                  
+#> [323] "allantoin"                                                                                                
+#> [324] "beta-guanidinopropionate"                                                                                 
+#> [325] "betaine"                                                                                                  
+#> [326] "biotin"                                                                                                   
+#> [327] "creatinine"                                                                                               
+#> [328] "cyclohexylamine"                                                                                          
+#> [329] "cystine"                                                                                                  
+#> [330] "dimethylglycine"                                                                                          
+#> [331] "ectoine"                                                                                                  
+#> [332] "guanidinoacetate"                                                                                         
+#> [333] "imidazoleacetate"                                                                                         
+#> [334] "methionine sulfoxide"                                                                                     
+#> [335] "methylguanidine"                                                                                          
+#> [336] "nicotinate"                                                                                               
+#> [337] "oxypurinol"                                                                                               
+#> [338] "pantothenol"                                                                                              
+#> [339] "phenylacetylglycine"                                                                                      
+#> [340] "pipecolate"                                                                                               
+#> [341] "proline-betaine"                                                                                          
+#> [342] "pyridoxine"                                                                                               
+#> [343] "thiamine"                                                                                                 
+#> [344] "vitamin A"                                                                                                
+#> [345] "3-hydroxyphenyl-valerate"                                                                                 
+#> [346] "Car(11:0)"                                                                                                
+#> [347] "Car(16:1)"                                                                                                
+#> [348] "Car(16:2)"                                                                                                
+#> [349] "Car(16:3)"                                                                                                
+#> [350] "Car(5:0-OH)"                                                                                              
+#> [351] "Car(8:1)"                                                                                                 
+#> [352] "DG(18:1_18:1)"                                                                                            
+#> [353] "DG(32:0)"                                                                                                 
+#> [354] "DG(32:1)"                                                                                                 
+#> [355] "DG(34:2)"                                                                                                 
+#> [356] "DG(36:3)"                                                                                                 
+#> [357] "Glu-Phe"                                                                                                  
+#> [358] "LPC(15:0)"                                                                                                
+#> [359] "LPC(16:0)_a_b"                                                                                            
+#> [360] "LPC(16:0)_b"                                                                                              
+#> [361] "LPC(18:1)_b"                                                                                              
+#> [362] "LPC(18:2)_a_b"                                                                                            
+#> [363] "LPC(18:2)_b"                                                                                              
+#> [364] "LPC(20:0)"                                                                                                
+#> [365] "LPC(20:3)_b"                                                                                              
+#> [366] "LPC(20:4)_a_b"                                                                                            
+#> [367] "LPC(20:4)_b"                                                                                              
+#> [368] "LPE(18:0)_b"                                                                                              
+#> [369] "LPE(18:2)_b"                                                                                              
+#> [370] "MG(14:0)"                                                                                                 
+#> [371] "MG(16:0)"                                                                                                 
+#> [372] "N-acetylneuraminate"                                                                                      
+#> [373] "N-undecanoylglycine"                                                                                      
+#> [374] "PC(28:0)"                                                                                                 
+#> [375] "PC(32:0)"                                                                                                 
+#> [376] "PC(32:1)"                                                                                                 
+#> [377] "PC(33:2)"                                                                                                 
+#> [378] "PC(34:2)"                                                                                                 
+#> [379] "PC(35:2)"                                                                                                 
+#> [380] "PC(36:3)"                                                                                                 
+#> [381] "PC(36:4)"                                                                                                 
+#> [382] "PC(38:6)"                                                                                                 
+#> [383] "SM(d42:2)"                                                                                                
+#> [384] "alpha-tocopherol"                                                                                         
+#> [385] "benzylbutylphthalate"                                                                                     
+#> [386] "bis(2-ethylhexyl)phthalate"                                                                               
+#> [387] "cholesterol"                                                                                              
+#> [388] "deoxyguanosine"                                                                                           
+#> [389] "diethylphthalate"                                                                                         
+#> [390] "monoethylhexyl phthalate"                                                                                 
+#> [391] "oleamide"                                                                                                 
+#> [392] "pyridoxamine"                                                                                             
+#> [393] "sphinganine (C16)"                                                                                        
+#> [394] "2-hydroxybutyrate"                                                                                        
+#> [395] "3-hydroxybutyrate"                                                                                        
+#> [396] "FA(14:1)"                                                                                                 
+#> [397] "alpha-muricholate"                                                                                        
+#> [398] "beta-muricholate"                                                                                         
+#> [399] "chenodeoxycholate"                                                                                        
+#> [400] "cholate"                                                                                                  
+#> [401] "hydroxyindole acetate"                                                                                    
+#> [402] "omega-muricholate"                                                                                        
+#> [403] "tauro-alpha-muricholate"                                                                                  
+#> [404] "tauro-alpha-muricholate + tauro-beta-muricholiate"                                                        
+#> [405] "taurohyocoholate"                                                                                         
+#> [406] "ursodeoxycholate"                                                                                         
+#> [407] "N-acetyl-D-glucosamine-1-phosphate"                                                                       
+#> [408] "deoxyuridine"                                                                                             
+#> [409] "gluconate"                                                                                                
+#> [410] "glyceraldehyde-3-phosphate"                                                                               
+#> [411] "hexose"                                                                                                   
+#> [412] "oxidized glutathione"                                                                                     
+#> [413] "phosphoserine"                                                                                            
+#> [414] "ribose 5-phosphate"                                                                                       
+#> [415] "sedoheptulose-7-phosphate"                                                                                
+#> 
+#> $M2
+#>   [1] "ADP"                                                                                    
+#>   [2] "AMP"                                                                                    
+#>   [3] "ATP"                                                                                    
+#>   [4] "biliverdin"                                                                             
+#>   [5] "C10 carnitine"                                                                          
+#>   [6] "C4 carnitine"                                                                           
+#>   [7] "C5 carnitine"                                                                           
+#>   [8] "C5:1 carnitine"                                                                         
+#>   [9] "C6 carnitine"                                                                           
+#>  [10] "C8 carnitine"                                                                           
+#>  [11] "cis-aconitate"                                                                          
+#>  [12] "CMP"                                                                                    
+#>  [13] "GDP"                                                                                    
+#>  [14] "glucose"                                                                                
+#>  [15] "GMP"                                                                                    
+#>  [16] "IMP"                                                                                    
+#>  [17] "NAD+"                                                                                   
+#>  [18] "NADH"                                                                                   
+#>  [19] "NADP+"                                                                                  
+#>  [20] "NADPH"                                                                                  
+#>  [21] "niacinamide"                                                                            
+#>  [22] "pantothenate"                                                                           
+#>  [23] "PC(34:3)"                                                                               
+#>  [24] "PE(38:5)_feature4"                                                                      
+#>  [25] "serotonin"                                                                              
+#>  [26] "SM(d35:1)_feature1"                                                                     
+#>  [27] "SM(d36:1)_feature1"                                                                     
+#>  [28] "alpha-glycerophosphocholine"                                                            
+#>  [29] "UDP"                                                                                    
+#>  [30] "UMP"                                                                                    
+#>  [31] "urate"                                                                                  
+#>  [32] "UTP"                                                                                    
+#>  [33] "CoA(2:0)"                                                                               
+#>  [34] "Linoleoyl-EA"                                                                           
+#>  [35] "CoA(10:0)"                                                                              
+#>  [36] "CoA(10:1)"                                                                              
+#>  [37] "CoA(10:3)"                                                                              
+#>  [38] "CoA(11:0)"                                                                              
+#>  [39] "CoA(12:0)"                                                                              
+#>  [40] "CoA(12:1)"                                                                              
+#>  [41] "CoA(14:0-OH)"                                                                           
+#>  [42] "CoA(16:2)"                                                                              
+#>  [43] "CoA(20:4)"                                                                              
+#>  [44] "CoA(21:0)"                                                                              
+#>  [45] "CoA(21:2)"                                                                              
+#>  [46] "CoA(22:4)"                                                                              
+#>  [47] "CoA(22:5)"                                                                              
+#>  [48] "CoA(2:0-COOH)_and_CoA(4:0-OH)"                                                          
+#>  [49] "CoA(3:0)"                                                                               
+#>  [50] "CoA(3:0, 3-OH)"                                                                         
+#>  [51] "CoA(3:0-COOH)"                                                                          
+#>  [52] "CoA(4:0)"                                                                               
+#>  [53] "CoA(4:0-CH3)"                                                                           
+#>  [54] "CoA(4:0-COOH)"                                                                          
+#>  [55] "CoA(4:1)"                                                                               
+#>  [56] "CoA(4:1-COOH)"                                                                          
+#>  [57] "CoA(6:0)"                                                                               
+#>  [58] "CoA(6:1)"                                                                               
+#>  [59] "CoA(8:0)"                                                                               
+#>  [60] "CoA(8:1)"                                                                               
+#>  [61] "CoA(9:0)"                                                                               
+#>  [62] "coenzyme A"                                                                             
+#>  [63] "ADP-ribose"                                                                             
+#>  [64] "CDP"                                                                                    
+#>  [65] "CTP"                                                                                    
+#>  [66] "GDP-mannose"                                                                            
+#>  [67] "GTP"                                                                                    
+#>  [68] "PRPP"                                                                                   
+#>  [69] "S-AMP"                                                                                  
+#>  [70] "UDP-galactose"                                                                          
+#>  [71] "dCTP"                                                                                   
+#>  [72] "14,15-EpETrE"                                                                           
+#>  [73] "20-HETE"                                                                                
+#>  [74] "5,6-DiHETrE"                                                                            
+#>  [75] "Resolvin D3"                                                                            
+#>  [76] "Arachidonoyl-EA"                                                                        
+#>  [77] "Cer(d34:0)>Cer(d18:0/16:0)_feature1"                                                    
+#>  [78] "DG(32:1)>DG(16:0_16:1_0:0)_feature1"                                                    
+#>  [79] "DG(34:1)>DG(16:0_18:1_0:0)_M+NH3_feature1"                                              
+#>  [80] "DG(38:3)>DG(18:2_20:1_0:0)_feature2"                                                    
+#>  [81] "PE(36:2)>PE(18:2_18:0)_feature3"                                                        
+#>  [82] "PE(38:6)_feature2"                                                                      
+#>  [83] "PE(40:5)_feature1"                                                                      
+#>  [84] "PE(40:5)_feature3"                                                                      
+#>  [85] "PE(40:5)_feature4"                                                                      
+#>  [86] "PE(40:6)_feature2"                                                                      
+#>  [87] "PE(O-34:1)_feature1"                                                                    
+#>  [88] "PE(O-34:2)>PE(O-16:1/18:1)_and_PE(O-18:2/16:0)_feature1"                                
+#>  [89] "PE(O-36:5)>PE(O-16:1/20:4)_feature2"                                                    
+#>  [90] "PE(O-37:5)>PE(O-17:1/20:4)_feature1"                                                    
+#>  [91] "PE(O-37:5)>PE(O-17:1/20:4)_feature2"                                                    
+#>  [92] "PE(O-38:6)>PE(O-18:2/20:4)_and_PE(O-16:1/22:5)_feature4"                                
+#>  [93] "PE(O-40:6)>PE(O-18:1/22:5)_feature4"                                                    
+#>  [94] "PE(O-40:6)>PE(O-18:1/22:5)_feature5"                                                    
+#>  [95] "PE(O-40:7)>PE(O-18:1/22:6)_feature7"                                                    
+#>  [96] "PE(O-40:8)>PE(O-18:2/22:6)_feature2"                                                    
+#>  [97] "PS(36:2)_feature2"                                                                      
+#>  [98] "PS(38:3)_feature2"                                                                      
+#>  [99] "SM(d34:1-OH)_feature1"                                                                  
+#> [100] "SM(d38:0)_feature 2"                                                                    
+#> [101] "SM(d42:1)_feature1"                                                                     
+#> [102] "SM(d42:1)_feature2"                                                                     
+#> [103] "SM(d42:2)_feature2"                                                                     
+#> [104] "SM(d42:3)_feature1"                                                                     
+#> [105] "SM(d44:1)_feature1"                                                                     
+#> [106] "TG(32:0)>TG(10:0_10:0_12:0)_M+NH3_feature1"                                             
+#> [107] "TG(36:1)>TG(4:0_16:0_16:1)_and_TG(2:0_16:0_18:1)_M+NH3_feature1"                        
+#> [108] "TG(36:2)>TG(2:0_16:0_18:2)_feature4"                                                    
+#> [109] "TG(36:2)>TG(8:0_10:0_18:2)_M+NH3_feature1"                                              
+#> [110] "TG(36:3)>TG(2:0_16:1_18:2)_M+NH3_feature1"                                              
+#> [111] "TG(38:0)>TG(10:0_12:0_16:0)_and_TG(10:0_10:0_18:0)_and_TG(8:0_12:0_18:0)_M+NH3_feature1"
+#> [112] "TG(38:0)>TG(10:0_12:0_16:0)_and_TG(10:0_10:0_18:0)_and_TG(8:0_12:0_18:0)_M+NH3_feature2"
+#> [113] "TG(38:0)>TG(10:0_12:0_16:0)_and_TG(10:0_10:0_18:0)_and_TG(8:0_12:0_18:0)_M+NH3_feature3"
+#> [114] "TG(38:1)>TG(10:0_10:0_18:1)_and_TG(10:0_12:0_16:1)_and_TG(8:0_12:0_18:1)_M+NH3_feature1"
+#> [115] "TG(38:1)>TG(10:0_10:0_18:1)_and_TG(10:0_12:0_16:1)_and_TG(8:0_12:0_18:1)_feature2"      
+#> [116] "TG(38:1)>TG(4:0_16:0_18:1)_feature3"                                                    
+#> [117] "TG(38:2)>TG(10:0_10:0_18:2)_and_TG(8:0_12:0_18:2)_feature2"                             
+#> [118] "TG(38:3)>TG(4:0_16:1_18:2)_M+NH3_feature1"                                              
+#> [119] "TG(38:4)>TG(2:0_18:2_18:2)_feature1"                                                    
+#> [120] "TG(39:2)_M+NH3_feature1"                                                                
+#> [121] "TG(40:0)_M+NH3_feature1"                                                                
+#> [122] "TG(40:1)_M+NH3_feature1"                                                                
+#> [123] "TG(40:1)_feature2"                                                                      
+#> [124] "TG(40:1)_feature3"                                                                      
+#> [125] "TG(40:2)>TG(10:0_12:0_18:2)_M+NH3_feature1"                                             
+#> [126] "TG(40:2)>TG(4:0_18:1_18:1)_feature2"                                                    
+#> [127] "TG(40:3)>TG(4:0_18:1_18:2)_M+NH3_feature1"                                              
+#> [128] "TG(41:2)_M+NH3_feature1"                                                                
+#> [129] "TG(42:0)>TG(10:0_16:0_16:0)_and_TG(12:0_14:0_16:0)_M+NH3_feature1"                      
+#> [130] "TG(42:4)>TG(6:0_18:2_18:2)_feature1"                                                    
+#> [131] "TG(42:4)_feature2"                                                                      
+#> [132] "TG(42:6)>TG(4:0_16:0_22:6)_M+NH3_feature1"                                              
+#> [133] "TG(46:1)>TG(12:0_16:0_18:1)_and_TG(10:0_18:0_18:1)_and_TG(14:0_16:0_16:1)_feature2"     
+#> [134] "TG(46:2)_feature2"                                                                      
+#> [135] "TG(48:3)_M+NH3_feature2"                                                                
+#> [136] "TG(48:4)>TG(12:0_18:2_18:2)_M+NH3_feature1"                                             
+#> [137] "TG(48:4)>TG(12:0_18:2_18:2)_feature2"                                                   
+#> [138] "TG(48:5)_feature2"                                                                      
+#> [139] "Cer(d42:1)_M+H2CO2_feature1"                                                            
+#> [140] "Cer(d42:2)_M+H2CO2_feature4"                                                            
+#> [141] "LPE(18:0/0:0)_and_LPC(0:0/18:0)_feature1and2"                                           
+#> [142] "PC(32:1)_feature2"                                                                      
+#> [143] "PC(34:1)>PC(16:0_18:1)_M+H2CO2_feature2"                                                
+#> [144] "PC(36:1)>PC(16:0_20:1)_and_PC(18:0_18:1)_M+H2CO2_feature1"                              
+#> [145] "PC(36:2)>PC(18:1/18:1)_M+H2CO2_feature2"                                                
+#> [146] "PC(36:4)>PC(16:0_20:4)_M+H2CO2_feature3"                                                
+#> [147] "PC(37:4)>PC(17:0_20:4)_M+H2CO2_feature3"                                                
+#> [148] "PC(38:4)>PC(18:0_20:4)_M+H2CO2_feature4"                                                
+#> [149] "PC(38:5)>PC(16:0_22:5)_and_PC(18:1_20:4)_M+H2CO2_feature3"                              
+#> [150] "PC(O-32:1)>PC(O-16:0/16:1)_M+H2CO2_feature2"                                            
+#> [151] "PC(O-36:5)>PC(O-16:1/20:4)_M+H2CO2_feature5"                                            
+#> [152] "PC(O-38:5)>PC(O-18:1/20:4)_M+H2CO2_feature2"                                            
+#> [153] "PE(36:1)>PE(18:0_18:1)_feature3"                                                        
+#> [154] "PE(40:5)>PE(18:0_22:5)_feature3"                                                        
+#> [155] "PE(O-16:1_20:4)_feature3"                                                               
+#> [156] "PE(O-34:2)>PE(O-16:2/18:0)_and_PE(O-18:2/16:0)_feature2"                                
+#> [157] "PE(O-34:5)>PE(O-17:1/20:4)_feature1"                                                    
+#> [158] "PE(O-34:5)>PE(O-17:1/20:4)_feature2"                                                    
+#> [159] "PE(O-38:7)>PE(O-18:3/20:4)_feature1"                                                    
+#> [160] "PE(O-40:4)>PE(O-18:0/22:4)_feature4"                                                    
+#> [161] "PG(34:1)>PG(16:0_18:1)_feature1"                                                        
+#> [162] "PI(36:4)>PI(16:0_20:4)_feature1"                                                        
+#> [163] "PS(O-40:7)>PS(O-18:3/22:4)_feature1"                                                    
+#> [164] "PS(O-40:7)>PS(O-20:3/20:4)_feature2"                                                    
+#> [165] "SM(d40:0-OH)_feature1"                                                                  
+#> [166] "SM(d40:1)_M+H2CO2_feature2"                                                             
+#> [167] "SM(d40:2)_M+H2CO2_feature1"                                                             
+#> [168] "SM(d42:1)_M+H2CO2_feature2"                                                             
+#> [169] "SM(d42:2)_M+H2CO2_feature1"                                                             
+#> [170] "1-methylhistamine"                                                                      
+#> [171] "21-deoxycortisol"                                                                       
+#> [172] "3-methylhistidine"                                                                      
+#> [173] "C14:0 SM"                                                                               
+#> [174] "C16:0 LPC"                                                                              
+#> [175] "C16:1 LPC plasmalogen"                                                                  
+#> [176] "C18:0 LPE B"                                                                            
+#> [177] "C18:3 LPC"                                                                              
+#> [178] "C3-DC-CH3 carnitine"                                                                    
+#> [179] "C36:5 PC plasmalogen"                                                                   
+#> [180] "N-acetylhistamine"                                                                      
+#> [181] "N-acetylornithine"                                                                      
+#> [182] "N6,N6,N6-trimethyllysine"                                                               
+#> [183] "arachidoyl ethanolamide"                                                                
+#> [184] "cotinine N-oxide"                                                                       
+#> [185] "histamine"                                                                              
+#> [186] "hypotaurine"                                                                            
+#> [187] "imidazole propionate"                                                                   
+#> [188] "phosphocholine"                                                                         
+#> [189] "Car(10:0-OH)"                                                                           
+#> [190] "Car(3:0, 2-CH3)"                                                                        
+#> [191] "Car(4:0)"                                                                               
+#> [192] "Car(4:0,3-CH3)"                                                                         
+#> [193] "Car(5:0)"                                                                               
+#> [194] "Car(8:0-OH)"                                                                            
+#> [195] "Ile-Val"                                                                                
+#> [196] "Leu-Ile"                                                                                
+#> [197] "PC(34:4)"                                                                               
+#> [198] "Phe-Phe"                                                                                
+#> [199] "Ser-Leu"                                                                                
+#> [200] "gamma-glutamyltyrosine"                                                                 
+#> [201] "pyroglutamate"                                                                          
+#> [202] "FA(10:0-OH)"                                                                            
+#> [203] "FA(12:0)"                                                                               
+#> [204] "FA(12:0-OH)"                                                                            
+#> [205] "FA(14:0-OH)"                                                                            
+#> [206] "FA(14:2)"                                                                               
+#> [207] "FA(8:0-OH)"                                                                             
+#> [208] "indole lactate"                                                                         
+#> [209] "indoleacrylate"                                                                         
+#> [210] "phenyllactate"                                                                          
+#> [211] "tauro-beta-muricholate"                                                                 
+#> [212] "uridine"                                                                                
+#> [213] "2-phosphoglycerate+3-phosphoglycerate"                                                  
+#> [214] "6-phosphogluconate"                                                                     
+#> [215] "FAD"                                                                                    
+#> [216] "UDP-N-acetylglucosamine"                                                                
+#> [217] "UDP-glucose"                                                                            
+#> [218] "UDP-glucuronate"                                                                        
+#> [219] "glycerol 3-phosphate"                                                                   
+#> [220] "pyruvate"                                                                               
+#> [221] "ribose 5-phosphate+ribulose 5-phosphate+xylulose 5-phosphate"                           
+#> 
+#> $M3
+#>   [1] "Car(16:0)_feature1"                                       
+#>   [2] "Car(20:4)_feature1"                                       
+#>   [3] "cytidine"                                                 
+#>   [4] "guanosine"                                                
+#>   [5] "hypoxanthine"                                             
+#>   [6] "leucine+ isoleucine"                                      
+#>   [7] "LPC(16:0/0:0)_and_LPC(0:0/16:0)_feature1and2"             
+#>   [8] "PC(40:8)_feature1"                                        
+#>   [9] "PC(O-34:1)_feature2"                                      
+#>  [10] "PE(38:4)>PE(18:0_20:4)_feature5"                          
+#>  [11] "PI(38:4)>PI(18:0_20:4)_feature2"                          
+#>  [12] "PS(38:4)>PS(18:0_20:4)_feature2"                          
+#>  [13] "xanthosine"                                               
+#>  [14] "CoA(11:2)"                                                
+#>  [15] "CoA(19:1)"                                                
+#>  [16] "CoA(20:1)"                                                
+#>  [17] "CoA(21:1)"                                                
+#>  [18] "CoA(22:3)"                                                
+#>  [19] "AICAR"                                                    
+#>  [20] "NMN"                                                      
+#>  [21] "XMP"                                                      
+#>  [22] "adenine"                                                  
+#>  [23] "dATP"                                                     
+#>  [24] "11,12-EpETrE"                                             
+#>  [25] "13-HODE"                                                  
+#>  [26] "5-HETE"                                                   
+#>  [27] "9-HETE"                                                   
+#>  [28] "9-HODE"                                                   
+#>  [29] "2-Hydroxyglutarate"                                       
+#>  [30] "Car(16:1)_feature1"                                       
+#>  [31] "Car(18:1)_feature1"                                       
+#>  [32] "Cer(d36:1)>Cer(d18:1/18:0)_M-H2O_feature1"                
+#>  [33] "Cer(d40:2)>Cer(d18:2/22:0)_feature2"                      
+#>  [34] "Cer(d41:2)>Cer(d18:2/23:0)_feature2"                      
+#>  [35] "Cer(d42:2)>Cer(d18:1/24:1)_feature3"                      
+#>  [36] "Cer(d42:2)>Cer(d18:2/24:0)_feature4"                      
+#>  [37] "Cer(d43:1)>Cer(d18:1/25:0)_feature1and2"                  
+#>  [38] "Cer(d44:3)>Cer(d18:2/26:1)_feature1"                      
+#>  [39] "DG(35:4)_feature1"                                        
+#>  [40] "DG(36:1)>DG(18:0_18:1_0:0)_feature2"                      
+#>  [41] "DG(36:2)>DG(18:1_18:1_0:0)_M+NH3_feature3"                
+#>  [42] "DG(36:3)>DG(18:1_18:2_0:0)_M+NH3_feature1"                
+#>  [43] "DG(38:4)>DG(16:0_22:4_0:0)_feature4"                      
+#>  [44] "DG(38:4)>DG(18:0_20:4_0:0)_feature6"                      
+#>  [45] "DG(38:5)>DG(18:1_20:4_0:0)_feature2"                      
+#>  [46] "DG(38:6)>DG(18:2_20:4_0:0)_feature1"                      
+#>  [47] "DG(40:4)>DG(18:0_22:4_0:0)_M+NH3_feature2"                
+#>  [48] "DG(40:6)>DG(18:0_22:6_0:0)_feature6"                      
+#>  [49] "DG(40:7)>DG(18:1_22:6_0:0)_M+NH3_feature3"                
+#>  [50] "Hex2Cer(d42:1)>Hex2Cer(d18:1/24:0)_feature1"              
+#>  [51] "HexCer(d40:1)>HexCer(d18:1/22:0)_feature3"                
+#>  [52] "HexCer(d40:1)>HexCer(d18:1_22:0)_feature2"                
+#>  [53] "HexCer(d42:2)>HexCer(d18:1/24:1)_feature3"                
+#>  [54] "LPC(17:0/0:0)_and_LPC(0:0/17:0)_feature1and2"             
+#>  [55] "LPC(18:0)>LPC(18:0/0:0)_and_LPC(0:0/18:0)_feature1and2"   
+#>  [56] "LPC(18:1)>LPC(18:1/0:0)_and_LPC(0:0/18:1)_feature1and2"   
+#>  [57] "LPC(18:2)>LPC(18:2/0:0)_and_LPC(0:0/18:2)_feature1and2"   
+#>  [58] "LPC(19:0)>LPC(0:0/19:0)_feature1"                         
+#>  [59] "LPC(20:0/0:0)_and_LPC(0:0/20:0)_feature1and2"             
+#>  [60] "LPC(20:1)>LPC(20:1/0:0)_and_LPC(0:0/20:1)_feature1and2"   
+#>  [61] "LPC(20:4)>LPC(20:4/0:0)_and_LPC(0:0/20:4)_feature1and2"   
+#>  [62] "LPE(18:0)>LPE(18:0/0:0)_and_LPE(0:0/18:0)_feature1and2"   
+#>  [63] "PC(30:0)_feature2"                                        
+#>  [64] "PC(31:0)_feature2"                                        
+#>  [65] "PC(32:0)_feature1"                                        
+#>  [66] "PC(32:0)_feature2"                                        
+#>  [67] "PC(32:1)_feature1"                                        
+#>  [68] "PC(32:2)_feature1"                                        
+#>  [69] "PC(33:0)_feature3"                                        
+#>  [70] "PC(33:1)_feature1"                                        
+#>  [71] "PC(34:0)_feature4"                                        
+#>  [72] "PC(34:1)_feature2"                                        
+#>  [73] "PC(36:3)_feature2"                                        
+#>  [74] "PC(36:4)_feature2"                                        
+#>  [75] "PC(37:2)_feature2"                                        
+#>  [76] "PC(38:1)_feature1"                                        
+#>  [77] "PC(38:3)_feature2"                                        
+#>  [78] "PC(38:3)_feature3"                                        
+#>  [79] "PC(38:4)_feature4"                                        
+#>  [80] "PC(38:5)_feature3"                                        
+#>  [81] "PC(38:6)_feature1"                                        
+#>  [82] "PC(38:6)_feature2"                                        
+#>  [83] "PC(39:4)_feature3"                                        
+#>  [84] "PC(39:4)_feature5"                                        
+#>  [85] "PC(39:5)_feature2"                                        
+#>  [86] "PC(39:5)_feature6"                                        
+#>  [87] "PC(40:4)_feature2"                                        
+#>  [88] "PC(40:5)_feature4"                                        
+#>  [89] "PC(40:6)_feature3"                                        
+#>  [90] "PC(40:7)_feature3"                                        
+#>  [91] "PC(42:4)_feature4"                                        
+#>  [92] "PC(O-31:0)_feature2"                                      
+#>  [93] "PC(O-34:0)_feature1"                                      
+#>  [94] "PC(O-36:4)_feature4"                                      
+#>  [95] "PC(O-38:4)_feature4"                                      
+#>  [96] "PC(O-38:4)_feature6"                                      
+#>  [97] "PC(O-40:6)_feature1"                                      
+#>  [98] "PC(O-40:7)_feature3"                                      
+#>  [99] "PE(34:1)_feature1"                                        
+#> [100] "PE(36:1)_feature3"                                        
+#> [101] "PE(36:2)>PE(18:2_18:0)_feature2"                          
+#> [102] "PE(36:4)_feature3"                                        
+#> [103] "PE(36:5)_feature2"                                        
+#> [104] "PE(38:3)>PE(18:0_20:3)_feature2"                          
+#> [105] "PE(38:3)>PE(18:0_20:3)_feature3"                          
+#> [106] "PE(38:4)>PE(18:0_20:4)_feature8"                          
+#> [107] "PE(38:6)_feature3"                                        
+#> [108] "coenzyme(Q8)_feature1"                                    
+#> [109] "eucramide 2M_feature1"                                    
+#> [110] "LPC(18:0/0:0)_and_LPC(0:0/18:0)_M+H2CO2_feature1and2"     
+#> [111] "LPE(20:0_0:0)_and_LPE(0:0/20:0)_feature1and2"             
+#> [112] "PC(32:1)>PC(14:0_18:1)_and_PC(16:0_16:1)_M+H2CO2_feature1"
+#> [113] "PC(38:6)>PC(18:2_20:4)_M+H2CO2_feature1"                  
+#> [114] "PC(O-38:5)>PC(O-18:1/20:4)_M+H2CO2_feature1"              
+#> [115] "PE(O-40:5)>PE(O-18:1/22:4)_feature3"                      
+#> [116] "PE(O-40:6)>PE(O-18:1/22:5)_feature3"                      
+#> [117] "PI(38:5)>PI(18:1_20:4)_feature1"                          
+#> [118] "PS(36:1)>PS(18:0_18:1)_feature1"                          
+#> [119] "PS(40:4)>PS(18:0_22:4)_feature1"                          
+#> [120] "PS(40:5)>PS(18:0_22:5)_feature2"                          
+#> [121] "PS(O-42:7)>PS(O-20:3/22:4)_feature1"                      
+#> [122] "4-guanidinobutanoate"                                     
+#> [123] "C18:1 LPC plasmalogen A"                                  
+#> [124] "C18:1 LPC plasmalogen B"                                  
+#> [125] "C38:6 PC plasmalogen"                                     
+#> [126] "C7 carnitine"                                             
+#> [127] "N-alpha-acetylarginine"                                   
+#> [128] "N1-acetylspermidine"                                      
+#> [129] "NMMA"                                                     
+#> [130] "S-adenosylmethionine"                                     
+#> [131] "SDMA"                                                     
+#> [132] "biopterin"                                                
+#> [133] "methylimidazoleacetate"                                   
+#> [134] "Car(10:1)"                                                
+#> [135] "LPC(17:0)_a_b"                                            
+#> [136] "uracil"                                                   
+#> [137] "glutarate"                                                
+#> 
+#> $M4
+#>  [1] "carnitine"                                                        
+#>  [2] "glycocholate"                                                     
+#>  [3] "hippurate"                                                        
+#>  [4] "PE(O-36:5)>PE(O-16:1/20:4)_feature3"                              
+#>  [5] "PE(O-38:5)>PE(O-16:1/22:4)_feature5"                              
+#>  [6] "PE(O-38:5)>PE(O-18:1/20:4)_feature6"                              
+#>  [7] "PE(O-38:6)>PE(O-18:2/20:4)_and_PE(O-16:1/22:5)_feature2"          
+#>  [8] "PE(O-40:6)>PE(O-18:2/22:4)_feature2"                              
+#>  [9] "SM(d32:1)_feature1"                                               
+#> [10] "SM(d34:1)_feature1"                                               
+#> [11] "SM(d36:2)_feature1"                                               
+#> [12] "CoA(12:2)"                                                        
+#> [13] "CoA(15:1)"                                                        
+#> [14] "CoA(15:2)"                                                        
+#> [15] "CoA(17:1)"                                                        
+#> [16] "CoA(22:2)"                                                        
+#> [17] "9,10-DiHOME"                                                      
+#> [18] "PGE2"                                                             
+#> [19] "PC(O-38:5)_feature3"                                              
+#> [20] "PC(O-38:7)_feature1"                                              
+#> [21] "PE(36:4)_feature1"                                                
+#> [22] "PE(40:8)_feature1"                                                
+#> [23] "PE(O-36:2)>PE(O-18:1/18:1)_feature2"                              
+#> [24] "PE(O-36:3)>PE(O-18:2/18:1)_feature4"                              
+#> [25] "PE(O-36:3)_feature2"                                              
+#> [26] "PE(O-38:4)_feature4"                                              
+#> [27] "PE(O-38:5)_feature3"                                              
+#> [28] "PE(O-38:7)>PE(O-16:1/22:6)_feature2"                              
+#> [29] "PE(O-40:5)>PE(O-18:1/22:4)_feature4"                              
+#> [30] "PE(O-40:5)>PE(O-18:1/22:4)_feature5"                              
+#> [31] "PS(36:1)_feature1"                                                
+#> [32] "PS(36:2)_feature3"                                                
+#> [33] "PS(40:5)_feature2"                                                
+#> [34] "SM(d33:1)_feature1"                                               
+#> [35] "SM(d37:1)_feature1"                                               
+#> [36] "SM(d38:2)_feature2"                                               
+#> [37] "SM(d40:0)_feature1"                                               
+#> [38] "SM(d40:1)_feature2"                                               
+#> [39] "SM(d40:2)_feature1"                                               
+#> [40] "SM(d40:2)_feature2"                                               
+#> [41] "SM(d41:0)_feature1"                                               
+#> [42] "SM(d41:2)_feature1"                                               
+#> [43] "SM(d41:2)_feature2"                                               
+#> [44] "SM(d41:2)_feature3"                                               
+#> [45] "SM(d43:1)_feature2"                                               
+#> [46] "SM(d44:3)_feature1"                                               
+#> [47] "TG(30:0)>TG(10:0/10:0/10:0)_and_TG(8:0_10:0_12:0)_M+NH3_feature1" 
+#> [48] "TG(34:0)>TG(10:0_10:0_14:0)_and_TG(10:0_12:0_12:0)_M+NH3_feature1"
+#> [49] "TG(34:0)>TG(4:0_14:0_16:0)_M+NH3_feature3"                        
+#> [50] "TG(36:0)>TG(10:0_10:0_16:0)_M+NH3_feature2"                       
+#> [51] "TG(36:0)>TG(4:0_16:0_16:0)_M+NH3_feature4"                        
+#> [52] "TG(40:0)_M+NH3_feature2"                                          
+#> [53] "TG(40:3)>TG(4:0_18:1_18:2)_feature2"                              
+#> [54] "sn-glycero-3-phosphocholine"                                      
+#> [55] "Cer(d41:1)_M+H2CO2_feature1"                                      
+#> [56] "Hex2Cer(d40:3)_feature1"                                          
+#> [57] "HexCer(d41:1-OH)_M+H2CO2_feature1"                                
+#> [58] "HexCer(d41:1-OH)_M+H2CO2_feature2"                                
+#> [59] "PC(38:3)>PC(18:0_20:3)_M+H2CO2_feature3"                          
+#> [60] "PE(38:6)>PE(16:0_22:6)_feature3"                                  
+#> [61] "PE(40:7)>PE(18:1_22:6)_and_PE(18:0_22:7)_feature3"                
+#> [62] "PE(O-38:7)>PE(O-16:1/22:6)_and_PE(O-20:7/18:0)_feature2"          
+#> [63] "1-methyladenosine"                                                
+#> [64] "5-methylcytosine"                                                 
+#> [65] "C20:0 SM"                                                         
+#> [66] "C22:0 SM"                                                         
+#> [67] "C22:1 SM"                                                         
+#> [68] "C22:6 LPE"                                                        
+#> [69] "C24:0 LPC"                                                        
+#> [70] "C34:0 PE"                                                         
+#> [71] "C36:2 PS plasmalogen"                                             
+#> [72] "C38:6 PE"                                                         
+#> [73] "C38:7 PE plasmalogen"                                             
+#> [74] "C40:6 PE"                                                         
+#> [75] "C40:7 PE plasmalogen"                                             
+#> [76] "N-acetylputrescine"                                               
+#> [77] "N4-acetylcytidine"                                                
+#> [78] "acetylcholine"                                                    
+#> [79] "putrescine"                                                       
+#> [80] "trigonelline"                                                     
+#> [81] "trimethylamine-N-oxide"                                           
+#> [82] "Ile-Pro"                                                          
+#> [83] "Leu-Pro"                                                          
+#> [84] "PC(34:1)"                                                         
+#> [85] "PC(40:6)"                                                         
+#> [86] "SM(d40:1)"                                                        
+#> [87] "SM(d42:1)"                                                        
+#> [88] "FA(16:0-COOH)"                                                    
+#> [89] "FA(16:0-OH)"                                                      
+#> [90] "FA(18:4)"                                                         
+#> [91] "N-acetylphenylalanine"                                            
+#> [92] "glycochenodeoxycholate"                                           
+#> [93] "glycohyocholate"                                                  
+#> [94] "hydroxyphenyllactic acid"                                         
+#> [95] "maleate"                                                          
+#> [96] "fructose 1,6-biphosphate"                                         
+#> [97] "fructose 6-phosphate"                                             
+#> [98] "hexose phosphate"                                                 
+#> [99] "phosphocreatine"                                                  
+#> 
+#> $M5
+#>  [1] "Car(18:0)_feature1"                                      
+#>  [2] "C4-OH carnitine"                                         
+#>  [3] "gamma-glutamylisoleucine"                                
+#>  [4] "LPC(14:0)"                                               
+#>  [5] "LPC(16:1)_a_b"                                           
+#>  [6] "PC(40:5)_feature3"                                       
+#>  [7] "PC(O-32:0)_feature1"                                     
+#>  [8] "PE(40:4)>PE(18:0_22:4)_feature2"                         
+#>  [9] "sphingosine"                                             
+#> [10] "Phosphoethanolamine"                                     
+#> [11] "CoA(15:0)_and_CoA(C14:1-OH)"                             
+#> [12] "14,15-DiHETrE"                                           
+#> [13] "Isocitrate"                                              
+#> [14] "Cer(d42:3)_feature2"                                     
+#> [15] "DG(32:0)>DG(16:0_16:0_0:0)_M+NH3_feature1"               
+#> [16] "DG(32:0)>DG(16:0_16:0_0:0)_M+NH3_feature2"               
+#> [17] "DG(34:1)>DG(16:0_18:1_0:0)_M+NH3_feature2"               
+#> [18] "DG(36:1)>DG(18:0_18:1_0:0)_M+NH3_feature1"               
+#> [19] "DG(36:2)>DG(18:0_18:2_0:0)_M+NH3_feature2"               
+#> [20] "DG(36:3)>DG(18:1_18:2_0:0)_M+NH3_feature2"               
+#> [21] "DG(36:4)>DG(16:0_20:4_0:0)_M+NH3_feature2"               
+#> [22] "DG(40:4)>DG(18:0_22:4_0:0)_M+NH3_feature3"               
+#> [23] "EA(15:0)_feature1"                                       
+#> [24] "EA(17:0)_feature1"                                       
+#> [25] "EA(18:0)_feature1"                                       
+#> [26] "EA(22:0)_feature1"                                       
+#> [27] "HexCer(d40:1-OH)>HexCer(d18:1/22:0-OH)_feature2"         
+#> [28] "HexCer(d40:2)>HexCer(d18:1/22:1)_feature3"               
+#> [29] "HexCer(d42:1)>HexCer(d18:1/24:0)_feature1"               
+#> [30] "PC(34:2)_feature1"                                       
+#> [31] "PC(34:3)_feature3"                                       
+#> [32] "PC(35:1)_feature1"                                       
+#> [33] "PC(35:2)_feature1"                                       
+#> [34] "PC(35:4)_feature2"                                       
+#> [35] "PC(36:2)_M+Na_feature2"                                  
+#> [36] "PC(36:3)_feature1"                                       
+#> [37] "PC(36:3)_feature3"                                       
+#> [38] "PC(36:5)_feature3"                                       
+#> [39] "PC(37:1)_feature3"                                       
+#> [40] "PC(37:4)_feature3"                                       
+#> [41] "PC(37:4)_feature4"                                       
+#> [42] "PC(38:2)_feature3"                                       
+#> [43] "PC(38:2)_feature5"                                       
+#> [44] "PC(38:3)_feature4"                                       
+#> [45] "PC(40:2)_feature2"                                       
+#> [46] "PC(40:5)_feature1"                                       
+#> [47] "PC(40:6)_feature2"                                       
+#> [48] "PC(40:7)_feature2"                                       
+#> [49] "PC(42:5)_feature6"                                       
+#> [50] "PC(42:8)_feature2"                                       
+#> [51] "PC(O-30:0)_feature1"                                     
+#> [52] "PC(O-32:1)_feature2"                                     
+#> [53] "PC(O-34:2)_feature1"                                     
+#> [54] "PC(O-36:1)_feature3"                                     
+#> [55] "PC(O-36:2)_feature1"                                     
+#> [56] "PC(O-36:3)_feature1"                                     
+#> [57] "PC(O-36:4)_feature2"                                     
+#> [58] "PC(O-36:5)_feature5"                                     
+#> [59] "PC(O-38:2)_feature3"                                     
+#> [60] "PC(O-38:5)_feature1"                                     
+#> [61] "PC(O-38:6)_feature2"                                     
+#> [62] "PC(O-38:7)_feature2"                                     
+#> [63] "PE(36:3)_feature1"                                       
+#> [64] "PE(38:5)>PE(18:1_20:4)_feature3"                         
+#> [65] "Cholesterol sulfate_feature1"                            
+#> [66] "HexCer(d40:1)_M+H2CO2_feature2"                          
+#> [67] "HexCer(d42:1)_M+H2CO2_feature2"                          
+#> [68] "HexCer(d42:2)_M+H2CO2_feature3"                          
+#> [69] "PE(40:6)>PE(18:0_22:6)_feature2"                         
+#> [70] "PE(O-36:3)>PE(O-18:1/18:2)_feature6"                     
+#> [71] "PE(O-36:3)>PE(O-18:2/18:1)_feature3"                     
+#> [72] "PE(O-36:4)>PE(O-18:2/18:2)_feature1"                     
+#> [73] "PE(O-36:4)>PE(O-18:3/18:1)_feature6"                     
+#> [74] "PE(O-40:7)>PE(O-18:1/22:6)_and_PE(O-22:7/18:0)_feature10"
+#> [75] "PE(O-40:8)>PE(O-22:8/18:0)_and_PE(O-18:2/22:6)_feature2" 
+#> [76] "SM(d38:1)_M+H2CO2_feature2"                              
+#> [77] "N-acetylhistidine"                                       
+#> [78] "butyrobetaine"                                           
+#> [79] "phytosphingosine"                                        
+#> [80] "3-indolepropionate"                                      
+#> [81] "FA(12:0-NH2)"                                            
+#> [82] "Ile-Ile"                                                 
+#> [83] "N-gammaglutamylmethionine"                               
+#> [84] "bilirubin"                                               
+#> [85] "kynurenine"                                              
+#> [86] "citrate+isocitrate"                                      
+#> 
+#> $M6
+#>  [1] "3-methyl-2-oxovalerate"     "5'-methylthioadenosine"    
+#>  [3] "Alanine"                    "Arginine"                  
+#>  [5] "Asparagine"                 "Aspartic Acid"             
+#>  [7] "beta-Alanine"               "Citrate"                   
+#>  [9] "Citrulline"                 "Fumarate"                  
+#> [11] "gamma-Amino-N-butyric-acid" "Glutamic Acid"             
+#> [13] "Glutamine"                  "Glycine"                   
+#> [15] "guanine"                    "Histidine"                 
+#> [17] "Hydroxyproline"             "Isoleucine"                
+#> [19] "ketoleucine"                "Lactate"                   
+#> [21] "Leucine"                    "Malate"                    
+#> [23] "Methionine"                 "Ornithine"                 
+#> [25] "Phenylalanine"              "Proline"                   
+#> [27] "S-allylcysteine"            "Serine"                    
+#> [29] "Succinate"                  "Taurine"                   
+#> [31] "Threonine"                  "Tryptophan"                
+#> [33] "Tyrosine"                   "Valine"                    
+#> [35] "Lysine"                     "1-Methylhistidine"         
+#> [37] "Cystathionine 1"            "Cysteine"                  
+#> [39] "Ethanolamine"               "Sarcosine"                 
+#> [41] "alpha-Aminoadipic-acid"     "CoA(11:1)"                 
+#> [43] "CoA(13:0)"                  "CoA(14:0)"                 
+#> [45] "CoA(14:1)"                  "CoA(14:2)"                 
+#> [47] "CoA(16:3)"                  "CoA(18:0)"                 
+#> [49] "CoA(18:1)"                  "CoA(18:2)"                 
+#> [51] "CoA(18:3)"                  "CoA(19:0)"                 
+#> [53] "CoA(19:2)"                  "CoA(20:0)"                 
+#> [55] "CoA(20:2)"                  "CoA(20:3)"                 
+#> [57] "CoA(22:1)"                  "CoA(22:6)"                 
+#> [59] "CoA(4:1-CH3)"               "S-adenosylhomocysteine"    
+#> [61] "11,12-DiHETrE"              "12-HETE"                   
+#> [63] "8,9-EpETrE"                 "ketoisovalerate"           
+#> [65] "Ketoglutarate"              "SM(d42:3)_M+H2CO2_feature1"
+#> [67] "MG(18:1)_a_b"               "MG(18:1)_b"                
+#> [69] "glycodeoxycholate"
+
+lengths(METAB_MOD_LIST)
+#>  M1  M2  M3  M4  M5  M6  M7 
+#> 415 221 137  99  86  69  30
+#  M1  M2  M3  M4  M5  M6  M7
+# 415 221 137  99  86  69  30
+
+# all features (excluding those 6 from M0)
+METAB_UNIVERSE <- unique(unlist(METAB_MOD_LIST))
+head(METAB_UNIVERSE)
+#> [1] "adenosine"       "Anserine"        "C12 carnitine"   "C12:1 carnitine"
+#> [5] "C14 carnitine"   "C14:1 carnitine"
+
+# Reformat fData for use with fora2
+REFMET_SUBCLASSES <- pluck(METAB_WGCNA, "modules") %>%
+  filter(moduleColor != "grey") %>%
+  group_by(refmet_sub_class) %>%
+  summarise(feature = list(feature_ID)) %>%
+  mutate(gs_subcat = "refmet_sub_class",
+         gs_exact_source = refmet_sub_class,
+         gs_description = refmet_sub_class,
+         set_size = lengths(feature)) %>%
+  filter(set_size >= 10)
+
+# How many sets to test?
+length(REFMET_SUBCLASSES) # Only 6
+#> [1] 6
+
+# ORA
+METAB_MODULE_ORA <- fora2(pathways = REFMET_SUBCLASSES,
+                          genes = METAB_MOD_LIST,
+                          gene_column = "feature",
+                          universe = METAB_UNIVERSE,
+                          adjust.method = "scale",
+                          adjust.globally = TRUE) %>%
+  relocate(module, gs_subcat, pathway, gs_description) %>%
+  relocate(overlap, maxOverlap, overlapRatio, .after = size) %>%
+  dplyr::rename(refmet_sub_class = pathway,
+                overlapMetabolites = overlapGenes) %>%
+  dplyr::select(-starts_with("gs_"))
+
+head(METAB_MODULE_ORA)
+#>    module refmet_sub_class         pval         padj  size overlap maxOverlap
+#>    <fctr>           <char>        <num>        <num> <int>   <int>      <int>
+#> 1:     M1              TAG 5.065558e-35 8.545726e-35   190     150        150
+#> 2:     M1              LPC 4.835315e-02 6.830682e-01    35      19        150
+#> 3:     M1  Acyl carnitines 1.657193e-01 7.881443e-01    42      20        150
+#> 4:     M1   C24 bile acids 5.010514e-02 8.201617e-01    16      10        150
+#> 5:     M1              LPE 5.067624e-02 8.371493e-01    14       9        150
+#> 6:     M1              Cer 1.434423e-01 8.570003e-01    23      12        150
+#>    overlapRatio overlapMetabolites
+#>           <num>             <list>
+#> 1:   0.99337748       TG(36:1)....
+#> 2:   0.12582781       LPC(20:3....
+#> 3:   0.13245033       C12 carn....
+#> 4:   0.06622517       deoxycho....
+#> 5:   0.05960265       C16:0 LP....
+#> 6:   0.07947020       Cer(d34:....
+
+# Save
+usethis::use_data(PROT_MODULE_ORA, internal = FALSE, overwrite = TRUE,
+                  version = 3, compress = "bzip2")
+
+usethis::use_data(TRNSCRPT_MODULE_ORA, internal = FALSE, overwrite = TRUE,
+                  version = 3, compress = "bzip2")
+
+usethis::use_data(METAB_MODULE_ORA, internal = FALSE, overwrite = TRUE,
+                  version = 3, compress = "bzip2")
+
+
+

Session Info +

+
+sessionInfo()
+#> R version 4.3.3 (2024-02-29)
+#> Platform: x86_64-pc-linux-gnu (64-bit)
+#> Running under: Ubuntu 22.04.4 LTS
+#> 
+#> Matrix products: default
+#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
+#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
+#> 
+#> locale:
+#>  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
+#>  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
+#>  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
+#> [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
+#> 
+#> time zone: UTC
+#> tzcode source: system (glibc)
+#> 
+#> attached base packages:
+#> [1] stats     graphics  grDevices utils     datasets  methods   base     
+#> 
+#> other attached packages:
+#> [1] purrr_1.0.2                        tibble_3.2.1                      
+#> [3] tidyr_1.3.1                        dplyr_1.1.4                       
+#> [5] MotrpacRatTraining6moWAT_1.0.0     Biobase_2.62.0                    
+#> [7] BiocGenerics_0.48.1                MotrpacRatTraining6moWATData_2.0.0
+#> 
+#> loaded via a namespace (and not attached):
+#>   [1] RColorBrewer_1.1-3      rstudioapi_0.15.0       jsonlite_1.8.8         
+#>   [4] shape_1.4.6.1           magrittr_2.0.3          ggbeeswarm_0.7.2       
+#>   [7] rmarkdown_2.25          GlobalOptions_0.1.2     fs_1.6.3               
+#>  [10] zlibbioc_1.48.0         ragg_1.2.7              vctrs_0.6.5            
+#>  [13] memoise_2.0.1           RCurl_1.98-1.14         base64enc_0.1-3        
+#>  [16] rstatix_0.7.2           htmltools_0.5.7         dynamicTreeCut_1.63-1  
+#>  [19] curl_5.2.1              broom_1.0.5             Formula_1.2-5          
+#>  [22] sass_0.4.8              bslib_0.6.1             htmlwidgets_1.6.4      
+#>  [25] desc_1.4.3              impute_1.76.0           cachem_1.0.8           
+#>  [28] lifecycle_1.0.4         iterators_1.0.14        pkgconfig_2.0.3        
+#>  [31] Matrix_1.6-5            R6_2.5.1                fastmap_1.1.1          
+#>  [34] GenomeInfoDbData_1.2.11 clue_0.3-65             digest_0.6.34          
+#>  [37] colorspace_2.1-0        patchwork_1.2.0         AnnotationDbi_1.64.1   
+#>  [40] S4Vectors_0.40.2        textshaping_0.3.7       Hmisc_5.1-1            
+#>  [43] RSQLite_2.3.5           ggpubr_0.6.0            filelock_1.0.3         
+#>  [46] latex2exp_0.9.6         fansi_1.0.6             httr_1.4.7             
+#>  [49] abind_1.4-5             compiler_4.3.3          withr_3.0.0            
+#>  [52] bit64_4.0.5             doParallel_1.0.17       htmlTable_2.4.2        
+#>  [55] backports_1.4.1         BiocParallel_1.36.0     carData_3.0-5          
+#>  [58] DBI_1.2.2               ggsignif_0.6.4          rjson_0.2.21           
+#>  [61] tools_4.3.3             vipor_0.4.7             foreign_0.8-86         
+#>  [64] beeswarm_0.4.0          msigdbr_7.5.1           nnet_7.3-19            
+#>  [67] glue_1.7.0              grid_4.3.3              checkmate_2.3.1        
+#>  [70] cluster_2.1.6           fgsea_1.28.0            generics_0.1.3         
+#>  [73] gtable_0.3.4            preprocessCore_1.64.0   data.table_1.15.2      
+#>  [76] WGCNA_1.72-5            car_3.1-2               utf8_1.2.4             
+#>  [79] XVector_0.42.0          foreach_1.5.2           pillar_1.9.0           
+#>  [82] stringr_1.5.1           babelgene_22.9          limma_3.58.1           
+#>  [85] circlize_0.4.16         splines_4.3.3           BiocFileCache_2.10.1   
+#>  [88] lattice_0.22-5          survival_3.5-8          bit_4.0.5              
+#>  [91] tidyselect_1.2.0        GO.db_3.18.0            ComplexHeatmap_2.18.0  
+#>  [94] locfit_1.5-9.9          Biostrings_2.70.2       knitr_1.45             
+#>  [97] gridExtra_2.3           IRanges_2.36.0          edgeR_4.0.16           
+#> [100] stats4_4.3.3            xfun_0.42               statmod_1.5.0          
+#> [103] matrixStats_1.2.0       stringi_1.8.3           yaml_2.3.8             
+#> [106] evaluate_0.23           codetools_0.2-19        cli_3.6.2              
+#> [109] ontologyIndex_2.12      rpart_4.1.23            systemfonts_1.0.5      
+#> [112] munsell_0.5.0           jquerylib_0.1.4         Rcpp_1.0.12            
+#> [115] GenomeInfoDb_1.38.6     dbplyr_2.4.0            png_0.1-8              
+#> [118] fastcluster_1.2.6       parallel_4.3.3          pkgdown_2.0.7          
+#> [121] ggplot2_3.5.0           blob_1.2.4              bitops_1.0-7           
+#> [124] scales_1.3.0            crayon_1.5.2            GetoptLong_1.0.5       
+#> [127] rlang_1.1.3             cowplot_1.1.3           fastmatch_1.1-4        
+#> [130] KEGGREST_1.42.0
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/WGCNA_correlation_heatmaps.html b/articles/WGCNA_correlation_heatmaps.html new file mode 100644 index 0000000..0f0106f --- /dev/null +++ b/articles/WGCNA_correlation_heatmaps.html @@ -0,0 +1,482 @@ + + + + + + + +Heatmaps of WGCNA Module Correlations • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates heatmaps of the eigenfeature–eigenfeature and +eigenfeature–phenotype correlations (Fig. 4A, B).

+ +
+# Module correlation heatmap function
+modcor_heatmap <- function(x, scale = 1, ...)
+{
+  # Heatmap for each ome
+  omes <- names(x)
+  
+  map(omes, function(ome) {
+    cor_mat <- x[[ome]][["cor"]] %>% t()
+    padj_mat <- x[[ome]][["padj"]] %>% t()
+    # label_mat <- x[[ome]][["label"]]
+    
+    cell_size <- unit(5.5, "pt")
+    
+    # Heatmap
+    ht <- Heatmap(
+      matrix = cor_mat,
+      col = circlize::colorRamp2(
+        breaks = c(-1, 0, 1),
+        colors = c("#3366ff", "white", "darkred")
+      ),
+      cluster_columns = FALSE,
+      cluster_rows = FALSE,
+      row_names_side = "left",
+      border = TRUE,
+      height = scale * cell_size * nrow(cor_mat),
+      width = scale * cell_size * ncol(cor_mat),
+      column_title = ome,
+      row_names_gp = gpar(fontsize = 5 * scale),
+      column_names_gp = gpar(fontsize = 5 * scale),
+      column_title_gp = gpar(fontsize = 7 * scale),
+      row_title_gp = gpar(fontsize = 7 * scale),
+      show_heatmap_legend = ome == omes[1],
+      heatmap_legend_param = list(
+        title = "Spearman\nCorrelation",
+        at = seq(-1, 1, 0.5),
+        title_gp = gpar(fontsize = 7 * scale),
+        labels_gp = gpar(fontsize = 6 * scale),
+        legend_width = 6 * scale * unit(8, "pt"),
+        border = "black",
+        legend_direction = "horizontal"
+      ),
+      layer_fun = layer_fun <- function(j, i, x, y, w, h, f)
+      {
+        # Cell background
+        grid.rect(x = x, y = y, width = w, height = h,
+                  gp = gpar(col = NA,
+                            fill = ifelse(pindex(padj_mat, i, j) < 0.05,
+                                          "black", "white")))
+        
+        grid.circle(
+          x = x, y = y, 
+          r = 0.92 * scale * cell_size / 2,
+          gp = gpar(
+            col = NA,
+            fill = circlize::colorRamp2(
+              breaks = c(-1, 0, 1),
+              colors = c("#3366ff", "white", "darkred")
+            )(pindex(cor_mat, i, j))))
+      },
+      ...)
+    
+    return(ht)
+  }) %>%
+    setNames(omes)
+}
+
+bid_to_pid <- list(METAB_EXP, PROT_EXP, TRNSCRPT_EXP) %>%
+  map(function(.x) {
+    pData(.x) %>%
+      dplyr::select(pid, bid) %>%
+      mutate(across(everything(), as.character))
+  }) %>%
+  purrr::reduce(rbind) %>%
+  distinct()
+
+# WGCNA module eigenfeatures
+MEs <- list("METAB" = METAB_WGCNA,
+            "PROT" = PROT_WGCNA,
+            "TRNSCRPT" = TRNSCRPT_WGCNA) %>%
+  map(function(x) {
+    pluck(x, "MEs") %>%
+      filter(moduleNum != 0)
+  }) %>%
+  enframe(name = "ome") %>%
+  unnest(value) %>%
+  mutate(bid = as.character(bid)) %>%
+  left_join(bid_to_pid, by = "bid")
+
+# Metabolomics modules only
+ME_metab <- MEs %>%
+  filter(ome == "METAB") %>%
+  select(bid, METAB_ME = ME,
+         METAB_module = moduleID)
+
+## Eigenfeature correlations
+eigen_cor <- MEs %>%
+  filter(ome != "METAB") %>%
+  mutate(ome = factor(ome, levels = c("TRNSCRPT", "PROT"))) %>%
+  left_join(ME_metab, by = "bid") %>%
+  na.omit() %>%
+  group_by(ome, moduleID, METAB_module) %>%
+  summarise(n = n(),
+            cor = cor.test(ME, METAB_ME, method = "spearman", 
+                           na.action = na.omit)$estimate,
+            pval = cor.test(ME, METAB_ME, method = "spearman", 
+                            na.action = na.omit)$p.value,
+            .groups = "keep") %>%
+  group_by(ome) %>%
+  mutate(padj = p.adjust(pval, method = "BH"),
+         label = case_when(padj < 0.001 ~ "***",
+                           padj < 0.01 ~ "**",
+                           padj < 0.05 ~ "*",
+                           TRUE ~ "")) %>%
+  ungroup() %>%
+  split.data.frame(f = .[["ome"]]) %>%
+  map(function(xi) {
+    cols <- c("cor", "padj", "label")
+    map(cols, function(col_i) {
+      pivot_wider(xi, id_cols = moduleID,
+                  names_from = METAB_module,
+                  values_from = !!sym(col_i)) %>%
+        column_to_rownames("moduleID") %>%
+        as.matrix()
+    }) %>%
+      setNames(cols)
+  })
+
+# Scaling factor for heatmap elements. Divide heatmap dimensions by 2 when
+# adding to final figures.
+scale <- 2
+
+# Legend for significance markers
+lsig <- Legend(title = "BH-adjusted\np-value",
+               at = 1:2, border = "black",
+               title_gp = gpar(fontsize = 7 * scale),
+               labels_gp = gpar(fontsize = 6 * scale),
+               legend_gp = gpar(fill = c("white", "black")),
+               labels = c(latex2exp::TeX("$\\geq 0.05$"), 
+                          latex2exp::TeX("$< 0.05$")))
+
+metab_title <- Legend(title = "METAB", labels = "",
+                      title_gp = gpar(fontsize = 7 * scale))
+
+# Heatmap list
+ht_list1 <- modcor_heatmap(eigen_cor, scale = scale) %>%
+  purrr::reduce(`+`) # horizontal concatenation of heatmaps
+
+pdf(file.path("..", "..", "plots", 
+              "WGCNA_eigenfeature_correlation_heatmap.pdf"),
+    width = 2.6 * scale, height = 1.5 * scale, family = "ArialMT")
+draw(ht_list1, heatmap_legend_list = lsig,
+     legend_gap = scale * unit(20, "pt"),
+     gap = scale * unit(4, "pt"),
+     heatmap_legend_side = "bottom",
+     annotation_legend_list = metab_title,
+     annotation_legend_side = "right")
+dev.off()
+
+## Eigenfeature-Trait correlation heatmap --------------------------------------
+# Proteins - adiponectin, leptin
+protein_vals <- exprs(PROT_EXP)[
+  which(fData(PROT_EXP)[["gene_symbol"]] %in%
+          c("Adipoq", "Lep")), , drop = F] %>%
+  t() %>%
+  `colnames<-`(c("scWAT Leptin", "scWAT Adiponectin")) %>%
+  as.data.frame() %>%
+  mutate(pid = as.character(PROT_EXP$pid))
+
+# Calculated elsewhere
+count_WAT <- ADIPOCYTE_SIZE %>%
+  group_by(pid) %>%
+  summarise(total_adipocytes = n())
+
+# load("../PASS1B_phenotypic_measures.RData")
+
+# Change in VO2max, body weight, fat mass
+sample_measures <- PHENO_WAT %>% 
+  filter(omics_analysis) %>% 
+  transmute(pid = as.character(pid),
+            vo2max_diff = post_vo2max_ml_kg_min - pre_vo2max_ml_kg_min,
+            nmr_mass_diff = post_weight - pre_weight,
+            nmr_fat_diff = post_fat - pre_fat) %>% 
+  left_join(count_WAT) %>% 
+  left_join(protein_vals)
+
+## Clinical analytes
+analytes <- ANALYTES %>%
+  filter(omics_subset) %>%
+  dplyr::select(pid, nefa, glycerol, glucose, insulin, glucagon, leptin) %>%
+  mutate(pid = as.character(pid)) %>%
+  left_join(sample_measures) %>%
+  pivot_longer(cols = -pid) %>%
+  mutate(name = factor(name,
+                       levels = c("vo2max_diff", "nmr_mass_diff",
+                                  "nmr_fat_diff", "total_adipocytes",
+                                  "scWAT Adiponectin", "scWAT Leptin",
+                                  "nefa", "glycerol", "glucose", "insulin",
+                                  "glucagon", "leptin"),
+                       labels = c("VO2max Change", 
+                                  "Body Mass Change",
+                                  "Body Fat Change", 
+                                  "Adipocyte Count",
+                                  "scWAT Adiponectin", 
+                                  "scWAT Leptin",
+                                  paste("Plasma",
+                                        c("NEFA", "Glycerol", "Glucose",
+                                          "Insulin", "Glucagon",
+                                          "Leptin"))))) %>%
+  arrange(name)
+
+## Eigenfeature-Sample Trait correlations
+eigen_trait_cor <- MEs %>%
+  mutate(ome = factor(ome, levels = c("METAB", "TRNSCRPT", "PROT"))) %>%
+  inner_join(analytes, by = "pid") %>%
+  na.omit() %>%
+  group_by(ome, moduleID, name) %>%
+  summarise(n = n(),
+            cor = cor.test(ME, value, method = "spearman", 
+                           na.action = na.omit)$estimate,
+            pval = cor.test(ME, value, method = "spearman", 
+                            na.action = na.omit)$p.value,
+            .groups = "keep") %>%
+  group_by(ome) %>%
+  mutate(padj = p.adjust(pval, method = "BH"),
+         label = case_when(padj < 0.001 ~ "***",
+                           padj < 0.01 ~ "**",
+                           padj < 0.05 ~ "*",
+                           TRUE ~ "")) %>%
+  ungroup() %>%
+  split.data.frame(f = .[["ome"]]) %>%
+  lapply(function(xi) {
+    cols <- c("cor", "padj", "label")
+    lapply(cols, function(col_i) {
+      pivot_wider(xi, id_cols = moduleID,
+                  names_from = name,
+                  values_from = !!sym(col_i)) %>%
+        column_to_rownames("moduleID") %>%
+        as.matrix()
+    }) %>%
+      setNames(cols)
+  })
+
+# Heatmap list
+ht_list2 <- modcor_heatmap(eigen_trait_cor, scale = scale) %>%
+  purrr::reduce(`+`) # horizontal concatenation of heatmaps
+
+pdf(file.path("..", "..", "plots", 
+              "WGCNA_eigenfeature_trait_correlation_heatmap.pdf"),
+    width = 3.4 * scale, height = 1.8 * scale, family = "ArialMT")
+draw(ht_list2, heatmap_legend_list = lsig,
+     legend_gap = scale * unit(20, "pt"),
+     gap = scale * unit(4, "pt"),
+     heatmap_legend_side = "bottom")
+dev.off()
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/WGCNA_eigenfeature_plots.html b/articles/WGCNA_eigenfeature_plots.html new file mode 100644 index 0000000..b3bb32e --- /dev/null +++ b/articles/WGCNA_eigenfeature_plots.html @@ -0,0 +1,245 @@ + + + + + + + +Plots of WGCNA eigenfeatures for each -ome • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates plots of the WGCNA module eigenfeatures +(Extended Data Fig. 6A–C).

+
+library(MotrpacRatTraining6moWAT) # plot_eigenfeature
+library(MotrpacRatTraining6moWATData)
+library(ggplot2)
+
+save_plots <- dir.exists(paths = file.path("..", "..", "plots"))
+
+# Proteomics
+p1 <- plot_eigenfeature(x = PROT_WGCNA)
+p1
+

+
+ggsave(file.path("..", "..", "plots", "PROT_module_eigenfeatures.pdf"), p1,
+       height = 3, width = 6.5, family = "ArialMT")
+
+# Metabolomics
+p2 <- plot_eigenfeature(x = METAB_WGCNA)
+p2
+

+
+ggsave(file.path("..", "..", "plots", "METAB_module_eigenfeatures.pdf"), p2,
+       height = 2, width = 6.5, family = "ArialMT")
+
+# Transcriptomics
+p3 <- plot_eigenfeature(x = TRNSCRPT_WGCNA)
+p3
+

+
+ggsave(file.path("..", "..", "plots", "TRNSCRPT_module_eigenfeatures.pdf"), p3,
+       height = 4, width = 6.5, family = "ArialMT")
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/WGCNA_eigenfeature_plots_files/figure-html/unnamed-chunk-2-1.png b/articles/WGCNA_eigenfeature_plots_files/figure-html/unnamed-chunk-2-1.png new file mode 100644 index 0000000..9da865e Binary files /dev/null and b/articles/WGCNA_eigenfeature_plots_files/figure-html/unnamed-chunk-2-1.png differ diff --git a/articles/WGCNA_eigenfeature_plots_files/figure-html/unnamed-chunk-4-1.png b/articles/WGCNA_eigenfeature_plots_files/figure-html/unnamed-chunk-4-1.png new file mode 100644 index 0000000..a722a84 Binary files /dev/null and b/articles/WGCNA_eigenfeature_plots_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/articles/WGCNA_eigenfeature_plots_files/figure-html/unnamed-chunk-6-1.png b/articles/WGCNA_eigenfeature_plots_files/figure-html/unnamed-chunk-6-1.png new file mode 100644 index 0000000..d7b7a05 Binary files /dev/null and b/articles/WGCNA_eigenfeature_plots_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/articles/WGCNA_module_ORA.html b/articles/WGCNA_module_ORA.html new file mode 100644 index 0000000..a5b73e7 --- /dev/null +++ b/articles/WGCNA_module_ORA.html @@ -0,0 +1,305 @@ + + + + + + + +Plots of WGCNA Module Over-Representation Analysis Results • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates plots of the WGCNA over-representation +analysis results (Fig. 4C–E).

+
+library(MotrpacRatTraining6moWATData)
+library(MotrpacRatTraining6moWAT) # plot_ORA
+library(dplyr)
+library(ggplot2)
+
+save_plots <- dir.exists(paths = file.path("..", "..", "plots"))
+
+

METAB +

+
+METAB_MODULE_ORA <- mutate(METAB_MODULE_ORA,
+                           gs_subcat = "refmet_sub_class",
+                           pathway = refmet_sub_class,
+                           gs_description = refmet_sub_class)
+
+p_metab <- plot_ORA(METAB_MODULE_ORA,
+                    mods = 1:7,
+                    subset = "refmet_sub_class")
+
+ggsave(file.path("..", "..", "plots", "METAB_module_ORA_dotplot.pdf"), p_metab,
+       height = 1.8, width = 2.2, family = "ArialMT")
+
+
+

PROT +

+
+## MF
+prot_MF <- plot_ORA(PROT_MODULE_ORA,
+                    subset = "GO:MF",
+                    mods = 1:11,
+                    rel_heights = c(0.8, 0.1))
+
+ggsave(file.path("..", "..", "plots", "PROT_module_ORA_GO-MF_dotplot.pdf"), prot_MF,
+       height = 3, width = 3, family = "ArialMT")
+
+## BP
+prot_BP <- plot_ORA(PROT_MODULE_ORA,
+                    subset = "GO:BP",
+                    mods = 1:11,
+                    rel_heights = c(0.8, 0.1))
+
+ggsave(file.path("..", "..", "plots", "PROT_module_ORA_GO-BP_dotplot.pdf"), prot_BP,
+       height = 3, width = 3, family = "ArialMT")
+
+## CC
+prot_CC <- plot_ORA(PROT_MODULE_ORA,
+                    subset = "GO:CC",
+                    mods = 1:11,
+                    rel_heights = c(0.8, 0.1))
+
+ggsave(file.path("..", "..", "plots", "PROT_module_ORA_GO-CC_dotplot.pdf"), prot_CC,
+       height = 3, width = 3, family = "ArialMT")
+
+
+

TRNSCRPT +

+
+# MF
+trnscrpt_MF <- plot_ORA(TRNSCRPT_MODULE_ORA,
+                        subset = "GO:MF",
+                        mods = 1:14,
+                        n_terms = 4,
+                        rel_heights = c(1, 0.15))
+
+ggsave(file.path("..", "..", "plots", "TRNSCRPT_module_ORA_GO-MF_dotplot.pdf"), trnscrpt_MF,
+       height = 4, width = 3.5, family = "ArialMT")
+
+# BP
+trnscrpt_BP <- plot_ORA(TRNSCRPT_MODULE_ORA,
+                        subset = "GO:BP",
+                        mods = 1:14,
+                        n_terms = 4,
+                        rel_heights = c(1, 0.09))
+
+ggsave(file.path("..", "..", "plots", "TRNSCRPT_module_ORA_GO-BP_dotplot.pdf"), trnscrpt_BP,
+       height = 5, width = 3.5, family = "ArialMT")
+
+# CC
+trnscrpt_CC <- plot_ORA(TRNSCRPT_MODULE_ORA,
+                        subset = "GO:CC",
+                        mods = 1:14, n_terms = 4,
+                        rel_heights = c(1, 0.15))
+
+ggsave(file.path("..", "..", "plots", "TRNSCRPT_module_ORA_GO-CC_dotplot.pdf"), trnscrpt_CC,
+       height = 4, width = 3.5, family = "ArialMT")
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/index.html b/articles/index.html new file mode 100644 index 0000000..8dc2643 --- /dev/null +++ b/articles/index.html @@ -0,0 +1,236 @@ + +Articles • MotrpacRatTraining6moWATData + + +
+
+ + + +
+ +
+ + +
+ + + + + + + + diff --git a/articles/limma_diagnostics.html b/articles/limma_diagnostics.html new file mode 100644 index 0000000..da6b887 --- /dev/null +++ b/articles/limma_diagnostics.html @@ -0,0 +1,394 @@ + + + + + + + +LIMMA Diagnostic Plots • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates multidimensional scaling (MDS) and +mean–variance trend plots (Extended Data Fig. 8A–G).

+
+# Required packages
+library(MotrpacRatTraining6moWATData)
+library(MotrpacRatTraining6moWAT) # theme_pub, ggplotMDS
+library(Biobase)
+library(edgeR)
+library(dplyr)
+library(ggplot2)
+
+save_plots <- dir.exists(paths = file.path("..", "..", "plots"))
+
+# Transcriptomics pre-processing
+# Convert filtered counts to normalized log2 counts-per-million reads
+dge <- DGEList(counts = exprs(TRNSCRPT_EXP),
+               samples = pData(TRNSCRPT_EXP),
+               group = TRNSCRPT_EXP$exp_group)
+dge <- calcNormFactors(dge, method = "TMM")
+m_dge <- TRNSCRPT_EXP
+exprs(m_dge) <- cpm(dge, log = TRUE)
+
+

Multi-dimensional Scaling Plots +

+
+

PROT +

+
+mds_prot <- ggplotMDS(PROT_EXP)
+
+mds_prot
+

+
+ggsave(file.path("..", "..", "plots", "MDS_PROT.pdf"), mds_prot,
+       height = 2, width = 2.3, units = "in", dpi = 400, bg = "white")
+
+
+

TRNSCRPT +

+
+mds_trnscrpt <- ggplotMDS(m_dge)
+
+mds_trnscrpt
+

+
+ggsave(file.path("..", "..", "plots", "MDS_TRNSCRPT.pdf"), mds_trnscrpt,
+       height = 2, width = 2.3,
+       units = "in", dpi = 300, bg = "white")
+
+
+

PHOSPHO +

+
+mds_phospho <- ggplotMDS(PHOSPHO_EXP)
+
+mds_phospho
+

+
+ggsave(file.path("..", "..", "plots", "MDS_PHOSPHO.pdf"), mds_phospho,
+       height = 2, width = 2.3,
+       units = "in", dpi = 300, bg = "white")
+
+
+

METAB +

+
+mds_metab <- ggplotMDS(METAB_EXP)
+
+mds_metab
+

+
+ggsave(file.path("..", "..", "plots", "MDS_METAB.pdf"), mds_metab,
+       height = 2, width = 2.3,
+       units = "in", dpi = 300, bg = "white")
+
+
+
+

Mean–variance trend +

+
+# Do not run the following chunks when knitting
+knitr::opts_chunk$set(eval = FALSE)
+
+

PROT and PHOSPHO +

+
+# PROT and PHOSPHO:
+# In vignettes/WATSC_DA.Rmd,
+# 1) debug limma_full.  Set 
+#    plot = TRUE. Run all code up through the creation of fit.smooth.
+# 2) debug limma::plotSA. Run plotSA(fit.smooth) up until the plot is made.
+# 3) Set working directory to the location of this article and run the following
+#    code. Modify the -ome in the file name as needed (either PROT or PHOSPHO).
+
+ome <- "PROT" # PROT or PHOSPHO
+
+# Create data.frame so that red points (outliers) will be plotted on top
+mv_prot_df <- data.frame(x = x,
+                         y = y,
+                         color = colv,
+                         s = sqrt(sqrt(fit$s2.prior))) %>%
+  mutate(color = factor(color, levels = c("black", "red"),
+                        labels = c("Normal", "Outlier"))) %>%
+  arrange(color)
+
+# Plot
+mv_prot <- ggplot(mv_prot_df) +
+  geom_point(aes(x = x, y = y, color = color),
+             size = 1, alpha = 0.5, shape = 16) +
+  geom_line(aes(x = x, y = s), linewidth = 0.3,
+            color = "red", lty = "dashed") +
+  coord_cartesian(ylim = c(0, 3)) +
+  scale_y_continuous(expand = expansion(mult = c(5e-3)),
+                     limits = c(0, NA)) +
+  scale_color_manual(name = NULL,
+                     values = c("black", "red"),
+                     labels = c("Normal", "Outlier")) +
+  labs(x = "Average log-expression",
+       y = expression(sqrt("sigma")),
+       subtitle = "eBayes(trend=TRUE, robust=TRUE)") +
+  theme_pub() +
+  theme(axis.line.y.right = element_blank(),
+        strip.text = element_text(hjust = 0,
+                                  margin = margin(t=0, r=0, b=5, l=0)),
+        legend.key.size = unit(6, "pt"),
+        # legend.margin = margin(r = 0, l = 0),
+        legend.position = c(0.8, 5/6),
+        legend.background = element_rect(fill = "white", color = "black",
+                                         linewidth = 0.3),
+        panel.grid.minor = element_line(linewidth = 0))
+
+ggsave(
+  filename = sprintf(file.path("..", "..", "plots", "limma_diagnostics_mean-variance_%s.pdf"), ome),
+  mv_prot, height = 2, width = 2.3, dpi = 400, bg = "white"
+)
+# exit debugger now
+
+
+

TRNSCRPT +

+
+# In vignettes/WATSC_DA.R:
+# 1) debug `limma_full`. Run all code before `limma::voomWithQualityWeights` 
+#    is called.
+# 2) debug `limma::voomWithQualityWeights`. Set plot=TRUE. Run all code before
+#    the second use of `voom`.
+# 3) debug `voom`. Run all code before `plot(sx, sy, ...)`
+# 4) Run the following code:
+
+mv_trnscrpt <- ggplot(mapping = aes(x = sx, y = sy)) +
+  geom_point(alpha = 0.3, size = 1, shape = 16) +
+  geom_smooth(formula = y ~ x, method = "loess",
+              linewidth = 0.3,
+              color = "red", lty = "dashed") +
+  labs(x = expression(paste("log"[2],"(count size + 0.5)")),
+       y = expression(sqrt("standard deviation")),
+       subtitle = "voomWithQualityWeights(..., plot=TRUE)") +
+  scale_y_continuous(limits = c(0, 2.5),
+                     expand = expansion(mult = 5e-3)) +
+  theme_pub() +
+  theme(axis.line.y.right = element_blank(),
+        strip.text = element_text(hjust = 0,
+                                  margin = margin(t=0, r=0, b=5, l=0)),
+        legend.key.size = unit(6, "pt"),
+        legend.margin = margin(r = 0, l = 0),
+        panel.grid.minor = element_line(linewidth = 0))
+
+ggsave(file.path("..", "..", "plots", "limma_diagnostics_mean-variance_TRNSCRPT.pdf"),
+       mv_trnscrpt, height = 2, width = 2.3, dpi = 400, bg = "white")
+# exit debugger now
+
+
+

METAB +

+

Separate mean–variance trends were fit to each platform, so there +would be about a dozen plots. We will leave this as an exercise for the +interested reader.

+
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/limma_diagnostics_files/figure-html/unnamed-chunk-3-1.png b/articles/limma_diagnostics_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..3e3a62f Binary files /dev/null and b/articles/limma_diagnostics_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/articles/limma_diagnostics_files/figure-html/unnamed-chunk-5-1.png b/articles/limma_diagnostics_files/figure-html/unnamed-chunk-5-1.png new file mode 100644 index 0000000..99468b4 Binary files /dev/null and b/articles/limma_diagnostics_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/articles/limma_diagnostics_files/figure-html/unnamed-chunk-7-1.png b/articles/limma_diagnostics_files/figure-html/unnamed-chunk-7-1.png new file mode 100644 index 0000000..6119acf Binary files /dev/null and b/articles/limma_diagnostics_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/articles/limma_diagnostics_files/figure-html/unnamed-chunk-9-1.png b/articles/limma_diagnostics_files/figure-html/unnamed-chunk-9-1.png new file mode 100644 index 0000000..e470457 Binary files /dev/null and b/articles/limma_diagnostics_files/figure-html/unnamed-chunk-9-1.png differ diff --git a/articles/lipid_regulatory_proteins_heatmap.html b/articles/lipid_regulatory_proteins_heatmap.html new file mode 100644 index 0000000..4e8ef69 --- /dev/null +++ b/articles/lipid_regulatory_proteins_heatmap.html @@ -0,0 +1,372 @@ + + + + + + + +Heatmap of lipid regulatory proteins • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates a heatmap of lipid regulatory proteins (Fig. +5D).

+
+library(MotrpacRatTraining6moWATData)
+library(Biobase)
+#> Loading required package: BiocGenerics
+#> 
+#> Attaching package: 'BiocGenerics'
+#> The following objects are masked from 'package:stats':
+#> 
+#>     IQR, mad, sd, var, xtabs
+#> The following objects are masked from 'package:base':
+#> 
+#>     anyDuplicated, aperm, append, as.data.frame, basename, cbind,
+#>     colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
+#>     get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
+#>     match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
+#>     Position, rank, rbind, Reduce, rownames, sapply, setdiff, sort,
+#>     table, tapply, union, unique, unsplit, which.max, which.min
+#> Welcome to Bioconductor
+#> 
+#>     Vignettes contain introductory material; view with
+#>     'browseVignettes()'. To cite Bioconductor, see
+#>     'citation("Biobase")', and for packages 'citation("pkgname")'.
+library(dplyr)
+#> 
+#> Attaching package: 'dplyr'
+#> The following object is masked from 'package:Biobase':
+#> 
+#>     combine
+#> The following objects are masked from 'package:BiocGenerics':
+#> 
+#>     combine, intersect, setdiff, union
+#> The following objects are masked from 'package:stats':
+#> 
+#>     filter, lag
+#> The following objects are masked from 'package:base':
+#> 
+#>     intersect, setdiff, setequal, union
+library(tidyr)
+library(ComplexHeatmap)
+#> Loading required package: grid
+#> ========================================
+#> ComplexHeatmap version 2.18.0
+#> Bioconductor page: http://bioconductor.org/packages/ComplexHeatmap/
+#> Github page: https://github.com/jokergoo/ComplexHeatmap
+#> Documentation: http://jokergoo.github.io/ComplexHeatmap-reference
+#> 
+#> If you use it in published research, please cite either one:
+#> - Gu, Z. Complex Heatmap Visualization. iMeta 2022.
+#> - Gu, Z. Complex heatmaps reveal patterns and correlations in multidimensional 
+#>     genomic data. Bioinformatics 2016.
+#> 
+#> 
+#> The new InteractiveComplexHeatmap package can directly export static 
+#> complex heatmaps into an interactive Shiny app with zero effort. Have a try!
+#> 
+#> This message can be suppressed by:
+#>   suppressPackageStartupMessages(library(ComplexHeatmap))
+#> ========================================
+
+save_plots <- dir.exists(paths = file.path("..", "..", "plots"))
+
+# Proteins to plot
+proteins <- c("Acaca", "Cpt1a", "Slc25a20", "Rab18", "Abcd3",
+              "Hacl1", "Abcd1", "Abcd3", "Dgat1", "Dgat2",
+              "Pck1", "Pck2", "Spast", "Pex11b", "Plin1", "Plin2",
+              # From https://rupress.org/view-large/figure/6879897/JCB_201311051_Fig2.jpeg
+              "Acsl1", "Acsl5", paste0("Agpat", 1:5), "Gpat3", "Gpat4")
+
+# Isoform handling
+PROT_EXP <- PROT_EXP[fData(PROT_EXP)[["gene_symbol"]] %in% proteins &
+                             featureNames(PROT_EXP) != "XP_008762000.1", ]
+
+mat <- pData(PROT_EXP) %>%
+  select(sex, timepoint) %>%
+  cbind(t(exprs(PROT_EXP))) %>%
+  pivot_longer(cols = -c(sex, timepoint),
+               names_to = "protein") %>%
+  mutate(protein = fData(PROT_EXP)[protein, "gene_symbol"],
+         protein = protein) %>%
+  filter(!is.na(value)) %>%
+  group_by(protein) %>%
+  mutate(value = scale(value)) %>%
+  group_by(sex, timepoint, protein) %>%
+  summarise(mean_val = mean(value), .groups = "keep") %>%
+  pivot_wider(id_cols = c(sex, timepoint),
+              values_from = mean_val,
+              names_from = protein) %>%
+  as.data.frame() %>%
+  `rownames<-`(with(., interaction(sex, timepoint))) %>%
+  select(-c(sex, timepoint)) %>%
+  t() %>%
+  as.matrix()
+
+## Create heatmap ----
+scale <- 2
+
+ha <- pData(PROT_EXP) %>% 
+  distinct(sex, timepoint) %>%
+  arrange(sex, timepoint) %>%
+  dplyr::rename(Sex = sex, Timepoint = timepoint) %>%
+  HeatmapAnnotation(
+    df = .,
+    border = TRUE,
+    gp = gpar(col = "black"),
+    gap = 0,
+    which = "column",
+    height = unit(6 * 2, "pt")*scale,
+    col = list(
+      Sex = c("Female" = "#ff6eff", "Male" = "#5555ff"),
+      Timepoint = c('SED' = 'white',
+                    '1W' = '#F7FCB9',
+                    '2W' = '#ADDD8E',
+                    '4W' = '#238443',
+                    '8W' = '#002612')
+    ),
+    annotation_name_gp = gpar(fontsize = 7 * scale),
+    annotation_legend_param = list(Timepoint = list(
+      at = c("SED", "1W", "2W", "4W", "8W")),
+      border = "black",
+      labels_gp = gpar(fontsize = 6.5 * scale),
+      title_gp = gpar(fontsize = 7 * scale, fontface = "bold")
+    )
+  )
+
+ht <- mat %>%
+  Heatmap(matrix = .,
+          col = circlize::colorRamp2(
+            breaks = c(-1.6, 0, 1.8),
+            colors = c("#3366ff", "white", "darkred")
+          ),
+          cluster_columns = FALSE,
+          show_column_names = FALSE,
+          clustering_distance_rows = "pearson",
+          top_annotation = ha,
+          border = "black",
+          row_names_gp = gpar(fontsize = 5 * scale),
+          height = nrow(.) * unit(5.5, "pt") * scale,
+          width = ncol(.) * unit(5.5, "pt") * scale,
+          column_split = rep(1:2, each = 5),
+          column_title = NULL,
+          heatmap_legend_param = list(
+            title = "Mean\nZ-Score",
+            at = c(-1.6, -1:1, 1.8),
+            title_gp = gpar(fontsize = 7 * scale,
+                            fontface = "bold"),
+            labels_gp = gpar(fontsize = 6 * scale),
+            legend_height = 5 * scale * unit(8, "pt"),
+            border = "black"
+          ))
+
+pdf(file = file.path("..", "..", "plots", 
+                     "lipid_regulatory_proteins_heatmap.pdf"),
+    width = 2.3 * scale, height = 2.2 * scale, family = "ArialMT")
+draw(ht, merge_legends = TRUE,
+     align_heatmap_legend = "heatmap_top",
+     align_annotation_legend = "heatmap_top")
+dev.off()
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/plot_FGSEA_male_vs_female_summary.html b/articles/plot_FGSEA_male_vs_female_summary.html new file mode 100644 index 0000000..74bc0e0 --- /dev/null +++ b/articles/plot_FGSEA_male_vs_female_summary.html @@ -0,0 +1,360 @@ + + + + + + + +Plots of Top FGSEA Terms from Male vs. Female Comparisons • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates scatterplots of the top FGSEA terms from the +male vs. female comparisons (Fig. 2B, C).

+ +
+omes <- c("PROT", "TRNSCRPT")
+
+res <- lapply(omes, function(ome) {
+  file <- paste0(ome, "_FGSEA")
+  fgsea_res <- get(file)
+
+  pluck(fgsea_res, "MvF_SED") %>%
+    mutate(ome = ome)
+})
+
+common_sets <- intersect(res[[1]]$pathway, res[[2]]$pathway)
+
+res_df <- rbindlist(res) %>%
+  dplyr::select(ome, contrast, gs_subcat, pathway, 
+                gs_description, padj, NES) %>%
+  pivot_wider(id_cols = c(contrast:gs_description),
+              names_from = ome,
+              values_from = c(padj, NES),
+              names_sep = ".") %>%
+  filter(!(is.na(NES.PROT) | is.na(NES.TRNSCRPT))) %>%
+  mutate(both_signif = padj.PROT < 0.05 & padj.TRNSCRPT < 0.05,
+         quadrant = case_when(NES.PROT > 0 & NES.TRNSCRPT > 0 ~ "Q1",
+                              NES.PROT < 0 & NES.TRNSCRPT > 0 ~ "Q2",
+                              NES.PROT < 0 & NES.TRNSCRPT < 0 ~ "Q3",
+                              NES.PROT > 0 & NES.TRNSCRPT < 0 ~ "Q4")) %>%
+  arrange(both_signif)
+
+top_terms <- res_df %>%
+  filter(both_signif) %>%
+  dplyr::select(-both_signif) %>%
+  group_by(pathway, gs_subcat, quadrant, gs_description) %>%
+  rowwise() %>%
+  mutate(NES_mean = mean(abs(c(NES.PROT, NES.TRNSCRPT)))) %>%
+  ungroup() %>%
+  group_by(gs_subcat) %>%
+  arrange(-NES_mean) %>%
+  mutate(not_Q1 = sum(quadrant != "Q1"),
+         n = 10 - not_Q1) %>%
+  group_by(gs_subcat, quadrant) %>%
+  mutate(idx = 1:n()) %>%
+  filter((idx <= not_Q1 & quadrant != "Q1") |
+           (idx <= n & quadrant == "Q1")) %>%
+  pull(pathway)
+
+p1 <- ggplot(res_df) +
+  geom_vline(xintercept = 0, lty = "dashed",
+             color = "black", linewidth = 0.3) +
+  geom_hline(yintercept = 0, lty = "dashed",
+             color = "black", linewidth = 0.3) +
+  geom_point(aes(x = NES.PROT, y = NES.TRNSCRPT,
+                 color = both_signif),
+             size = 0.8, shape = 16, alpha = 0.85) +
+  facet_grid(gs_subcat ~ ., space = "free_y") +
+  labs(x = "NES: PROT", y = "NES: TRNSCRPT") +
+  scale_color_manual(name = NULL,
+                     values = c("black", "grey"),
+                     labels = c("Significantly enriched in both -omes"),
+                     breaks = c(TRUE), na.value = "grey") +
+  theme_pub() +
+  theme(legend.position = "top",
+        legend.margin = margin(t = 0, b = -5),
+        legend.box.margin = margin(b = -5, t = -5),
+        axis.line = element_line(color = NA),
+        panel.border = element_rect(color = "black", fill = NA),
+        strip.background = element_blank())
+
+p1
+

+
+ggsave(file.path("..", "..", "plots", "FGSEA_NES_scatterplot.pdf"), p1,
+       height = 2.6, width = 1.9, family = "ArialMT")
+
+p2 <- res_df %>%
+  filter(pathway %in% top_terms) %>%
+  pivot_longer(cols = c(contains("NES"), contains("padj"))) %>%
+  separate(col = name, into = c("measure", "ome"),
+           sep = "\\.", remove = TRUE) %>%
+  pivot_wider(names_from = measure,
+              values_from = value) %>%
+  arrange(NES) %>%
+  mutate(gs_description = factor(gs_description,
+                                 levels = unique(gs_description))) %>%
+  ggplot() +
+  geom_vline(xintercept = c(-1, 1), color = "black",
+             lty = "dashed", linewidth = 0.3) +
+  geom_point(aes(x = NES, y = gs_description,
+                 shape = ome, color = NES),
+             size = 1) +
+  facet_grid(gs_subcat ~ ., scales = "free_y",
+             switch = "y", space = "free_y") +
+  scale_y_discrete(name = NULL,
+                   position = "right") +
+  scale_color_gradientn(colors = c("#ff6eff", rep("white", 2), "#5555ff"),
+                        values = scales::rescale(c(-2.5, -1, 1, 2.9))) +
+  scale_shape_manual(name = NULL, values = 16:17) +
+  guides(
+    color = guide_colorbar(barwidth = unit(0.6, "in"),
+                           barheight = unit(0.07, "in"),
+                           frame.colour = "black",
+                           ticks.colour = "black", order = 1),
+    shape = guide_legend(title =  NULL, order = 2,
+                         keyheight = unit(7, "pt"),
+                         keywidth = unit(7, "pt"))) +
+  theme_bw() +
+  theme(text = element_text(size = 6, color = "black"),
+        axis.text = element_text(color = "black"),
+        axis.title = element_text(color = "black"),
+        axis.ticks.y = element_blank(),
+        axis.ticks.x = element_line(color = "black", linewidth = 0.3),
+        axis.title.y = element_text(margin = margin(r = 10, unit = "pt")),
+        strip.background = element_blank(),
+        strip.text = element_text(size = 6.5, color = "black"),
+        panel.spacing.y = unit(3, "pt"),
+        panel.border = element_rect(fill = NA, color = "black",
+                                    linewidth = 0.3),
+        plot.margin = margin(t = 20, unit = "pt"),
+        legend.position = c(0.85, 1.1),
+        legend.direction = "horizontal",
+        legend.box = "horizontal",
+        legend.box.margin = margin(b = -5, unit = "pt"),
+        legend.title = element_text(size = 5.5,
+                                    color = "black"),
+        legend.text = element_text(size = 5,
+                                   color = "black"),
+        panel.grid = element_blank(),
+        panel.grid.major.y = element_line(linewidth = 0.3, color = "grey92"))
+
+p2
+

+
+ggsave(file.path("..", "..", "plots", "FGSEA_NES_scatterplot_terms.pdf"), p2,
+       height = 2.5, width = 3, family = "ArialMT")
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/plot_FGSEA_male_vs_female_summary_files/figure-html/unnamed-chunk-3-1.png b/articles/plot_FGSEA_male_vs_female_summary_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..5b34957 Binary files /dev/null and b/articles/plot_FGSEA_male_vs_female_summary_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/articles/plot_FGSEA_male_vs_female_summary_files/figure-html/unnamed-chunk-5-1.png b/articles/plot_FGSEA_male_vs_female_summary_files/figure-html/unnamed-chunk-5-1.png new file mode 100644 index 0000000..978eb3d Binary files /dev/null and b/articles/plot_FGSEA_male_vs_female_summary_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/articles/plot_Hk2.html b/articles/plot_Hk2.html new file mode 100644 index 0000000..8fa5704 --- /dev/null +++ b/articles/plot_Hk2.html @@ -0,0 +1,402 @@ + + + + + + + +Plot of hexokinase 2 (Hk2) protein log2 relative abundance • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

Plot of hexokinase 2 from the skeletal muscle proteomics data +(Extended Data Fig. 1H).

+ +
+# Hk2 values from normalized skeletal muscle proteomics data
+x <- PROT_SKMGN_NORM_DATA %>%
+  left_join(dplyr::select(FEATURE_TO_GENE, feature_ID, gene_symbol),
+            by = "feature_ID", multiple = "all") %>%
+  relocate(gene_symbol, .after = feature_ID) %>%
+  filter(gene_symbol == "Hk2") %>%
+  dplyr::select(-c(feature_ID, gene_symbol, feature, tissue, assay)) %>%
+  pivot_longer(cols = everything(),
+               names_to = "viallabel",
+               values_to = "Hk2") %>%
+  left_join(dplyr::select(PHENO, viallabel, timepoint = group, sex),
+            by = "viallabel") %>%
+  mutate(sex = factor(sub("(.)", "\\U\\1", sex, perl = TRUE),
+                      levels = c("Female", "Male")),
+         timepoint = ifelse(timepoint == "control",
+                            "SED", toupper(timepoint)),
+         timepoint = factor(timepoint,
+                            levels = c("SED", paste0(2 ^ (0:3), "W"))),
+         exp_group = paste0(substr(sex, 1, 1), "_", timepoint))
+
+# Multiple regression model for Dunnett tests
+fit <- lm(Hk2 ~ sex * timepoint, data = x)
+summary(fit)
+#> 
+#> Call:
+#> lm(formula = Hk2 ~ sex * timepoint, data = x)
+#> 
+#> Residuals:
+#>       Min        1Q    Median        3Q       Max 
+#> -0.281022 -0.059367 -0.001863  0.071578  0.243368 
+#> 
+#> Coefficients:
+#>                     Estimate Std. Error t value Pr(>|t|)    
+#> (Intercept)         -0.19544    0.05724  -3.414  0.00133 ** 
+#> sexMale             -0.20276    0.07390  -2.744  0.00857 ** 
+#> timepoint1W          0.12631    0.07390   1.709  0.09399 .  
+#> timepoint2W          0.23438    0.07390   3.172  0.00267 ** 
+#> timepoint4W          0.55110    0.07390   7.458 1.66e-09 ***
+#> timepoint8W          0.52817    0.07390   7.148 4.89e-09 ***
+#> sexMale:timepoint1W  0.17522    0.09914   1.767  0.08365 .  
+#> sexMale:timepoint2W  0.06757    0.09914   0.682  0.49884    
+#> sexMale:timepoint4W -0.07885    0.09914  -0.795  0.43045    
+#> sexMale:timepoint8W -0.04134    0.10132  -0.408  0.68511    
+#> ---
+#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+#> 
+#> Residual standard error: 0.1145 on 47 degrees of freedom
+#> Multiple R-squared:  0.8167, Adjusted R-squared:  0.7816 
+#> F-statistic: 23.27 on 9 and 47 DF,  p-value: 1.826e-14
+
+# Estimated marginal means and treatment vs. control (Dunnett) comparisons
+fit.emm <- emmeans(fit, specs = "timepoint", by = "sex")
+
+res <- contrast(fit.emm, method = "trt.vs.ctrl", infer = TRUE) %>%
+  summary() %>%
+  as.data.frame() %>%
+  mutate(signif = cut(p.value,
+                      breaks = c(0, 0.001, 0.01, 0.05, 1),
+                      labels = c("***", "**", "*", ""),
+                      include.lowest = TRUE, right = FALSE,
+                      ordered_result = TRUE))
+
+# Confidence intervals
+conf_df <- fit.emm %>%
+  summary(infer = TRUE) %>%
+  as.data.frame()
+
+stats <- filter(res, signif != "")
+
+# Plot
+p <- ggplot(x, aes(x = timepoint, y = Hk2)) +
+  geom_crossbar(aes(x = timepoint, y = emmean,
+                    ymin = lower.CL, ymax = upper.CL,
+                    color = sex),
+                data = conf_df, fatten = 1, width = 0.7,
+                linewidth = 0.4, show.legend = FALSE) +
+  geom_point(shape = 16, size = 0.4,
+             position = ggbeeswarm::position_beeswarm(cex = 3,
+                                                      dodge.width = 0.4)) +
+  facet_grid(~ sex) +
+  ggsignif::geom_signif(
+    data = stats,
+    mapping = aes(y_position = c(0.27, 0.67, 0.78, 0.10 + 1:4 * 0.1),
+                  xmin = rep("SED", nrow(stats)),
+                  xmax = sub(" .*", "", contrast),
+                  annotations = signif),
+    textsize = 6 / .pt,
+    vjust = 0.25,
+    tip_length = 0.02,
+    color = "black",
+    size = 0.3,
+    manual = TRUE) +
+  labs(x = NULL, y = TeX("Hk2 log$_2$ relative abundance")) +
+  scale_color_manual(values = c("#ff6eff", "#5555ff")) +
+  scale_y_continuous(expand = expansion(mult = 5e-3)) +
+  coord_cartesian(ylim = c(-0.6, 0.6), clip = "off") +
+  theme_bw() +
+  theme(text = element_text(size = 6.5, color = "black"),
+        line = element_line(linewidth = 0.3, color = "black"),
+        axis.ticks = element_line(linewidth = 0.3, color = "black"),
+        panel.grid = element_blank(),
+        panel.border = element_blank(),
+        axis.ticks.x = element_blank(),
+        axis.text = element_text(size = 5,
+                                 color = "black"),
+        axis.text.x = element_text(size = 6.5, angle = 90, hjust = 1,
+                                   vjust = 0.5),
+        axis.title = element_text(size = 6.5, margin = margin(),
+                                  color = "black"),
+        axis.line = element_line(linewidth = 0.3),
+        strip.background = element_blank(),
+        strip.text = element_text(size = 6.5, color = "black",
+                                  margin = margin(b = 18, unit = "pt")),
+        panel.spacing = unit(-1, "pt"),
+        plot.title = element_text(size = 7, color = "black"),
+        plot.subtitle = element_text(size = 6, color = "black"),
+        legend.position = "none",
+        strip.placement = "outside"
+  )
+
+p
+

+
+ggsave(file.path("..", "..", "plots", "Hk2_skeletal_muscle.pdf"), p, 
+       height = 1.7, width = 2.5, dpi = 400, bg = "white")
+
+

Session Info +

+
+sessionInfo()
+#> R version 4.3.3 (2024-02-29)
+#> Platform: x86_64-pc-linux-gnu (64-bit)
+#> Running under: Ubuntu 22.04.4 LTS
+#> 
+#> Matrix products: default
+#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
+#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
+#> 
+#> locale:
+#>  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
+#>  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
+#>  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
+#> [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
+#> 
+#> time zone: UTC
+#> tzcode source: system (glibc)
+#> 
+#> attached base packages:
+#> [1] stats     graphics  grDevices utils     datasets  methods   base     
+#> 
+#> other attached packages:
+#> [1] latex2exp_0.9.6                 ggpubr_0.6.0                   
+#> [3] emmeans_1.10.0                  ggplot2_3.5.0                  
+#> [5] tidyr_1.3.1                     dplyr_1.1.4                    
+#> [7] MotrpacRatTraining6moData_2.0.0
+#> 
+#> loaded via a namespace (and not attached):
+#>  [1] sass_0.4.8        utf8_1.2.4        generics_0.1.3    rstatix_0.7.2    
+#>  [5] stringi_1.8.3     digest_0.6.34     magrittr_2.0.3    evaluate_0.23    
+#>  [9] grid_4.3.3        estimability_1.5  mvtnorm_1.2-4     fastmap_1.1.1    
+#> [13] jsonlite_1.8.8    backports_1.4.1   purrr_1.0.2       fansi_1.0.6      
+#> [17] scales_1.3.0      textshaping_0.3.7 jquerylib_0.1.4   abind_1.4-5      
+#> [21] cli_3.6.2         rlang_1.1.3       munsell_0.5.0     withr_3.0.0      
+#> [25] cachem_1.0.8      yaml_2.3.8        ggbeeswarm_0.7.2  tools_4.3.3      
+#> [29] memoise_2.0.1     ggsignif_0.6.4    colorspace_2.1-0  broom_1.0.5      
+#> [33] vctrs_0.6.5       R6_2.5.1          lifecycle_1.0.4   stringr_1.5.1    
+#> [37] car_3.1-2         fs_1.6.3          vipor_0.4.7       ragg_1.2.7       
+#> [41] beeswarm_0.4.0    pkgconfig_2.0.3   desc_1.4.3        pkgdown_2.0.7    
+#> [45] pillar_1.9.0      bslib_0.6.1       gtable_0.3.4      glue_1.7.0       
+#> [49] systemfonts_1.0.5 highr_0.10        xfun_0.42         tibble_3.2.1     
+#> [53] tidyselect_1.2.0  knitr_1.45        farver_2.1.1      htmltools_0.5.7  
+#> [57] labeling_0.4.3    carData_3.0-5     rmarkdown_2.25    compiler_4.3.3
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/plot_Hk2_files/figure-html/unnamed-chunk-3-1.png b/articles/plot_Hk2_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..9d4946b Binary files /dev/null and b/articles/plot_Hk2_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/articles/plot_TAG_chain_length_vs_logFC.html b/articles/plot_TAG_chain_length_vs_logFC.html new file mode 100644 index 0000000..217aba6 --- /dev/null +++ b/articles/plot_TAG_chain_length_vs_logFC.html @@ -0,0 +1,308 @@ + + + + + + + +Plots of TAG chain length or number of double bonds vs. log2 fold-change • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates plots of triacylglycerol (TAG) chain length or +number of double bonds vs. log\(_2\) +fold-change (Extended Data Fig. 7B, C).

+
+# Required packages
+library(MotrpacRatTraining6moWATData)
+library(dplyr)
+library(ggplot2)
+library(patchwork)
+library(grid)
+library(gridExtra)
+library(lemon) # facet_rep_grid
+library(latex2exp)
+
+plot_TAG <- function(x) {
+  lapply(c("chain_length", "double_bond"), function(var_i) {
+    
+    if (var_i == "chain_length") {
+      y_lims <- c(-1.5, 2)
+      x_minor_breaks <- seq(30, 60, 5)
+      x_breaks <- seq(30, 60, 10)
+    } else {
+      y_lims <- c(-1.4, 1.4)
+      x_minor_breaks <- 0:11
+      x_breaks <- seq(0, 11, 2)
+    }
+    
+    ggplot(x, aes(x = !!sym(var_i),
+                  y = logFC, color = sex)) +
+      geom_hline(color = "black", yintercept = 0, lty = "dashed",
+                 linewidth = 0.3 * scale) +
+      geom_point(size = 1.2, alpha = 0.5) +
+      geom_smooth(linewidth = 0.4, se = TRUE, method = "loess",
+                  span = 1, fill = "black", alpha = 0.2) +
+      # redraw lines on top
+      geom_smooth(linewidth = 0.3 * scale, se = FALSE, method = "loess",
+                  span = 1, fill = "black", color = "black") +
+      lemon::facet_rep_grid(sex ~ timepoint, scales = "free_x",
+                            repeat.tick.labels = "bottom") +
+      scale_y_continuous(name = latex2exp::TeX("log$_2$(fold-change)"),
+                         expand = expansion(mult = 5e-3)) +
+      coord_cartesian(ylim = y_lims) +
+      scale_x_continuous(breaks = x_breaks,
+                         minor_breaks = x_minor_breaks,
+                         expand = expansion(5e-3)) +
+      scale_color_manual(name = NULL, values = c("#ff6eff", "#5555ff")) +
+      theme_bw() +
+      theme(text = element_text(size = 6.5 * scale, color = "black"),
+            line = element_line(linewidth = 0.3 * scale, color = "black"),
+            axis.line.y.right = element_blank(),
+            axis.ticks = element_line(linewidth = 0.3 * scale, 
+                                      color = "black"),
+            axis.text = element_text(size = 5 * scale, color = "black"),
+            axis.title = element_text(size = 6.5 * scale, color = "black"),
+            axis.title.x = element_text(margin = margin(t = 6, unit = "pt")),
+            axis.title.y = element_text(margin = margin(r = 6, unit = "pt")),
+            strip.background = element_blank(),
+            strip.text = element_text(size = 6.5 * scale, hjust = 0),
+            panel.spacing.x = unit(ifelse(var_i == "chain_length",
+                                          0, -7 * scale), "pt"),
+            panel.grid.minor = element_blank(),
+            panel.grid = element_line(linewidth = 0.3 * scale),
+            strip.text.y = element_text(hjust = 0.5),
+            plot.title = element_text(size = 7 * scale, color = "black"),
+            plot.subtitle = element_text(size = 5.5 * scale, color = "black"))
+  })
+}
+
+x <- METAB_DA$trained_vs_SED %>%
+  filter(lipid_class == "TG") %>%
+  select(contrast, logFC, chain_length, double_bond) %>%
+  mutate(sex = substr(contrast, 1, 1),
+         sex = factor(sex, levels = c("F", "M"),
+                      labels = c("Female", "Male")),
+         timepoint = gsub("[MF]_", "", contrast),
+         timepoint = factor(timepoint))
+
+scale <- 2 # divide plot dimensions by 2 when adding to final figures.
+plotlist <- plot_TAG(x)
+
+plotlist[[1]] <- plotlist[[1]] +
+  labs(x = "TAG Chain Length") +
+  theme(panel.grid.minor.y = element_blank())
+
+plotlist[[2]] <- plotlist[[2]] +
+  labs(x = "TAG Double Bonds")
+
+ggsave(file.path("..", "..", "plots", "TAG_logFC_chain_length.pdf"),
+       plotlist[[1]], height = 1.8 * scale, width = 3.5 * scale, 
+       family = "ArialMT")
+
+ggsave(file.path("..", "..", "plots", "TAG_logFC_double_bonds.pdf"),
+       plotlist[[2]], height = 1.8 * scale, width = 3.5 * scale, 
+       family = "ArialMT")
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/plot_UpSet.html b/articles/plot_UpSet.html new file mode 100644 index 0000000..4bab58e --- /dev/null +++ b/articles/plot_UpSet.html @@ -0,0 +1,362 @@ + + + + + + + +Differential analysis UpSet Plots • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates UpSet plots of the differential analysis +results (Fig. 3A, B).

+
+# Required packages
+library(MotrpacRatTraining6moWATData)
+library(dplyr)
+library(purrr)
+library(tidyr)
+library(tibble)
+library(data.table)
+library(grid)
+library(grDevices)
+library(ComplexHeatmap)
+
+save_plots <- dir.exists(paths = file.path("..", "..", "plots"))
+
+# Get differential analysis results (trained vs. SED comparisons)
+omes <- c("TRNSCRPT", "PROT", "PHOSPHO", "METAB")
+
+res <- map(omes, function(ome) {
+  file <- paste0(ome, "_DA")
+  dea_res <- get(file)
+  
+  dea_res$trained_vs_SED %>%
+    filter(adj.P.Val < 0.05) %>%
+    mutate(ome = ome) %>%
+    dplyr::select(ome, contrast, feature,
+                  any_of(c("gene_symbol", "entrez_gene", "refmet_sub_class")))
+}) %>%
+  rbindlist(fill = TRUE) %>%
+  mutate(ome = factor(ome, levels = omes))
+
+res <- res %>%
+  group_by(ome, contrast) %>%
+  summarise(feature = list(unique(feature))) %>%
+  ungroup()
+
+## Create female-only and male-only UpSet plots
+for (sex in c("F", "M")) {
+  scale <- 1.5
+  
+  res1 <- filter(res, grepl(paste0("^", sex), contrast))
+  
+  tmp_i <- res1 %>%
+    group_by(contrast) %>%
+    summarise(feature = list(reduce(feature, union))) %>%
+    deframe()
+  
+  m <- make_comb_mat(tmp_i)
+  cs <- comb_size(m)
+  ss <- set_size(m)
+  m <- m[, order(-cs)[1:min(15, length(cs))]]
+  cs <- comb_size(m)
+  bar_ratio <- max(ss) / max(cs) * 0.8
+  row_order <- seq_along(ss)
+  column_order <- order(-cs)
+  
+  beside <- FALSE
+  # Colorblind-friendly colors: TRNSCRPT, PROT, PHOSPHO, METAB
+  fill_colors <- c("#614E3E", "#4E94F5", "#A5C3E0", "#D9CEA5")
+  
+  # Intersection sizes by ome
+  comb_bar <- res1 %>%
+    unnest(feature) %>%
+    mutate(value = 1) %>%
+    pivot_wider(id_cols = c(ome, feature),
+                names_from = "contrast",
+                values_from = "value",
+                values_fill = 0) %>%
+    pivot_longer(cols = -c(ome, feature)) %>%
+    group_by(ome, feature) %>%
+    summarise(name = paste(value, collapse = "")) %>%
+    group_by(ome, name) %>%
+    tally() %>%
+    pivot_wider(id_cols = name, values_from = "n",
+                names_from = "ome",
+                values_fill = 0) %>%
+    column_to_rownames("name") %>%
+    .[names(cs), ]
+  
+  # Intersection sizes
+  ta <- HeatmapAnnotation(
+    "Intersection Size" = anno_barplot(
+      x = comb_bar,
+      border = FALSE,
+      beside = beside,
+      gp = gpar(fill = fill_colors),
+      axis_param = list(gp = gpar(fontsize = 5.5 * scale))),
+    annotation_name_side = "left",
+    annotation_name_gp = gpar(fontsize = 6 * scale),
+    annotation_height = unit(0.7, "in") * scale)
+  
+  # Number of differential features by ome and contrast
+  set_bar <- res1 %>%
+    mutate(n = lengths(feature)) %>%
+    pivot_wider(id_cols = "contrast",
+                names_from = ome, values_from = n,
+                values_fill = 0) %>%
+    column_to_rownames("contrast")
+  
+  # Number of differential features
+  ra <- HeatmapAnnotation(
+    "Differential Features" = anno_barplot(
+      x = set_bar,
+      beside = beside,
+      border = FALSE,
+      gp = gpar(fill = fill_colors),
+      axis_param = list(gp = gpar(fontsize = 5.5 * scale)),
+      ylim = c(0, 2000)),
+    which = "row",
+    annotation_name_gp = gpar(fontsize = 6 * scale),
+    annotation_width = unit(1, "in") * scale)
+  
+  # UpSet plot
+  ht <- UpSet(m,
+              pt_size = unit(8 * scale, "pt"),
+              lwd = 2 * scale,
+              set_order = row_order,
+              comb_order = column_order,
+              top_annotation = ta,
+              right_annotation = ra,
+              row_names_gp = gpar(fontsize = 7 * scale),
+              width = 10 * unit(10, "pt") * scale,
+              height = 4 * unit(10, "pt") * scale,
+              row_labels = latex2exp::TeX(
+                sprintf("(%dW - SED)$_%s$", 2 ^ (0:3), sex)
+              )
+  )
+  
+  # Fill legend
+  lt <- Legend(at = omes, labels = omes,
+               border = TRUE,
+               gap = unit(0, "pt"),
+               grid_height = unit(7, "pt") * scale,
+               grid_width = unit(7, "pt") * scale,
+               labels_gp = gpar(fontsize = 6 * scale),
+               legend_gp = gpar(fill = fill_colors))
+  
+  
+  # Save UpSet plot to pdf
+  pdf(file = file.path("..", "..", "plots", 
+                       sprintf("UpSet_timewise_DEA_summary_%s.pdf",
+                               ifelse(sex == "F", "female", "male"))),
+      height = 2.2 * scale, width = 4 * scale, bg = "white",
+      family = "ArialMT")
+  draw(ht, annotation_legend_list = lt,
+       align_annotation_legend = "global_center")
+  dev.off()
+}
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/plot_adipocyte_size_distribution.html b/articles/plot_adipocyte_size_distribution.html new file mode 100644 index 0000000..febaeca --- /dev/null +++ b/articles/plot_adipocyte_size_distribution.html @@ -0,0 +1,360 @@ + + + + + + + +Plots of Adipocyte Size Distributions • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates plots of adipocyte size distributions (Fig. +1E, Extended Data Fig. 1D).

+ +
+foo <- ADIPOCYTE_SIZE_STATS %>%
+  dplyr::rename(p = p.value, statistic = ratio) %>%
+  mutate(diameter_bin = as.ordered(diameter_bin),
+         statistic = round(statistic, 2),
+         p.adj = p,
+         p.adj.signif = cut(p.adj, include.lowest = TRUE, right = FALSE,
+                            breaks = c(0, 1e-3, 1e-2, 0.05, 1),
+                            labels = c("***", "**", "*", "ns"))) %>%
+  ungroup() %>%
+  separate_wider_delim(cols = contrast, names = c("group2", "group1"), 
+                       delim = " / ") %>%
+  dplyr::select(diameter_bin, sex, group1, group2, statistic,
+                p, p.adj, p.adj.signif)
+
+levels(foo$diameter_bin)[c(1, 10)] <- c("[14.16,20)", "[60,62.32]")
+
+# Bin adipocytes in 5 micron intervals by diameter
+ADIPOCYTE_SIZE <- ADIPOCYTE_SIZE %>%
+  mutate(diameter_bin = cut(diameter, dig.lab = 4,
+                            breaks = c(14.16, seq(20, 60, 5), 62.32),
+                            include.lowest = TRUE, right = FALSE,
+                            ordered_result = TRUE))
+
+# Count adipocytes by bin and experimental group
+count_summary <- ADIPOCYTE_SIZE %>%
+  group_by(pid, sex, timepoint, diameter_bin) %>%
+  summarise(binned_adipocytes = n()) %>%
+  group_by(pid) %>%
+  mutate(total_adipocytes = sum(binned_adipocytes),
+         adipocyte_prop = binned_adipocytes / total_adipocytes) %>%
+  ungroup()
+
+stat.test <- count_summary %>%
+  group_by(diameter_bin, sex) %>%
+  t_test(adipocyte_prop ~ timepoint,
+         ref.group = "SED") %>%
+  add_xy_position(x = "diameter_bin", group = "timepoint",
+                  dodge = 0.65) %>%
+  mutate(y.position = y.position - 0.015 - 0.08 * (sex == "Male")) %>%
+  dplyr::select(-c(statistic, p, p.adj, p.adj.signif)) %>%
+  left_join(foo, by = c("diameter_bin", "sex", "group2", "group1"))
+
+timepoint_colors <- c("grey", "#238443", "#002612")
+
+p0 <- ggplot(count_summary) +
+  geom_point(aes(x = diameter_bin,
+                 y = adipocyte_prop,
+                 color = timepoint),
+             size = 0.45, shape = 21,
+             position = position_dodge(width = 0.6)) +
+  facet_wrap(~ sex, ncol = 1,
+             strip.position = "right", scales = "free") +
+  stat_pvalue_manual(data = mutate(stat.test,
+                                   label2 = round(statistic, 2)),
+                     # label = "p.adj.signif",
+                     label = "statistic",
+                     label.size = 1.76, # 5 pt
+                     vjust = -0.5,
+                     color = "group2",
+                     bracket.size = 0.3,
+                     step.group.by = "sex",
+                     tip.length = 0.01,
+                     hide.ns = TRUE) +
+  xlab(latex2exp::TeX("Adipocyte Diameter ($\\mu m$)")) +
+  scale_y_continuous(name = "Proportion",
+                     expand = expansion(mult = c(5e-3, 0.15))) +
+  coord_cartesian(ylim = c(0, NA)) +
+  scale_color_manual(name = "Timepoint",
+                     values = timepoint_colors) +
+  scale_fill_manual(name = "Timepoint",
+                    values = alpha(timepoint_colors, 0.15)) +
+  theme_pub() +
+  theme(strip.background = element_blank(),
+        legend.key.size = unit(8, "pt"),
+        legend.position = "top",
+        legend.direction = "horizontal",
+        legend.margin = margin(t = 0, b = -5),
+        plot.margin = unit(c(0, rep(2, 3)), "pt"),
+        axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1),
+        axis.ticks.x = element_blank(),
+        axis.ticks.length.x = unit(0, "pt"),
+        axis.text.x.bottom = element_text(margin = margin(t = 2, b = 2)),
+        panel.grid.major.x = element_blank(),
+        panel.grid.major.y = element_blank(),
+        panel.grid.minor.y = element_blank())
+
+p0
+

+
+ggsave(file.path("..", "..", "plots", "adipocyte_bin_plot.pdf"), p0,
+       height = 2.7, width = 2.4, family = "ArialMT")
+
+## Density plot ------------------
+p1 <- ggplot(ADIPOCYTE_SIZE, 
+             aes(x = diameter, color = timepoint, fill = timepoint)) +
+  geom_density() +
+  facet_wrap(~ sex, ncol = 1, drop = FALSE, scales = "free_x",
+             strip.position = "right") +
+  scale_x_continuous(name = latex2exp::TeX(
+    "Adipocyte Diameter ($\\mu m$)"
+  ),
+  # The density lines will continue to any specified limits
+  # Need to stop at data range and add expansion to reach
+  # desired values
+  limits = c(range(ADIPOCYTE_SIZE$diameter)),
+  expand = expansion(add = c(min(ADIPOCYTE_SIZE$diameter) - 10,
+                             65 - max(ADIPOCYTE_SIZE$diameter))),
+  breaks = seq(10, 60, 10)
+  ) +
+  coord_cartesian(xlim = c(10, 65), default = T) +
+  scale_y_continuous(name = "Density",
+                     expand = expansion(mult = c(5e-3, 0.02))) +
+  coord_cartesian(ylim = c(0, NA)) +
+  scale_color_manual(name = "Timepoint:",
+                     values = timepoint_colors) +
+  scale_fill_manual(name = "Timepoint:",
+                    values = alpha(timepoint_colors, 0.15)) +
+  theme_pub() +
+  theme(strip.background = element_blank(),
+        legend.key.size = unit(8, "pt"),
+        legend.position = "top",
+        legend.direction = "horizontal",
+        legend.margin = margin(t = 0, b = -5),
+        plot.margin = unit(c(0, rep(2, 3)), "pt"),
+        axis.text.x.bottom = element_text(margin = margin(t = 2, b = 2)),
+        panel.grid.major.x = element_blank(),
+        panel.grid.major.y = element_blank(),
+        panel.grid.minor.y = element_blank())
+
+p1
+

+
+ggsave(file.path("..", "..", "plots", "adipocyte_density_plot.pdf"), p1,
+       height = 2.5, width = 2, family = "ArialMT")
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/plot_adipocyte_size_distribution_files/figure-html/unnamed-chunk-3-1.png b/articles/plot_adipocyte_size_distribution_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..610dbd9 Binary files /dev/null and b/articles/plot_adipocyte_size_distribution_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/articles/plot_adipocyte_size_distribution_files/figure-html/unnamed-chunk-5-1.png b/articles/plot_adipocyte_size_distribution_files/figure-html/unnamed-chunk-5-1.png new file mode 100644 index 0000000..72b2ba4 Binary files /dev/null and b/articles/plot_adipocyte_size_distribution_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/articles/plot_analytes.html b/articles/plot_analytes.html new file mode 100644 index 0000000..f02da8f --- /dev/null +++ b/articles/plot_analytes.html @@ -0,0 +1,456 @@ + + + + + + + +Plots of plasma clinical analytes • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates plots of the plasma clinical analytes (Fig. +1F–I, Extended Data Fig. 1E, F).

+
+# Required packages
+library(MotrpacRatTraining6moWAT) # plot_baseline
+library(MotrpacRatTraining6moWATData)
+library(ggplot2)
+library(dplyr)
+library(purrr)
+library(tidyr)
+library(tibble)
+library(emmeans)
+library(scales)
+
+save_plots <- dir.exists(paths = file.path("..", "..", "plots"))
+
+x <- ANALYTES %>%
+  filter(omics_subset) %>%
+  dplyr::rename(group = timepoint)
+
+stats_df <- ANALYTES_STATS$timewise
+
+# Reformat confidence interval data
+conf_df <- map(ANALYTES_EMM$timewise, function(emm_i) {
+  terms_i <- attr(terms(emm_i@model.info), which = "term.labels")
+
+  out <- summary(emm_i) %>%
+    as.data.frame() %>%
+    dplyr::rename(any_of(c(lower.CL = "asymp.LCL",
+                    upper.CL = "asymp.UCL",
+                    response_mean = "response",
+                    response_mean = "rate")))
+
+  out <- out %>%
+    mutate(timepoint = factor(timepoint,
+                          levels = c("SED", paste0(2 ^ (0:3), "W"))))
+
+  return(out)
+}) %>%
+  enframe(name = "response") %>%
+  unnest(value) %>%
+  dplyr::rename(group = timepoint)
+
+

Glucagon +

+
+## Glucagon
+plot_baseline(x, response = "glucagon",
+              conf = filter(conf_df, response == "Glucagon"),
+              stats = filter(stats_df, response == "Glucagon"),
+              bracket.nudge.y = 12) +
+  scale_y_continuous(name = "Glucagon (pM)",
+                     breaks = seq(0, 160, 40),
+                     expand = expansion(mult = 5e-3)) +
+  coord_cartesian(ylim = c(0, 160), clip = "off") +
+  theme(plot.margin = margin(t = 4, r = 4, b = 4, l = 4),
+        strip.text = element_text(margin = margin(b = 14)))
+

+
+ggsave(file.path("..", "..", "plots", "analytes_glucagon.pdf"),
+       height = 1.9, width = 1.9, dpi = 400)
+
+
+

Glucose +

+
+## Glucose
+plot_baseline(x, response = "glucose",
+              conf = filter(conf_df, response == "Glucose"),
+              stats = filter(stats_df, response == "Glucose"),
+              bracket.nudge.y = 6) +
+  scale_y_continuous(name = "Glucose (mg/dL)",
+                     expand = expansion(mult = 5e-3)) +
+  coord_cartesian(ylim = c(115, 200), clip = "off") +
+  theme(plot.margin = margin(t = 4, r = 4, b = 4, l = 4),
+        strip.text = element_text(margin = margin(b = 4)))
+

+
+ggsave(file.path("..", "..", "plots", "analytes_glucose.pdf"),
+       height = 1.9, width = 1.6, dpi = 400)
+
+
+

Glycerol +

+
+## Glycerol
+plot_baseline(x, response = "glycerol",
+              conf = filter(conf_df, response == "Glycerol"),
+              stats = filter(stats_df, response == "Glycerol"),
+              bracket.nudge.y = 0.2) +
+  scale_y_continuous(name = "Glycerol (mg/dL)",
+                     expand = expansion(mult = 5e-3)) +
+  coord_cartesian(ylim = c(0, 3), clip = "off") +
+  theme(plot.margin = margin(t = 4, r = 4, b = 4, l = 4),
+        strip.text = element_text(margin = margin(b = 5)))
+

+
+ggsave(file.path("..", "..", "plots", "analytes_glycerol.pdf"),
+       height = 1.9, width = 1.6, dpi = 400)
+
+
+

Insulin +

+
+## Insulin
+plot_baseline(x, response = "insulin_iu",
+              bracket.nudge.y = 10) +
+  scale_y_continuous(name = "Insulin (mg/dL)",
+                     expand = expansion(mult = 5e-3),
+                     breaks = seq(20, 140, 20),
+                     sec.axis = sec_axis(name = "Insulin (pg/mL)",
+                                         trans = ~ .x / 0.023,
+                                         breaks = 1000 * 1:6)) +
+  coord_cartesian(ylim = c(20, 140), clip = "off") +
+  theme(plot.margin = margin(t = 4, r = 4, b = 4, l = 4),
+        strip.text = element_text(margin = margin(b = 5)))
+

+
+ggsave(file.path("..", "..", "plots", "analytes_insulin.pdf"),
+       height = 1.9, width = 1.8, dpi = 400)
+
+
+

Leptin +

+
+## Leptin
+plot_baseline(x, response = "leptin",
+              conf = filter(conf_df, response == "Leptin"),
+              stats = filter(stats_df, response == "Leptin"),
+              bracket.nudge.y = 1e4 / 3) +
+  scale_y_continuous(name = "Leptin (pg/mL)",
+                     labels = scales::label_scientific(digits = 1),
+                     expand = expansion(mult = 5e-3)) +
+  coord_cartesian(ylim = c(0, 6e4), clip = "off") +
+  theme(plot.margin = margin(t = 4, r = 4, b = 4, l = 4),
+        strip.text = element_text(margin = margin(b = 14)))
+

+
+ggsave(file.path("..", "..", "plots", "analytes_leptin.pdf"),
+       height = 1.9, width = 1.6, dpi = 400)
+
+
+

NEFA +

+
+## NEFA
+plot_baseline(x, response = "nefa",
+              conf = filter(conf_df, response == "NEFA"),
+              stats = filter(stats_df, response == "NEFA"),
+              bracket.nudge.y = 0.1) +
+  scale_y_continuous(name = "NEFA (mmol/L)",
+                     breaks = seq(0.3, 1.3, 0.2),
+                     expand = expansion(mult = 5e-3)) +
+  coord_cartesian(ylim = c(0.3, 1.3), clip = "off") +
+  theme(plot.margin = margin(t = 4, r = 4, b = 4, l = 4),
+        strip.text = element_text(margin = margin(b = 10)))
+

+
+ggsave(file.path("..", "..", "plots", "analytes_nefa.pdf"),
+       height = 1.9, width = 1.9, dpi = 400)
+
+
+

Session Info +

+
+sessionInfo()
+#> R version 4.3.3 (2024-02-29)
+#> Platform: x86_64-pc-linux-gnu (64-bit)
+#> Running under: Ubuntu 22.04.4 LTS
+#> 
+#> Matrix products: default
+#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
+#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
+#> 
+#> locale:
+#>  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
+#>  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
+#>  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
+#> [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
+#> 
+#> time zone: UTC
+#> tzcode source: system (glibc)
+#> 
+#> attached base packages:
+#> [1] stats     graphics  grDevices utils     datasets  methods   base     
+#> 
+#> other attached packages:
+#>  [1] scales_1.3.0                       emmeans_1.10.0                    
+#>  [3] tibble_3.2.1                       tidyr_1.3.1                       
+#>  [5] purrr_1.0.2                        dplyr_1.1.4                       
+#>  [7] ggplot2_3.5.0                      MotrpacRatTraining6moWATData_2.0.0
+#>  [9] MotrpacRatTraining6moWAT_1.0.0     Biobase_2.62.0                    
+#> [11] BiocGenerics_0.48.1               
+#> 
+#> loaded via a namespace (and not attached):
+#>   [1] RColorBrewer_1.1-3      rstudioapi_0.15.0       jsonlite_1.8.8         
+#>   [4] shape_1.4.6.1           magrittr_2.0.3          estimability_1.5       
+#>   [7] ggbeeswarm_0.7.2        farver_2.1.1            rmarkdown_2.25         
+#>  [10] GlobalOptions_0.1.2     fs_1.6.3                zlibbioc_1.48.0        
+#>  [13] ragg_1.2.7              vctrs_0.6.5             memoise_2.0.1          
+#>  [16] RCurl_1.98-1.14         base64enc_0.1-3         rstatix_0.7.2          
+#>  [19] htmltools_0.5.7         dynamicTreeCut_1.63-1   curl_5.2.1             
+#>  [22] broom_1.0.5             Formula_1.2-5           sass_0.4.8             
+#>  [25] bslib_0.6.1             htmlwidgets_1.6.4       desc_1.4.3             
+#>  [28] impute_1.76.0           cachem_1.0.8            lifecycle_1.0.4        
+#>  [31] iterators_1.0.14        pkgconfig_2.0.3         Matrix_1.6-5           
+#>  [34] R6_2.5.1                fastmap_1.1.1           GenomeInfoDbData_1.2.11
+#>  [37] clue_0.3-65             digest_0.6.34           colorspace_2.1-0       
+#>  [40] patchwork_1.2.0         AnnotationDbi_1.64.1    S4Vectors_0.40.2       
+#>  [43] textshaping_0.3.7       Hmisc_5.1-1             RSQLite_2.3.5          
+#>  [46] ggpubr_0.6.0            labeling_0.4.3          filelock_1.0.3         
+#>  [49] latex2exp_0.9.6         fansi_1.0.6             httr_1.4.7             
+#>  [52] abind_1.4-5             compiler_4.3.3          withr_3.0.0            
+#>  [55] bit64_4.0.5             doParallel_1.0.17       htmlTable_2.4.2        
+#>  [58] backports_1.4.1         BiocParallel_1.36.0     carData_3.0-5          
+#>  [61] DBI_1.2.2               highr_0.10              ggsignif_0.6.4         
+#>  [64] rjson_0.2.21            tools_4.3.3             vipor_0.4.7            
+#>  [67] foreign_0.8-86          beeswarm_0.4.0          msigdbr_7.5.1          
+#>  [70] nnet_7.3-19             glue_1.7.0              grid_4.3.3             
+#>  [73] checkmate_2.3.1         cluster_2.1.6           fgsea_1.28.0           
+#>  [76] generics_0.1.3          gtable_0.3.4            preprocessCore_1.64.0  
+#>  [79] data.table_1.15.2       WGCNA_1.72-5            car_3.1-2              
+#>  [82] utf8_1.2.4              XVector_0.42.0          foreach_1.5.2          
+#>  [85] pillar_1.9.0            stringr_1.5.1           babelgene_22.9         
+#>  [88] limma_3.58.1            circlize_0.4.16         splines_4.3.3          
+#>  [91] BiocFileCache_2.10.1    lattice_0.22-5          survival_3.5-8         
+#>  [94] bit_4.0.5               tidyselect_1.2.0        GO.db_3.18.0           
+#>  [97] ComplexHeatmap_2.18.0   locfit_1.5-9.9          Biostrings_2.70.2      
+#> [100] knitr_1.45              gridExtra_2.3           IRanges_2.36.0         
+#> [103] edgeR_4.0.16            stats4_4.3.3            xfun_0.42              
+#> [106] statmod_1.5.0           matrixStats_1.2.0       stringi_1.8.3          
+#> [109] yaml_2.3.8              evaluate_0.23           codetools_0.2-19       
+#> [112] cli_3.6.2               ontologyIndex_2.12      rpart_4.1.23           
+#> [115] systemfonts_1.0.5       munsell_0.5.0           jquerylib_0.1.4        
+#> [118] Rcpp_1.0.12             GenomeInfoDb_1.38.6     dbplyr_2.4.0           
+#> [121] png_0.1-8               fastcluster_1.2.6       parallel_4.3.3         
+#> [124] pkgdown_2.0.7           blob_1.2.4              bitops_1.0-7           
+#> [127] mvtnorm_1.2-4           crayon_1.5.2            GetoptLong_1.0.5       
+#> [130] rlang_1.1.3             cowplot_1.1.3           fastmatch_1.1-4        
+#> [133] KEGGREST_1.42.0
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/plot_analytes_files/figure-html/unnamed-chunk-11-1.png b/articles/plot_analytes_files/figure-html/unnamed-chunk-11-1.png new file mode 100644 index 0000000..cd9e961 Binary files /dev/null and b/articles/plot_analytes_files/figure-html/unnamed-chunk-11-1.png differ diff --git a/articles/plot_analytes_files/figure-html/unnamed-chunk-13-1.png b/articles/plot_analytes_files/figure-html/unnamed-chunk-13-1.png new file mode 100644 index 0000000..d49ed86 Binary files /dev/null and b/articles/plot_analytes_files/figure-html/unnamed-chunk-13-1.png differ diff --git a/articles/plot_analytes_files/figure-html/unnamed-chunk-3-1.png b/articles/plot_analytes_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..b0adc2c Binary files /dev/null and b/articles/plot_analytes_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/articles/plot_analytes_files/figure-html/unnamed-chunk-5-1.png b/articles/plot_analytes_files/figure-html/unnamed-chunk-5-1.png new file mode 100644 index 0000000..731903d Binary files /dev/null and b/articles/plot_analytes_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/articles/plot_analytes_files/figure-html/unnamed-chunk-7-1.png b/articles/plot_analytes_files/figure-html/unnamed-chunk-7-1.png new file mode 100644 index 0000000..1f1fc4f Binary files /dev/null and b/articles/plot_analytes_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/articles/plot_analytes_files/figure-html/unnamed-chunk-9-1.png b/articles/plot_analytes_files/figure-html/unnamed-chunk-9-1.png new file mode 100644 index 0000000..38ccca6 Binary files /dev/null and b/articles/plot_analytes_files/figure-html/unnamed-chunk-9-1.png differ diff --git a/articles/plot_mito_reads_and_cardiolipin.html b/articles/plot_mito_reads_and_cardiolipin.html new file mode 100644 index 0000000..217eb85 --- /dev/null +++ b/articles/plot_mito_reads_and_cardiolipin.html @@ -0,0 +1,329 @@ + + + + + + + +Plots of % mitochondrial reads and cardiolipin • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates plots of % mitochondrial reads and cardiolipin +(Fig. 5C).

+ +
+# Reformat data for plotting
+mito <- TRNSCRPT_META %>%
+  filter(grepl("white adipose", Tissue, ignore.case = TRUE)) %>%
+  dplyr::rename(bid = BID) %>%
+  inner_join(pData(TRNSCRPT_EXP), by = "bid") %>%
+  mutate(prop_mt = pct_chrM / 100)
+
+# Plot % mitochondrial reads
+mito_reads <- ggplot(mito, aes(x = timepoint, y = pct_chrM)) +
+  stat_summary(fun.data = "mean_sdl",
+               fun.args = list(mult = 1),
+               mapping = aes(color = sex),
+               show.legend = FALSE,
+               geom = "crossbar", width = 0.8,
+               na.rm = TRUE, fatten = 1, size = 0.3) +
+  ggbeeswarm::geom_beeswarm(size = 0.5, cex = 3, groupOnX = TRUE) +
+  scale_color_manual(values = c("#ff6eff", "#3366ff"),
+                     breaks = c("Female", "Male")) +
+  guides(color = guide_none()) +
+  facet_wrap(~ sex, nrow = 1) +
+  scale_y_continuous(limits = c(3.4, 6)) +
+  coord_cartesian(ylim = c(3.5, NA)) +
+  labs(x = NULL,
+       y = "% Mitochondrial Reads",
+       title = "Mitochondrial Reads in RNA-Seq") +
+  theme_minimal(base_size = 6) +
+  theme(axis.text.x = element_text(color = "black",
+                                   size = 5, angle = 90,
+                                   vjust = 0.5, hjust = 1),
+        axis.text.y = element_text(color = "black", size = 5),
+        axis.title.y = element_text(color = "black", size = 6.5),
+        plot.title = element_text(color = "black",size = 6.5),
+        panel.grid = element_blank(),
+        axis.ticks.y = element_line(color = "black", size = 0.3),
+        axis.line = element_line(color = "black", size = 0.3),
+        plot.background = element_rect(fill = "white",
+                                       color = NA),
+        legend.text = element_text(color = "black", size = 5),
+        legend.title = element_text(color = "black", size = 5),
+        strip.text = element_text(color = "black", size = 6.5))
+
+mito_reads
+

+
ggsave(file.path("..", "..", "plots", "pct_mito_reads.pdf"), mito_reads,
+       height = 1.4, width = 1.5, family = "ArialMT")
+
+## Testing
+# Males
+kruskal.test(prop_mt ~ timepoint, data = filter(mito, sex == "Male"))
+#> 
+#>  Kruskal-Wallis rank sum test
+#> 
+#> data:  prop_mt by timepoint
+#> Kruskal-Wallis chi-squared = 0.433, df = 4, p-value = 0.9797
+# Kruskal-Wallis chi-squared = 0.433, df = 4, p-value = 0.9797
+
+# Females
+kruskal.test(prop_mt ~ timepoint, data = filter(mito, sex == "Female"))
+#> 
+#>  Kruskal-Wallis rank sum test
+#> 
+#> data:  prop_mt by timepoint
+#> Kruskal-Wallis chi-squared = 5.417, df = 4, p-value = 0.2471
+# Kruskal-Wallis chi-squared = 5.417, df = 4, p-value = 0.2471
+
+# Plot cardiolipin
+METAB_EXP$cardiolipin <- exprs(METAB_EXP)["CL(72:8)_feature1", ]
+
+cl <- ggplot(pData(METAB_EXP),
+             aes(x = timepoint, y = cardiolipin)) +
+  stat_summary(fun.data = "mean_sdl",
+               fun.args = list(mult = 1),
+               mapping = aes(color = sex),
+               show.legend = FALSE,
+               geom = "crossbar", width = 0.8,
+               na.rm = TRUE, fatten = 1, size = 0.3) +
+  scale_color_manual(values = c("#ff6eff", "#3366ff"),
+                     breaks = c("Female", "Male")) +
+  ggbeeswarm::geom_beeswarm(size = 0.6, cex = 4.5, groupOnX = TRUE) +
+  facet_wrap(~ sex, nrow = 1) +
+  lims(y = c(-3, 0)) +
+  labs(x = NULL,
+       y = latex2exp::TeX("log$_2$(abundance)"),
+       title = "CL(72:8)") +
+  theme_minimal(base_size = 6) +
+  theme(axis.text.x = element_text(color = "black", size = 5, angle = 90,
+                                   vjust = 0.5, hjust = 1),
+        axis.text.y = element_text(color = "black", size = 5),
+        axis.title.y = element_text(color = "black", size = 6.5),
+        plot.title = element_text(color = "black", size = 6.5),
+        panel.grid = element_blank(),
+        axis.ticks.y = element_line(color = "black", size = 0.3),
+        axis.line = element_line(color = "black", size = 0.3),
+        plot.background = element_rect(fill = "white",
+                                       color = NA),
+        legend.text = element_text(color = "black", size = 5),
+        legend.title = element_text(color = "black", size = 5),
+        strip.text = element_text(color = "black", size = 6.5))
+
+cl
+

+
ggsave(file.path("..", "..", "plots", "METAB_cardiolipin.pdf"), cl,
+       height = 1.4, width = 1.5, family = "ArialMT")
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/plot_mito_reads_and_cardiolipin_files/figure-html/unnamed-chunk-3-1.png b/articles/plot_mito_reads_and_cardiolipin_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..ed7c286 Binary files /dev/null and b/articles/plot_mito_reads_and_cardiolipin_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/articles/plot_mito_reads_and_cardiolipin_files/figure-html/unnamed-chunk-5-1.png b/articles/plot_mito_reads_and_cardiolipin_files/figure-html/unnamed-chunk-5-1.png new file mode 100644 index 0000000..7e72146 Binary files /dev/null and b/articles/plot_mito_reads_and_cardiolipin_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/articles/plot_mtDNA.html b/articles/plot_mtDNA.html new file mode 100644 index 0000000..581bafe --- /dev/null +++ b/articles/plot_mtDNA.html @@ -0,0 +1,253 @@ + + + + + + + +Plot of Mitochondrial DNA (mtDNA) • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates a plot of the mitochondrial DNA (Extended Data +Fig. 7A).

+ +
+p1 <- ggplot(MITO_DNA, aes(x = timepoint, y = relative_expr)) +
+  facet_wrap(~ sex, drop = FALSE, nrow = 1) +
+  geom_hline(yintercept = 1, lty = "dashed", 
+             color = "black", linewidth = 0.3) +
+  ggbeeswarm::geom_beeswarm(aes(color = sex),
+                            cex = 3, size = 0.5) +
+  # ggpubr::stat_compare_means(method = "kruskal",
+  #                            label.sep = ":\n",
+  #                            label.x = 1.5, label.y = 2.3,
+  #                            hjust = 0, vjust = 1, size = 1.76) +
+  scale_y_continuous(limits = c(0.5, NA),
+                     breaks = seq(0.5, 2.5, 0.5),
+                     expand = expansion(mult = c(5e-3, 0.05))) +
+  scale_color_manual(values = c("#ff6eff", "#5555ff")) +
+  guides(color = guide_none()) +
+  labs(x = NULL,
+       y = TeX("$2^{- \\Delta \\Delta C_T}$ (relative to SED females)")) +
+  theme_pub() +
+  theme(strip.background = element_blank(),
+        panel.grid.major = element_blank(),
+        panel.grid.minor = element_blank(),
+        axis.ticks.x = element_blank(),
+        axis.ticks.length = unit(2, "pt"),
+        plot.margin = unit(c(0, rep(3, 3)), "pt"))
+
+p1
+

+
+ggsave(file.path("..", "..", "plots", "mtDNA.pdf"), 
+       p1, height = 1.8, width = 2, dpi = 400)
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/plot_mtDNA_files/figure-html/unnamed-chunk-2-1.png b/articles/plot_mtDNA_files/figure-html/unnamed-chunk-2-1.png new file mode 100644 index 0000000..a53efcb Binary files /dev/null and b/articles/plot_mtDNA_files/figure-html/unnamed-chunk-2-1.png differ diff --git a/articles/plot_pct_fat_vs_leptin.html b/articles/plot_pct_fat_vs_leptin.html new file mode 100644 index 0000000..d65b317 --- /dev/null +++ b/articles/plot_pct_fat_vs_leptin.html @@ -0,0 +1,273 @@ + + + + + + + +Plot of Change in % Body Fat vs. Plasma Leptin • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates a scatterplot of the (post - pre) change in % +body fat vs. plasma leptin levels (Extended Data Fig. 1G).

+
+library(MotrpacRatTraining6moWATData)
+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
+library(ggplot2)
+library(scales)
+
+save_plots <- dir.exists(paths = file.path("..", "..", "plots"))
+
+x <- PHENO_WAT %>% 
+  filter(omics_analysis) %>% 
+  transmute(pid = as.numeric(pid),
+            fat_diff = post_fat_pct - pre_fat_pct) %>% 
+  left_join(ANALYTES, by = "pid") %>% 
+  dplyr::select(pid, sex, timepoint, fat_diff, leptin)
+
+p <- ggplot(x, aes(x = fat_diff, y = leptin)) +
+  stat_smooth(aes(group = sex), method = "lm", 
+              formula = "y ~ x", se = FALSE, lty = 2,
+              color = "black", linewidth = 0.3) +
+  geom_point(aes(shape = sex, color = timepoint),
+             size = 1) +
+  scale_x_continuous(name = "Change in % Body Fat (Post - Pre)",
+                     breaks = seq(-6, 4, 2)) +
+  scale_y_continuous(name = "Leptin (pg/mL)",
+                     limits = c(0, NA),
+                     breaks = 1e04 * (0:6),
+                     labels = scales::label_scientific(digits = 1)) +
+  scale_color_manual(name = "Timepoint",
+                     values = c("#bebebe", "#238443", "black")) +
+  guides(shape = guide_legend(title = "Sex")) +
+  theme_bw(base_size = 6) +
+  theme(axis.text = element_text(size = 6, color = "black"),
+        axis.title.x = element_text(size = 6.5, color = "black",
+                                    margin = margin(t = 6)),
+        axis.title.y = element_text(size = 6.5, color = "black",
+                                    margin = margin(r = 6)),
+        legend.title = element_text(size = 6.5, color = "black"),
+        legend.text = element_text(size = 6, color = "black"),
+        legend.key.size = unit(8, "pt"),
+        axis.line = element_line(color = "black", linewidth = 0.3),
+        panel.grid.major = element_line(linewidth = 0.3),
+        panel.grid.minor = element_blank(),
+        panel.border = element_blank())
+
+p
+

+
+ggsave(file.path("..", "..", "plots", "pct_fat_vs_leptin.pdf"), p,
+       height = 1.7, width = 2.4, family = "ArialMT")
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/plot_pct_fat_vs_leptin_files/figure-html/unnamed-chunk-3-1.png b/articles/plot_pct_fat_vs_leptin_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..ee05b80 Binary files /dev/null and b/articles/plot_pct_fat_vs_leptin_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/articles/plot_pre_post.html b/articles/plot_pre_post.html new file mode 100644 index 0000000..d18ec79 --- /dev/null +++ b/articles/plot_pre_post.html @@ -0,0 +1,322 @@ + + + + + + + +Plots of pre and post training values • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates plots of post- and pre-training measures of +body mass, body composition, and VO\(_2\)max (Fig. 1B, C; Extended Data Fig. +1A–C).

+
+library(MotrpacRatTraining6moWAT) # plot_pre_post
+library(MotrpacRatTraining6moWATData)
+library(dplyr)
+library(ggplot2)
+
+save_plots <- dir.exists(paths = file.path("..", "..", "plots"))
+
+x <- PHENO_WAT %>%
+  filter(omics_analysis) %>%
+  rename(group = timepoint) %>%
+  mutate(age = "6M")
+
+y <- rename(PHENO_WAT_STATS, group = timepoint)
+
+

Total Body Mass +

+
+# Body mass (measured on NMR day)
+p_wt <- plot_pre_post(x, 
+                      pre = "pre_weight", 
+                      post = "post_weight",
+                      stats = filter(y, response == "NMR Weight")) +
+  facet_grid(~ sex) +
+  labs(y = "Total Body Mass (g)")
+
+p_wt
+

+
+ggsave(file.path("..", "..", "plots", "pre_post_NMR_body_mass.pdf"), p_wt,
+       height = 1.7, width = 2.2, family = "ArialMT")
+
+
+

NMR Body Fat +

+
+# NMR body fat
+p_fat <- plot_pre_post(x, pre = "pre_fat", post = "post_fat",
+                       stats = filter(y, response == "NMR Fat Mass")) +
+  facet_grid(~ sex) +
+  labs(y = "Body Fat (g)")
+
+p_fat
+

+
+ggsave(file.path("..", "..", "plots", "pre_post_NMR_fat.pdf"), p_fat,
+       height = 1.7, width = 2.2, family = "ArialMT")
+
+
+

NMR % Fat +

+
+# NMR % fat
+p_pct_fat <- plot_pre_post(x, pre = "pre_fat_pct", post = "post_fat_pct",
+                           stats = filter(y, response == "NMR % Fat")) +
+  facet_grid(~ sex) +
+  labs(y = "% Body Fat")
+
+p_pct_fat
+

+
+ggsave(file.path("..", "..", "plots", "pre_post_NMR_pct_fat.pdf"), p_pct_fat,
+       height = 1.7, width = 2.2, family = "ArialMT")
+
+
+

Relative VO\(_2\)max +

+
+# VO2max (mL/kg/min)
+p_vo2 <- plot_pre_post(
+  x, pre = "pre_vo2max_ml_kg_min",
+  post = "post_vo2max_ml_kg_min",
+  stats = filter(y, response == "VO2max (relative to body mass)") %>%
+    slice(rep(1:n(), times = 2)) %>%
+    mutate(sex = rep(c("Female", "Male"), each = 3))) +
+  facet_grid(~ sex) +
+  labs(y = latex2exp::TeX("VO$_2$max (mL/kg/min)"))
+
+p_vo2
+

+
+ggsave(file.path("..", "..", "plots", "pre_post_relative_VO2max.pdf"), p_vo2,
+       height = 1.7, width = 2.2, family = "ArialMT")
+
+
+

VO\(_2\)max (relative to lean +mass) +

+
+# VO2max (relative to lean mass)
+p_vo2_lean <- plot_pre_post(
+  x, pre = "pre_vo2max_ml_kg_lean_min",
+  post = "post_vo2max_ml_kg_lean_min",
+  stats = filter(y, response == "VO2max (relative to lean mass)")) +
+  facet_grid(~ sex) +
+  labs(y = latex2exp::TeX("VO$_2$max (mL/kg lean/min)")) +
+  coord_cartesian(ylim = c(100, 165))
+
+p_vo2_lean
+

+
+ggsave(file.path("..", "..", "plots", "pre_post_lean_relative_VO2max.pdf"), p_vo2_lean,
+       height = 1.7, width = 2.2, family = "ArialMT")
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/plot_pre_post_files/figure-html/unnamed-chunk-11-1.png b/articles/plot_pre_post_files/figure-html/unnamed-chunk-11-1.png new file mode 100644 index 0000000..fa3ca09 Binary files /dev/null and b/articles/plot_pre_post_files/figure-html/unnamed-chunk-11-1.png differ diff --git a/articles/plot_pre_post_files/figure-html/unnamed-chunk-3-1.png b/articles/plot_pre_post_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..d7e91ee Binary files /dev/null and b/articles/plot_pre_post_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/articles/plot_pre_post_files/figure-html/unnamed-chunk-5-1.png b/articles/plot_pre_post_files/figure-html/unnamed-chunk-5-1.png new file mode 100644 index 0000000..8f78ecb Binary files /dev/null and b/articles/plot_pre_post_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/articles/plot_pre_post_files/figure-html/unnamed-chunk-7-1.png b/articles/plot_pre_post_files/figure-html/unnamed-chunk-7-1.png new file mode 100644 index 0000000..16e8797 Binary files /dev/null and b/articles/plot_pre_post_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/articles/plot_pre_post_files/figure-html/unnamed-chunk-9-1.png b/articles/plot_pre_post_files/figure-html/unnamed-chunk-9-1.png new file mode 100644 index 0000000..67d3fc8 Binary files /dev/null and b/articles/plot_pre_post_files/figure-html/unnamed-chunk-9-1.png differ diff --git a/articles/plot_proteins.html b/articles/plot_proteins.html new file mode 100644 index 0000000..2b18b71 --- /dev/null +++ b/articles/plot_proteins.html @@ -0,0 +1,486 @@ + + + + + + + +Plots of log2 relative abundances of various proteins • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article generates plots of various proteins: Acaca, Fabp4, Lipe, +Plin1, and Adipoq (Extended Data Fig. 7D, E). Most were included as +plots in the first round of reviewer responses, rather than in the +manuscript figures.

+ +
+genes <- c("Acaca", "Fabp4", "Lipe", "Plin1", "Adipoq")
+
+# Differential analysis results
+stats <- PROT_DA$trained_vs_SED %>%
+  filter(gene_symbol %in% genes,
+         adj.P.Val < 0.05) %>%
+  mutate(signif = cut(adj.P.Val,
+                      breaks = c(0, 0.001, 0.01, 0.05, 1),
+                      labels = c("***", "**", "*", ""),
+                      include.lowest = TRUE, right = FALSE,
+                      ordered_result = TRUE),
+         sex = ifelse(grepl("^F", contrast), "Female", "Male"))
+
+# Individual data points to plot
+x <- cbind(select(fData(PROT_EXP), gene_symbol), exprs(PROT_EXP)) %>%
+  filter(gene_symbol %in% genes) %>%
+  pivot_longer(cols = -gene_symbol,
+               names_to = "viallabel",
+               values_to = "value") %>%
+  pivot_wider(values_from = value, names_from = gene_symbol) %>%
+  left_join(pData(PROT_EXP), by = "viallabel")
+
+# Custom plot theme
+t1 <- theme_bw() +
+  theme(text = element_text(size = 6.5, color = "black"),
+        line = element_line(linewidth = 0.3, color = "black"),
+        axis.ticks = element_line(linewidth = 0.3, color = "black"),
+        panel.grid = element_blank(),
+        panel.border = element_blank(),
+        axis.ticks.x = element_blank(),
+        axis.text = element_text(size = 5,
+                                 color = "black"),
+        axis.text.x = element_text(size = 6.5, angle = 90, hjust = 1,
+                                   vjust = 0.5),
+        axis.title = element_text(size = 6.5, margin = margin(),
+                                  color = "black"),
+        axis.line = element_line(linewidth = 0.3),
+        strip.background = element_blank(),
+        strip.text = element_text(size = 6.5, color = "black",
+                                  margin = margin(b = 5, unit = "pt")),
+        panel.spacing = unit(-1, "pt"),
+        plot.title = element_text(size = 9, color = "black",
+                                  hjust = 0.5, face = "bold"),
+        plot.subtitle = element_text(size = 6, color = "black"),
+        legend.position = "none",
+        strip.placement = "outside"
+  )
+
+

Acaca +

+
+## Acaca
+p_acaca <- ggplot(x, aes(x = timepoint, y = Acaca)) +
+  stat_summary(geom = "crossbar",
+               fun.data = ~ mean_cl_normal(.x),
+               mapping = aes(color = sex),
+               fatten = 1, linewidth = 0.4) +
+  geom_point(shape = 16, size = 0.6,
+             position = position_beeswarm(cex = 3.5,
+                                                      dodge.width = 0.4)) +
+  geom_signif(
+    data = stats,
+    aes(y_position = 0.8,
+        xmin = "SED",
+        xmax = "8W",
+        annotations = "*"),
+    textsize = 3,
+    vjust = 0.25,
+    tip_length = 0.02,
+    color = "black",
+    size = 0.3,
+    manual = TRUE
+  ) +
+  facet_grid(~ sex) +
+  labs(x = NULL,
+       y = TeX("log$_2$ relative abundance"),
+       title = "Acaca") +
+  scale_color_manual(values = c("#ff6eff", "#5555ff")) +
+  scale_y_continuous(expand = expansion(mult = 5e-3),
+                     breaks = seq(-1.5, 1, 0.5)) +
+  coord_cartesian(ylim = c(-1.6, 1), clip = "off") +
+  t1
+
+p_acaca
+

+
+ggsave(file.path("..", "..", "plots", "proteins_Acaca.pdf"), p_acaca, 
+       height = 1.7, width = 2.2, dpi = 400, bg = "white")
+
+
+

Adipoq +

+
+## Adipoq
+p_adi <- ggplot(x, aes(x = timepoint, y = Adipoq)) +
+  stat_summary(geom = "crossbar",
+               fun.data = ~ mean_cl_normal(.x),
+               mapping = aes(color = sex),
+               fatten = 1, linewidth = 0.4) +
+  geom_point(shape = 16, size = 0.6,
+             position = position_beeswarm(cex = 3.5,
+                                                      dodge.width = 0.4)) +
+  facet_grid(~ sex) +
+  labs(x = NULL,
+       y = TeX("log$_2$ relative abundance"),
+       title = "Adipoq") +
+  scale_color_manual(values = c("#ff6eff", "#5555ff")) +
+  scale_y_continuous(expand = expansion(mult = 5e-3),
+                     breaks = seq(-0.4, 0.8, 0.4)) +
+  coord_cartesian(ylim = c(-0.5, 0.8), clip = "off") +
+  t1
+
+p_adi
+

+
+ggsave(file.path("..", "..", "plots", "proteins_Adipoq.pdf"), p_adi, 
+       height = 1.7, width = 2.2, dpi = 400, bg = "white")
+
+
+

Fabp4 +

+
+## Fabp4
+p_fab <- ggplot(x, aes(x = timepoint, y = Fabp4)) +
+  stat_summary(geom = "crossbar",
+               fun.data = ~ mean_cl_normal(.x),
+               mapping = aes(color = sex),
+               fatten = 1, linewidth = 0.4) +
+  geom_point(shape = 16, size = 0.6,
+             position = position_beeswarm(cex = 3.5,
+                                                      dodge.width = 0.4)) +
+  facet_grid(~ sex) +
+  labs(x = NULL,
+       y = TeX("log$_2$ relative abundance"),
+       title = "Fabp4") +
+  scale_color_manual(values = c("#ff6eff", "#5555ff")) +
+  scale_y_continuous(expand = expansion(mult = 5e-3),
+                     breaks = seq(-0.8, 0.8, 0.4)) +
+  coord_cartesian(ylim = c(-0.8, 0.85), clip = "off") +
+  t1
+
+p_fab
+

+
+ggsave(file.path("..", "..", "plots", "proteins_Fabp4.pdf"), p_fab, 
+       height = 1.7, width = 2.2, dpi = 400, bg = "white")
+
+
+

Lipe (Hsl) +

+
+## Lipe
+p_lipe <- ggplot(x, aes(x = timepoint, y = Lipe)) +
+  stat_summary(geom = "crossbar",
+               fun.data = ~ mean_cl_normal(.x),
+               mapping = aes(color = sex),
+               fatten = 1, linewidth = 0.4) +
+  geom_point(shape = 16, size = 0.6,
+             position = position_beeswarm(cex = 3.5,
+                                                      dodge.width = 0.4)) +
+  facet_grid(~ sex) +
+  labs(x = NULL,
+       y = TeX("log$_2$ relative abundance"),
+       title = "Lipe (Hsl)") +
+  scale_color_manual(values = c("#ff6eff", "#5555ff")) +
+  scale_y_continuous(expand = expansion(mult = 5e-3),
+                     breaks = seq(-0.8, 0.8, 0.4)) +
+  coord_cartesian(ylim = c(-0.8, 0.8), clip = "off") +
+  t1
+
+p_lipe
+

+
+ggsave(file.path("..", "..", "plots", "proteins_Lipe.pdf"), p_lipe, 
+       height = 1.7, width = 2.2, dpi = 400, bg = "white")
+
+
+

Plin1 +

+
+## Plin1
+p_plin <- ggplot(x, aes(x = timepoint, y = Plin1)) +
+  stat_summary(geom = "crossbar",
+               fun.data = ~ mean_cl_normal(.x),
+               mapping = aes(color = sex),
+               fatten = 1, linewidth = 0.4) +
+  geom_point(shape = 16, size = 0.6,
+             position = position_beeswarm(cex = 3.5,
+                                                      dodge.width = 0.4)) +
+  facet_grid(~ sex) +
+  labs(x = NULL,
+       y = TeX("log$_2$ relative abundance"),
+       title = "Plin1") +
+  scale_color_manual(values = c("#ff6eff", "#5555ff")) +
+  scale_y_continuous(expand = expansion(mult = 5e-3),
+                     breaks = seq(-0.8, 0.8, 0.4)) +
+  coord_cartesian(ylim = c(-0.85, 0.8), clip = "off") +
+  t1
+
+p_plin
+

+
+ggsave(file.path("..", "..", "plots", "proteins_Plin1.pdf"), p_plin, 
+       height = 1.7, width = 2.2, dpi = 400, bg = "white")
+
+
+

Session Info +

+
+sessionInfo()
+#> R version 4.3.3 (2024-02-29)
+#> Platform: x86_64-pc-linux-gnu (64-bit)
+#> Running under: Ubuntu 22.04.4 LTS
+#> 
+#> Matrix products: default
+#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
+#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
+#> 
+#> locale:
+#>  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
+#>  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
+#>  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
+#> [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
+#> 
+#> time zone: UTC
+#> tzcode source: system (glibc)
+#> 
+#> attached base packages:
+#> [1] stats     graphics  grDevices utils     datasets  methods   base     
+#> 
+#> other attached packages:
+#>  [1] ggbeeswarm_0.7.2                   latex2exp_0.9.6                   
+#>  [3] ggsignif_0.6.4                     ggplot2_3.5.0                     
+#>  [5] tidyr_1.3.1                        dplyr_1.1.4                       
+#>  [7] Biobase_2.62.0                     BiocGenerics_0.48.1               
+#>  [9] MotrpacRatTraining6moData_2.0.0    MotrpacRatTraining6moWATData_2.0.0
+#> 
+#> loaded via a namespace (and not attached):
+#>  [1] gtable_0.3.4      beeswarm_0.4.0    xfun_0.42         bslib_0.6.1      
+#>  [5] htmlwidgets_1.6.4 vctrs_0.6.5       tools_4.3.3       generics_0.1.3   
+#>  [9] tibble_3.2.1      fansi_1.0.6       highr_0.10        cluster_2.1.6    
+#> [13] pkgconfig_2.0.3   data.table_1.15.2 checkmate_2.3.1   desc_1.4.3       
+#> [17] lifecycle_1.0.4   farver_2.1.1      compiler_4.3.3    stringr_1.5.1    
+#> [21] textshaping_0.3.7 munsell_0.5.0     vipor_0.4.7       htmltools_0.5.7  
+#> [25] sass_0.4.8        yaml_2.3.8        htmlTable_2.4.2   Formula_1.2-5    
+#> [29] pillar_1.9.0      pkgdown_2.0.7     jquerylib_0.1.4   cachem_1.0.8     
+#> [33] Hmisc_5.1-1       rpart_4.1.23      tidyselect_1.2.0  digest_0.6.34    
+#> [37] stringi_1.8.3     purrr_1.0.2       fastmap_1.1.1     grid_4.3.3       
+#> [41] colorspace_2.1-0  cli_3.6.2         magrittr_2.0.3    base64enc_0.1-3  
+#> [45] utf8_1.2.4        foreign_0.8-86    withr_3.0.0       scales_1.3.0     
+#> [49] backports_1.4.1   rmarkdown_2.25    nnet_7.3-19       gridExtra_2.3    
+#> [53] ragg_1.2.7        memoise_2.0.1     evaluate_0.23     knitr_1.45       
+#> [57] rlang_1.1.3       glue_1.7.0        rstudioapi_0.15.0 jsonlite_1.8.8   
+#> [61] R6_2.5.1          systemfonts_1.0.5 fs_1.6.3
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/plot_proteins_files/figure-html/unnamed-chunk-10-1.png b/articles/plot_proteins_files/figure-html/unnamed-chunk-10-1.png new file mode 100644 index 0000000..c1a298c Binary files /dev/null and b/articles/plot_proteins_files/figure-html/unnamed-chunk-10-1.png differ diff --git a/articles/plot_proteins_files/figure-html/unnamed-chunk-12-1.png b/articles/plot_proteins_files/figure-html/unnamed-chunk-12-1.png new file mode 100644 index 0000000..9520f4b Binary files /dev/null and b/articles/plot_proteins_files/figure-html/unnamed-chunk-12-1.png differ diff --git a/articles/plot_proteins_files/figure-html/unnamed-chunk-4-1.png b/articles/plot_proteins_files/figure-html/unnamed-chunk-4-1.png new file mode 100644 index 0000000..a20a22a Binary files /dev/null and b/articles/plot_proteins_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/articles/plot_proteins_files/figure-html/unnamed-chunk-6-1.png b/articles/plot_proteins_files/figure-html/unnamed-chunk-6-1.png new file mode 100644 index 0000000..862b34d Binary files /dev/null and b/articles/plot_proteins_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/articles/plot_proteins_files/figure-html/unnamed-chunk-8-1.png b/articles/plot_proteins_files/figure-html/unnamed-chunk-8-1.png new file mode 100644 index 0000000..0dffaf8 Binary files /dev/null and b/articles/plot_proteins_files/figure-html/unnamed-chunk-8-1.png differ diff --git a/articles/volcano_plots.html b/articles/volcano_plots.html new file mode 100644 index 0000000..a18ac46 --- /dev/null +++ b/articles/volcano_plots.html @@ -0,0 +1,687 @@ + + + + + + + +Volcano Plots • MotrpacRatTraining6moWATData + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

This article contains generates volcano plots (Fig 2A; Extended Data +Fig. 2A–D). By default, the chunks are not set to evaluate, since the +volcano plots exceed the maximum dimensions. Run each chunk in this +article individually (do not knit) to generate and save the volcano +plots.

+ +
+# List of all differential analysis results
+all_DA <- list(TRNSCRPT = TRNSCRPT_DA,
+               PROT     = PROT_DA,
+               PHOSPHO  = PHOSPHO_DA,
+               METAB    = METAB_DA)
+
+all_DA$PHOSPHO$MvF_SED <- all_DA$PHOSPHO$MvF_SED %>%
+  mutate(site = paste0(gene_symbol, "-", site))
+
+## Updates required for volcano plots
+update_dea_res <- function(x) {
+  x <- x %>%
+    dplyr::select(feature, contrast, P.Value, adj.P.Val, logFC, feature,
+                  any_of(c("site", "gene_symbol",
+                           "entrez_gene", "name_in_figures"))) %>%
+    mutate(log10_pval = -log10(adj.P.Val),
+           sign_logFC = as.character(sign(logFC)),
+           sign_logFC = ifelse(adj.P.Val < 0.05, sign_logFC, "NS"),
+           sign_logFC = factor(sign_logFC,
+                               levels = c("-1", "1", "NS"),
+                               labels = c("dn", "up", "NS"))) %>%
+    arrange(contrast, sign_logFC)
+  
+  # Count number of features by sign(logFC)
+  x_sub <- x %>%
+    group_by(contrast, sign_logFC) %>%
+    summarise(n = n()) %>%
+    mutate(label = paste(n, sign_logFC)) %>%
+    group_by(contrast) %>%
+    summarise(label = paste(label, collapse = ", "))
+  
+  x <- left_join(x, x_sub, by = "contrast")
+  return(x)
+}
+
+# Function for label nudge
+nudge_volcano_labels <- function(x, offset = 0.4) {
+  y <- x
+  len_y <- length(y)
+  increment <- offset / 8
+  
+  if (len_y > 1) {
+    for (i in 2:len_y) {
+      while (y[i] <= y[i - 1] + offset) {
+        y[i] <- y[i] + increment
+      }
+    }
+  }
+  
+  y <- y - x
+  
+  return(y)
+}
+
+## Volcano plots for combined MvF SED results --------------------
+MvF_volcano <- map(.x = all_DA, pluck, "MvF_SED") %>%
+  map(~ update_dea_res(.x) %>%
+        mutate(across(starts_with("entrez_gene"), as.character))
+  ) %>%
+  enframe(name = "ome") %>%
+  unnest(value) %>%
+  mutate(ome = paste0(ome, "\n", label),
+         ome = factor(ome, levels = unique(ome))) %>%
+  plot_volcano(colors = c("#ff6eff", "#5555ff", "grey")) +
+  facet_wrap(~ ome, nrow = 1) +
+  scale_y_continuous(limits = c(0, 30),
+                     sec.axis = sec_axis(trans = ~ 10 ^ (-.),
+                                         breaks = 0.05),
+                     expand = expansion(mult = 0.01)) +
+  labs(x = TeX("$log_2$(fold-change): Male - Female"),
+       y = TeX("$-log_{10}$(BH-adjusted p-value)")) +
+  theme(strip.text = element_text(margin = margin(0, 0, 5, 0, "pt")))
+
+# Add feature labels
+point_labels <- MvF_volcano$data %>%
+  filter(adj.P.Val < 0.05) %>%
+  group_by(ome, contrast, sign_logFC) %>%
+  slice_min(order_by = adj.P.Val, n = 5) %>%
+  rbind(filter(MvF_volcano$data, 
+               adj.P.Val < 0.05, 
+               gene_symbol %in% c("Adipoq", "Slc2a4"))) %>% 
+  mutate(SiteID = ifelse(grepl("^PHOSPHO", ome),
+                         paste0(gene_symbol, "-", site),
+                         NA),
+         feature_label = case_when(
+           !is.na(site) ~ site,
+           !is.na(gene_symbol) ~ gene_symbol,
+           !is.na(entrez_gene) ~ entrez_gene,
+           !is.na(name_in_figures) ~ name_in_figures,
+           TRUE ~ feature)) %>%
+  # Remove certain features from the plot
+  filter(!(feature_label %in% c("AABR07039356.2", "Prickle2") & 
+             grepl("^TRNSCRPT", ome)),
+         !(feature_label %in% c("Stn1", "Ccar2") & 
+             grepl("^PROT", ome))) %>% 
+  dplyr::select(ome, contrast, sign_logFC, feature, feature_label, 
+                adj.P.Val, P.Value, logFC) %>%
+  mutate(feature_label = case_when(
+    feature_label == "TG 58:34*" ~ "TG 58:4",
+    feature_label == "PE P-38:5 or PE O-38:6" ~ "PE O-38:6",
+    feature_label == "Hydroxydodecanoic acid" ~ "FA 12:0-OH",
+    feature_label == "Hydroxydecanoic acid" ~ "FA 10:0-OH",
+    TRUE ~ feature_label),
+    log10_pval = -log10(adj.P.Val)) %>% 
+  arrange(contrast, log10_pval, -P.Value) %>%
+  group_by(contrast, sign_logFC, ome) %>%
+  mutate(nudge_y = nudge_volcano_labels(x = log10_pval, offset = 2.2),
+         nudge_x = sign(logFC) * c(0.5, 1.05) * max(abs(logFC), 3) + 
+           2 * sign(logFC)) %>%
+  ungroup()
+
+MvF_volcano <- MvF_volcano +
+  geom_label_repel(aes(x = logFC, y = -log10(adj.P.Val), 
+                       label = feature_label),
+                   data = point_labels,
+                   force = 0,
+                   size = 5 / .pt,
+                   fill = alpha("white", 0.7),
+                   label.padding = 0.12,
+                   label.size = 0.2,
+                   segment.size = 0.3,
+                   box.padding = 0.15,
+                   min.segment.length = unit(0, "pt"),
+                   nudge_x = point_labels$nudge_x,
+                   nudge_y = point_labels$nudge_y,
+                   max.overlaps = Inf)
+
+MvF_volcano
+
+ggsave(file.path("..", "..", "plots", "volcano_MvF_SED_all_omes.pdf"),
+       MvF_volcano, height = 2.3, width = 6.5, units = "in",
+       dpi = 400, bg = "white")
+
+## Create volcano plots for each ome
+omes <- c("TRNSCRPT", "PROT", "PHOSPHO", "METAB")
+features <- c("Transcripts", "Proteins", "Phosphosites", "Metabolites")
+
+for (i in seq_along(omes)) {
+  # Get DEA results
+  features <- features[i]
+  ome <- omes[i]
+  message(ome)
+  dea_res <- map(all_DA[[i]], .f = update_dea_res)
+  
+  ## Trained vs SED ------------------------------------------------------------
+  message("Timewise")
+  train_res <- dea_res$trained_vs_SED %>%
+    mutate(contrast = factor(
+      contrast, levels = unique(contrast),
+      labels = TeX(
+        sprintf("(%dW - SED)$_{%s}$",
+                rep(2 ^ (0:3), times = 2),
+                rep(c("F", "M"), each = 4))
+      )
+    ))
+  
+  switch(ome,
+         TRNSCRPT = {
+           features_to_label = data.frame(
+             feature_label = c(
+               # Female
+               ## 1W - SED
+               "Ace", "Smpd3", "Aamdc", "Camk2b", "Acly", "Fasn", "Grb14", 
+               "Olah", "Hmgcs2", "Ca12",
+               ## 2W - SED
+               "Fasn", "Acly", "Grb14", "Olah", "Hmgcs2", "Ca12",
+               ## 4W - SED
+               "Fasn", "Aqp3", "Crabp2", "Aacs", "Acly", "Grb14", "Olah", 
+               "Hmgcs2", "Ca12",
+               ## 8W - SED
+               "Crabp2", "Fads2", "Acaca", "Fasn", "Acaca", "Endou", "Orm1", 
+               "Acly", "Grb14", "Olah", "Hmgcs2", "Ca12",
+               
+               # Male
+               ## 1W - SED
+               "Acot1", "Adcy3", "Hif1a", "Steap4", "Fasn", "Acly", "Grb14", 
+               "Olah", "Hmgcs2", "Ca12",
+               ## 2W - SED
+               "Kdr", "Elovl6", "Pdgfrb", "Hif1a", "Fasn", "Acly", "Grb14", 
+               "Olah", "Hmgcs2", "Ca12",
+               ## 4W - SED
+               "Kcnj13", "Ctsz", "Nkap", "Fasn", "Acly", "Grb14", "Olah", 
+               "Hmgcs2", "Ca12",
+               ## 8W - SED
+               "RT1-A1", "Ctsz", "Atp11a", "Lpcat1", "Fasn", "Acly", "Grb14", 
+               "Olah", "Hmgcs2", "Ca12"), 
+             contrast = rep(levels(train_res$contrast), 
+                            c(10, 6, 9, 12, 
+                              10, 10, 9, 10))) %>% 
+             mutate(contrast = factor(contrast, 
+                                      levels = levels(train_res$contrast)))
+         },
+         PROT = {
+           features_to_label <- data.frame(
+             feature_label = c(
+               # Female
+               ## 1W - SED
+               "Camk2b", "Ace", "Maip", "Atp6v0d1", "Immt", "Slc25a11", 
+               "Slc25a3", "Slc25a15", "Tmed2", "Sec61a1", "Lrpprc", "Slc25a15", 
+               "Grb14", "Orm1",
+               ## 2W - SED
+               "Camk2b", "Ace", "Lrg1", "Maip", "Atp6v0d1", "Immt", "Slc25a11", 
+               "Slc25a3", "Slc25a15", "Tmed2", "Sec61a1", "Lrpprc", "Slc25a15", 
+               "Grb14", "Orm1",
+               ## 4W - SED
+               "Lifr", "Orm1", "Ltbp2", "Il1r2", "Maip", "Atp6v0d1", "Immt", 
+               "Slc25a11", "Slc25a3", "Slc25a15", "Tmed2", "Sec61a1", "Lrpprc", 
+               "Slc25a15", "Grb14",
+               ## 8W - SED
+               "Lifr", "Endou", "Arg1", "Orm1", "Tgfbr3", "Hspa1b", "Maip", 
+               "Atp6v0d1", "Immt", "Slc25a11", "Slc25a3", "Slc25a15", "Tmed2", 
+               "Sec61a1", "Lrpprc", "Slc25a15", "Grb14",
+               
+               # Male
+               ## 1W - SED
+               "Tie1", "Hdac4", "Fth1", "Maip", "Immt", "Slc25a11", "Slc25a3", 
+               "Slc25a15", "Lrpprc", "Slc25a15", "Grb14", "Orm1",
+               ## 2W - SED
+               "Fth1", "Cuta", "Hsd17b12", "Glyctk", "Hdac4", "Maip", "Immt", 
+               "Slc25a11", "Slc25a3", "Slc25a15", "Lrpprc", "Slc25a15", "Grb14",
+               "Orm1",
+               ## 4W - SED
+               "Fth1", "Hebp2", "Crabp1", "Slc27a1", "Maoa", "Rbp1", "Hsd17b12", 
+               "Akr1d1", "Nos1", "Maip", "Immt", "Slc25a11", "Slc25a3", 
+               "Slc25a15", "Lrpprc", "Slc25a15", "Grb14", "Orm1",
+               ## 8W - SED
+               "Hacl1", "Hsph1", "Hspa1b", "Lep", "Sparc", "Maip", "Immt", 
+               "Slc25a11", "Slc25a3", "Slc25a15", "Lrpprc", "Slc25a15", 
+               "Grb14", "Orm1"),
+             contrast = rep(levels(train_res$contrast), 
+                            c(14, 15, 15, 17,
+                              12, 14, 18, 14))) %>% 
+             mutate(contrast = factor(contrast, 
+                                      levels = levels(train_res$contrast)))
+         },
+         METAB = {
+           metab_features <- train_res %>%
+             filter(adj.P.Val < 0.05) %>% 
+             dplyr::select(name_in_figures, P.Value, adj.P.Val, contrast) %>% 
+             distinct() %>% 
+             group_by(name_in_figures) %>% 
+             filter(all(levels(train_res$contrast)[1:4] %in% contrast) |
+                      all(levels(train_res$contrast)[5:8] %in% contrast)) %>% 
+             group_by(name_in_figures, contrast) %>% 
+             slice_min(P.Value, n = 1, with_ties = FALSE) %>% 
+             mutate(sex_female = grepl("F", contrast)) %>% 
+             group_by(name_in_figures, sex_female) %>% 
+             filter(n() == 4) %>% 
+             group_by(name_in_figures, sex_female) %>% 
+             summarise(mean_padj = mean(-log10(adj.P.Val))) %>%
+             group_by(sex_female) %>%
+             slice_max(mean_padj, n = 5) %>% 
+             pull(name_in_figures) %>%
+             unique()
+           
+           features_to_label <- train_res %>% 
+             filter(adj.P.Val < 0.05) %>% 
+             filter(name_in_figures %in% metab_features) %>% 
+             dplyr::select(feature_label = name_in_figures, contrast) %>% 
+             distinct() %>% 
+             mutate(feature_label = sub(" or P[EC] ", "\\|\\|", feature_label))
+         },
+         PHOSPHO = {
+           features_to_label <- train_res %>% 
+             mutate(feature_label = paste0(gene_symbol, "-", site)) %>% 
+             filter(feature_label %in% 
+                      c("Pde4a-S140", "Pde4b-S118", "Ankrd2-S317", 
+                        "Lrrfip1-S257", "Lrrfip1-S232", "Lrrfip1-S85", 
+                        "Camk2b-T398", "Htt-S621", "Klc1-S521;S524", 
+                        "Uhrf1bp1l-S418", "Bnip3-T66", "Ulf1-S458")) %>% 
+             filter(adj.P.Val < 0.05) %>% 
+             dplyr::select(-feature) %>% 
+             distinct() %>% 
+             group_by(contrast, feature_label) %>% 
+             slice_min(order_by = P.Value, n = 1, with_ties = FALSE) %>% 
+             dplyr::select(feature_label, contrast)
+         }
+  )
+  
+  train_labels <- train_res %>%
+    filter(adj.P.Val < 0.05) %>%
+    add_column(site = NA, 
+               name_in_figures = NA, 
+               gene_symbol = NA,
+               .name_repair = "unique") %>%
+    mutate(name_in_figures = sub(" or P[EC] ", "\\|\\|", name_in_figures),
+           feature_label = case_when(
+             !is.na(site) ~ paste(gene_symbol, site, sep = "-"),
+             !is.na(name_in_figures) ~ name_in_figures,
+             TRUE ~ gene_symbol
+           )) %>%
+    dplyr::select(contrast, feature_label, adj.P.Val, 
+                  log10_pval, P.Value, logFC) %>% 
+    distinct() %>% 
+    inner_join(features_to_label, 
+               by = c("contrast", "feature_label")) %>% 
+    group_by(contrast, feature_label) %>%
+    slice_min(order_by = adj.P.Val, n = 1) %>%
+    ungroup() %>%
+    arrange(contrast, log10_pval, -P.Value) %>%
+    group_by(contrast, sign(logFC)) %>%
+    mutate(nudge_y = nudge_volcano_labels(
+      x = log10_pval,
+      offset = 0.4 + 0.1 * (ome == "TRNSCRPT") - 0.05 * (ome == "PHOSPHO")
+    ) - 0.25 * (n() == 1),
+    nudge_x = sign(logFC) * 
+      rescale(rank(abs(logFC)),
+              to = c(0.6, 1.5) * max(abs(logFC), 3))) %>%
+    ungroup() %>%
+    group_by(contrast) %>%
+    mutate(nudge_x = nudge_x - (ome == "METAB") * 1 * min(abs(logFC)))
+  
+  ## Volcano plots
+  v_train <- plot_volcano(train_res) +
+    facet_wrap(~ contrast, nrow = 1,
+               scales = "free_x",
+               labeller = label_parsed) +
+    labs(x = TeX("$log_2$(fold-change)"),
+         y = TeX("$-log_{10}$(BH-adjusted p-value)"))
+  
+  # Add annotations for number of up, down, or NS features
+  v_train <- v_train +
+    geom_label(data = distinct(train_res, contrast, label),
+               aes(label = label, x = -Inf, y = Inf),
+               size = 5 / .pt, 
+               label.size = NA,
+               label.padding = unit(4, "pt"),
+               fill = alpha("white", 0.5),
+               # label.r = unit(1.5, "pt"),
+               hjust = 0.05, vjust = 0) +
+    coord_cartesian(clip = "off")
+  
+  # Set axis limits
+  if (ome != "TRNSCRPT") {
+    v_train <- v_train +
+      scale_x_continuous(breaks = seq(-8, 8, 2),
+                         expand = expansion(mult = 0.05,
+                                            add = 0.5))
+  }
+  
+  if (ome == "METAB") {
+    v_train <- v_train +
+      scale_y_continuous(limits = c(0, 6),
+                         expand = expansion(mult = 1e-2),
+                         sec.axis = sec_axis(trans = ~ 10 ^ (-.),
+                                             breaks = 0.05))
+  }
+  
+  v_train <- v_train +
+    geom_label_repel(aes(x = logFC, y = log10_pval,
+                         label = feature_label),
+                     data = train_labels,
+                     force = 0 + 0.5 * (ome == "METAB"),
+                     direction = "x",
+                     size = 5 / .pt, # (5 - 0.7 * (ome == "METAB")) / .pt,
+                     fill = alpha("white", 0.65),
+                     label.padding = 0.10,
+                     label.size = 0.16,
+                     segment.size = 0.3,
+                     box.padding = 0.13,
+                     min.segment.length = unit(0, "pt"),
+                     nudge_x = train_labels$nudge_x,
+                     nudge_y = train_labels$nudge_y +
+                       case_when(ome == "TRNSCRPT" ~ 0.6, # 0.4
+                                 ome == "PHOSPHO" ~ 0.6, # 0.4
+                                 ome == "PROT" ~ 0.6, # 0.5
+                                 ome == "METAB" ~ 0.8), # 0.6
+                     seed = 0,
+                     max.overlaps = Inf) +
+    theme(panel.grid.major = element_blank())
+  
+  v_train # display plot
+  
+  ggsave(file.path("..", "..", "plots", 
+                   sprintf("volcano_%s_trained_vs_SED.pdf", ome)),
+         v_train, height = 55, width = 180, units = "mm", family = "ArialMT")
+}
+
+

Session Info +

+
+sessionInfo()
+#> R version 4.3.3 (2024-02-29)
+#> Platform: x86_64-pc-linux-gnu (64-bit)
+#> Running under: Ubuntu 22.04.4 LTS
+#> 
+#> Matrix products: default
+#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
+#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
+#> 
+#> locale:
+#>  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
+#>  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
+#>  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
+#> [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
+#> 
+#> time zone: UTC
+#> tzcode source: system (glibc)
+#> 
+#> attached base packages:
+#> [1] stats     graphics  grDevices utils     datasets  methods   base     
+#> 
+#> other attached packages:
+#>  [1] scales_1.3.0                       ggrepel_0.9.5                     
+#>  [3] ggplot2_3.5.0                      latex2exp_0.9.6                   
+#>  [5] purrr_1.0.2                        tibble_3.2.1                      
+#>  [7] tidyr_1.3.1                        dplyr_1.1.4                       
+#>  [9] MotrpacRatTraining6moWAT_1.0.0     Biobase_2.62.0                    
+#> [11] BiocGenerics_0.48.1                MotrpacRatTraining6moWATData_2.0.0
+#> 
+#> loaded via a namespace (and not attached):
+#>   [1] RColorBrewer_1.1-3      rstudioapi_0.15.0       jsonlite_1.8.8         
+#>   [4] shape_1.4.6.1           magrittr_2.0.3          ggbeeswarm_0.7.2       
+#>   [7] rmarkdown_2.25          GlobalOptions_0.1.2     fs_1.6.3               
+#>  [10] zlibbioc_1.48.0         ragg_1.2.7              vctrs_0.6.5            
+#>  [13] memoise_2.0.1           RCurl_1.98-1.14         base64enc_0.1-3        
+#>  [16] rstatix_0.7.2           htmltools_0.5.7         dynamicTreeCut_1.63-1  
+#>  [19] curl_5.2.1              broom_1.0.5             Formula_1.2-5          
+#>  [22] sass_0.4.8              bslib_0.6.1             htmlwidgets_1.6.4      
+#>  [25] desc_1.4.3              impute_1.76.0           cachem_1.0.8           
+#>  [28] lifecycle_1.0.4         iterators_1.0.14        pkgconfig_2.0.3        
+#>  [31] Matrix_1.6-5            R6_2.5.1                fastmap_1.1.1          
+#>  [34] GenomeInfoDbData_1.2.11 clue_0.3-65             digest_0.6.34          
+#>  [37] colorspace_2.1-0        patchwork_1.2.0         AnnotationDbi_1.64.1   
+#>  [40] S4Vectors_0.40.2        textshaping_0.3.7       Hmisc_5.1-1            
+#>  [43] RSQLite_2.3.5           ggpubr_0.6.0            filelock_1.0.3         
+#>  [46] fansi_1.0.6             httr_1.4.7              abind_1.4-5            
+#>  [49] compiler_4.3.3          withr_3.0.0             bit64_4.0.5            
+#>  [52] doParallel_1.0.17       htmlTable_2.4.2         backports_1.4.1        
+#>  [55] BiocParallel_1.36.0     carData_3.0-5           DBI_1.2.2              
+#>  [58] ggsignif_0.6.4          rjson_0.2.21            tools_4.3.3            
+#>  [61] vipor_0.4.7             foreign_0.8-86          beeswarm_0.4.0         
+#>  [64] msigdbr_7.5.1           nnet_7.3-19             glue_1.7.0             
+#>  [67] grid_4.3.3              checkmate_2.3.1         cluster_2.1.6          
+#>  [70] fgsea_1.28.0            generics_0.1.3          gtable_0.3.4           
+#>  [73] preprocessCore_1.64.0   data.table_1.15.2       WGCNA_1.72-5           
+#>  [76] car_3.1-2               utf8_1.2.4              XVector_0.42.0         
+#>  [79] foreach_1.5.2           pillar_1.9.0            stringr_1.5.1          
+#>  [82] babelgene_22.9          limma_3.58.1            circlize_0.4.16        
+#>  [85] splines_4.3.3           BiocFileCache_2.10.1    lattice_0.22-5         
+#>  [88] survival_3.5-8          bit_4.0.5               tidyselect_1.2.0       
+#>  [91] GO.db_3.18.0            ComplexHeatmap_2.18.0   locfit_1.5-9.9         
+#>  [94] Biostrings_2.70.2       knitr_1.45              gridExtra_2.3          
+#>  [97] IRanges_2.36.0          edgeR_4.0.16            stats4_4.3.3           
+#> [100] xfun_0.42               statmod_1.5.0           matrixStats_1.2.0      
+#> [103] stringi_1.8.3           yaml_2.3.8              evaluate_0.23          
+#> [106] codetools_0.2-19        cli_3.6.2               ontologyIndex_2.12     
+#> [109] rpart_4.1.23            systemfonts_1.0.5       munsell_0.5.0          
+#> [112] jquerylib_0.1.4         Rcpp_1.0.12             GenomeInfoDb_1.38.6    
+#> [115] dbplyr_2.4.0            png_0.1-8               fastcluster_1.2.6      
+#> [118] parallel_4.3.3          pkgdown_2.0.7           blob_1.2.4             
+#> [121] bitops_1.0-7            crayon_1.5.2            GetoptLong_1.0.5       
+#> [124] rlang_1.1.3             cowplot_1.1.3           fastmatch_1.1-4        
+#> [127] KEGGREST_1.42.0
+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/authors.html b/authors.html index 5b81c63..d5582e4 100644 --- a/authors.html +++ b/authors.html @@ -1,47 +1,152 @@ -Authors and Citation • MotrpacRatTraining6moWATDataAuthors and Citation • MotrpacRatTraining6moWATData - Skip to contents + -
-
-
+ + +
+
+
+ -
-

Authors

  • Tyler J. Sagendorf. Author, maintainer. @@ -68,42 +173,49 @@

    Authors


    Provided mtDNA qPCR results.

+
+
+

Citation

+ Source: DESCRIPTION +
+
-
-

Citation

-

Source: DESCRIPTION

-

Sagendorf T, Hou Z (2023). +

Sagendorf T, Hou Z (2024). MotrpacRatTraining6moWATData: Data and Analysis Results for the MoTrPAC PASS1B Rat White Adipose Tissue Companion Paper. -https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/, -https://github.com/PNNL-Comp-Mass-Spec/MotrpacRatTraining6moWATData/. +R package version 2.0.0, +https://github.com/MoTrPAC/MotrpacRatTraining6moWATData/, https://motrpac.github.io/MotrpacRatTraining6moWATData/.

-
@Manual{,
+    
@Manual{,
   title = {MotrpacRatTraining6moWATData: Data and Analysis Results for the MoTrPAC PASS1B Rat White Adipose Tissue
 Companion Paper},
   author = {Tyler J. Sagendorf and Zhenxin Hou},
-  year = {2023},
-  note = {https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/,
-https://github.com/PNNL-Comp-Mass-Spec/MotrpacRatTraining6moWATData/},
+  year = {2024},
+  note = {R package version 2.0.0, 
+https://github.com/MoTrPAC/MotrpacRatTraining6moWATData/},
+  url = {https://motrpac.github.io/MotrpacRatTraining6moWATData/},
 }
-
-
+
+ + - + diff --git a/bootstrap-toc.css b/bootstrap-toc.css new file mode 100644 index 0000000..5a85941 --- /dev/null +++ b/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/bootstrap-toc.js b/bootstrap-toc.js new file mode 100644 index 0000000..1cdd573 --- /dev/null +++ b/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/docsearch.css b/docsearch.css new file mode 100644 index 0000000..e5f1fe1 --- /dev/null +++ b/docsearch.css @@ -0,0 +1,148 @@ +/* Docsearch -------------------------------------------------------------- */ +/* + Source: https://github.com/algolia/docsearch/ + License: MIT +*/ + +.algolia-autocomplete { + display: block; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1 +} + +.algolia-autocomplete .ds-dropdown-menu { + width: 100%; + min-width: none; + max-width: none; + padding: .75rem 0; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, .1); + box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); +} + +@media (min-width:768px) { + .algolia-autocomplete .ds-dropdown-menu { + width: 175% + } +} + +.algolia-autocomplete .ds-dropdown-menu::before { + display: none +} + +.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { + padding: 0; + background-color: rgb(255,255,255); + border: 0; + max-height: 80vh; +} + +.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { + margin-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion { + padding: 0; + overflow: visible +} + +.algolia-autocomplete .algolia-docsearch-suggestion--category-header { + padding: .125rem 1rem; + margin-top: 0; + font-size: 1.3em; + font-weight: 500; + color: #00008B; + border-bottom: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { + float: none; + padding-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { + float: none; + width: auto; + padding: 0; + text-align: left +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content { + float: none; + width: auto; + padding: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content::before { + display: none +} + +.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { + padding-top: .75rem; + margin-top: .75rem; + border-top: 1px solid rgba(0, 0, 0, .1) +} + +.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { + display: block; + padding: .1rem 1rem; + margin-bottom: 0.1; + font-size: 1.0em; + font-weight: 400 + /* display: none */ +} + +.algolia-autocomplete .algolia-docsearch-suggestion--title { + display: block; + padding: .25rem 1rem; + margin-bottom: 0; + font-size: 0.9em; + font-weight: 400 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--text { + padding: 0 1rem .5rem; + margin-top: -.25rem; + font-size: 0.8em; + font-weight: 400; + line-height: 1.25 +} + +.algolia-autocomplete .algolia-docsearch-footer { + width: 110px; + height: 20px; + z-index: 3; + margin-top: 10.66667px; + float: right; + font-size: 0; + line-height: 0; +} + +.algolia-autocomplete .algolia-docsearch-footer--logo { + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; + overflow: hidden; + text-indent: -9000px; + width: 100%; + height: 100%; + display: block; + transform: translate(-8px); +} + +.algolia-autocomplete .algolia-docsearch-suggestion--highlight { + color: #FF8C00; + background: rgba(232, 189, 54, 0.1) +} + + +.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { + box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) +} + +.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { + background-color: rgba(192, 192, 192, .15) +} diff --git a/docsearch.js b/docsearch.js new file mode 100644 index 0000000..b35504c --- /dev/null +++ b/docsearch.js @@ -0,0 +1,85 @@ +$(function() { + + // register a handler to move the focus to the search bar + // upon pressing shift + "/" (i.e. "?") + $(document).on('keydown', function(e) { + if (e.shiftKey && e.keyCode == 191) { + e.preventDefault(); + $("#search-input").focus(); + } + }); + + $(document).ready(function() { + // do keyword highlighting + /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ + var mark = function() { + + var referrer = document.URL ; + var paramKey = "q" ; + + if (referrer.indexOf("?") !== -1) { + var qs = referrer.substr(referrer.indexOf('?') + 1); + var qs_noanchor = qs.split('#')[0]; + var qsa = qs_noanchor.split('&'); + var keyword = ""; + + for (var i = 0; i < qsa.length; i++) { + var currentParam = qsa[i].split('='); + + if (currentParam.length !== 2) { + continue; + } + + if (currentParam[0] == paramKey) { + keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); + } + } + + if (keyword !== "") { + $(".contents").unmark({ + done: function() { + $(".contents").mark(keyword); + } + }); + } + } + }; + + mark(); + }); +}); + +/* Search term highlighting ------------------------------*/ + +function matchedWords(hit) { + var words = []; + + var hierarchy = hit._highlightResult.hierarchy; + // loop to fetch from lvl0, lvl1, etc. + for (var idx in hierarchy) { + words = words.concat(hierarchy[idx].matchedWords); + } + + var content = hit._highlightResult.content; + if (content) { + words = words.concat(content.matchedWords); + } + + // return unique words + var words_uniq = [...new Set(words)]; + return words_uniq; +} + +function updateHitURL(hit) { + + var words = matchedWords(hit); + var url = ""; + + if (hit.anchor) { + url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; + } else { + url = hit.url + '?q=' + escape(words.join(" ")); + } + + return url; +} diff --git a/index.html b/index.html index 3e44560..80198e7 100644 --- a/index.html +++ b/index.html @@ -4,17 +4,15 @@ - - + Data and Analysis Results for the MoTrPAC PASS1B Rat White Adipose Tissue Companion Paper • MotrpacRatTraining6moWATData - - - + + + - + .dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover>.dropdown-menu { + display: block; +} + +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #cccccc; + margin-top: 5px; + margin-right: -10px; +} + +.dropdown-submenu:hover>a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left>.dropdown-menu { + left: -100%; + margin-left: 10px; + border-radius: 6px 0 6px 6px; +} + +/* Sidebar --------------------------*/ + +#pkgdown-sidebar { + margin-top: 30px; + position: -webkit-sticky; + position: sticky; + top: 70px; +} + +#pkgdown-sidebar h2 { + font-size: 1.5em; + margin-top: 1em; +} + +#pkgdown-sidebar h2:first-child { + margin-top: 0; +} + +#pkgdown-sidebar .list-unstyled li { + margin-bottom: 0.5em; +} + +/* bootstrap-toc tweaks ------------------------------------------------------*/ + +/* All levels of nav */ + +nav[data-toggle='toc'] .nav > li > a { + padding: 4px 20px 4px 6px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; +} + +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 5px; + color: inherit; + border-left: 1px solid #878787; +} + +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 5px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; + border-left: 2px solid #878787; +} + +/* Nav: second level (shown on .active) */ + +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} + +nav[data-toggle='toc'] .nav .nav > li > a { + padding-left: 16px; + font-size: 1.35rem; +} + +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 15px; +} + +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 15px; + font-weight: 500; + font-size: 1.35rem; +} + +/* orcid ------------------------------------------------------------------- */ + +.orcid { + font-size: 16px; + color: #A6CE39; + /* margins are required by official ORCID trademark and display guidelines */ + margin-left:4px; + margin-right:4px; + vertical-align: middle; +} + +/* Reference index & topics ----------------------------------------------- */ + +.ref-index th {font-weight: normal;} + +.ref-index td {vertical-align: top; min-width: 100px} +.ref-index .icon {width: 40px;} +.ref-index .alias {width: 40%;} +.ref-index-icons .alias {width: calc(40% - 40px);} +.ref-index .title {width: 60%;} + +.ref-arguments th {text-align: right; padding-right: 10px;} +.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} +.ref-arguments .name {width: 20%;} +.ref-arguments .desc {width: 80%;} + +/* Nice scrolling for wide elements --------------------------------------- */ + +table { + display: block; + overflow: auto; +} + +/* Syntax highlighting ---------------------------------------------------- */ + +pre, code, pre code { + background-color: #f8f8f8; + color: #333; +} +pre, pre code { + white-space: pre-wrap; + word-break: break-all; + overflow-wrap: break-word; +} + +pre { + border: 1px solid #eee; +} + +pre .img, pre .r-plt { + margin: 5px 0; +} + +pre .img img, pre .r-plt img { + background-color: #fff; +} + +code a, pre a { + color: #375f84; +} + +a.sourceLine:hover { + text-decoration: none; +} + +.fl {color: #1514b5;} +.fu {color: #000000;} /* function */ +.ch,.st {color: #036a07;} /* string */ +.kw {color: #264D66;} /* keyword */ +.co {color: #888888;} /* comment */ + +.error {font-weight: bolder;} +.warning {font-weight: bolder;} + +/* Clipboard --------------------------*/ + +.hasCopyButton { + position: relative; +} + +.btn-copy-ex { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.hasCopyButton:hover button.btn-copy-ex { + visibility: visible; +} + +/* headroom.js ------------------------ */ + +.headroom { + will-change: transform; + transition: transform 200ms linear; +} +.headroom--pinned { + transform: translateY(0%); +} +.headroom--unpinned { + transform: translateY(-100%); +} + +/* mark.js ----------------------------*/ + +mark { + background-color: rgba(255, 255, 51, 0.5); + border-bottom: 2px solid rgba(255, 153, 51, 0.3); + padding: 1px; +} + +/* vertical spacing after htmlwidgets */ +.html-widget { + margin-bottom: 10px; +} + +/* fontawesome ------------------------ */ + +.fab { + font-family: "Font Awesome 5 Brands" !important; +} + +/* don't display links in code chunks when printing */ +/* source: https://stackoverflow.com/a/10781533 */ +@media print { + code a:link:after, code a:visited:after { + content: ""; + } +} + +/* Section anchors --------------------------------- + Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71 +*/ + +div.csl-bib-body { } +div.csl-entry { + clear: both; +} +.hanging-indent div.csl-entry { + margin-left:2em; + text-indent:-2em; +} +div.csl-left-margin { + min-width:2em; + float:left; +} +div.csl-right-inline { + margin-left:2em; + padding-left:1em; +} +div.csl-indent { + margin-left: 2em; +} diff --git a/pkgdown.js b/pkgdown.js index 5fccd9c..6f0eee4 100644 --- a/pkgdown.js +++ b/pkgdown.js @@ -2,30 +2,70 @@ (function($) { $(function() { - $('nav.navbar').headroom(); + $('.navbar-fixed-top').headroom(); - Toc.init({ - $nav: $("#toc"), - $scope: $("main h2, main h3, main h4, main h5, main h6") + $('body').css('padding-top', $('.navbar').height() + 10); + $(window).resize(function(){ + $('body').css('padding-top', $('.navbar').height() + 10); }); - if ($('#toc').length) { - $('body').scrollspy({ - target: '#toc', - offset: $("nav.navbar").outerHeight() + 1 - }); + $('[data-toggle="tooltip"]').tooltip(); + + var cur_path = paths(location.pathname); + var links = $("#navbar ul li a"); + var max_length = -1; + var pos = -1; + for (var i = 0; i < links.length; i++) { + if (links[i].getAttribute("href") === "#") + continue; + // Ignore external links + if (links[i].host !== location.host) + continue; + + var nav_path = paths(links[i].pathname); + + var length = prefix_length(nav_path, cur_path); + if (length > max_length) { + max_length = length; + pos = i; + } } - // Activate popovers - $('[data-bs-toggle="popover"]').popover({ - container: 'body', - html: true, - trigger: 'focus', - placement: "top", - sanitize: false, - }); + // Add class to parent
  • , and enclosing
  • if in dropdown + if (pos >= 0) { + var menu_anchor = $(links[pos]); + menu_anchor.parent().addClass("active"); + menu_anchor.closest("li.dropdown").addClass("active"); + } + }); + + function paths(pathname) { + var pieces = pathname.split("/"); + pieces.shift(); // always starts with / + + var end = pieces[pieces.length - 1]; + if (end === "index.html" || end === "") + pieces.pop(); + return(pieces); + } + + // Returns -1 if not found + function prefix_length(needle, haystack) { + if (needle.length > haystack.length) + return(-1); - $('[data-bs-toggle="tooltip"]').tooltip(); + // Special case for length-0 haystack, since for loop won't run + if (haystack.length === 0) { + return(needle.length === 0 ? 0 : -1); + } + + for (var i = 0; i < haystack.length; i++) { + if (needle[i] != haystack[i]) + return(i); + } + + return(haystack.length); + } /* Clipboard --------------------------*/ @@ -38,7 +78,7 @@ if(ClipboardJS.isSupported()) { $(document).ready(function() { - var copyButton = ""; + var copyButton = ""; $("div.sourceCode").addClass("hasCopyButton"); @@ -49,108 +89,20 @@ $('.btn-copy-ex').tooltip({container: 'body'}); // Initialize clipboard: - var clipboard = new ClipboardJS('[data-clipboard-copy]', { + var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { text: function(trigger) { return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); } }); - clipboard.on('success', function(e) { + clipboardBtnCopies.on('success', function(e) { changeTooltipMessage(e.trigger, 'Copied!'); e.clearSelection(); }); - clipboard.on('error', function() { + clipboardBtnCopies.on('error', function() { changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); }); - }); } - - /* Search marking --------------------------*/ - var url = new URL(window.location.href); - var toMark = url.searchParams.get("q"); - var mark = new Mark("main#main"); - if (toMark) { - mark.mark(toMark, { - accuracy: { - value: "complementary", - limiters: [",", ".", ":", "/"], - } - }); - } - - /* Search --------------------------*/ - /* Adapted from https://github.com/rstudio/bookdown/blob/2d692ba4b61f1e466c92e78fd712b0ab08c11d31/inst/resources/bs4_book/bs4_book.js#L25 */ - // Initialise search index on focus - var fuse; - $("#search-input").focus(async function(e) { - if (fuse) { - return; - } - - $(e.target).addClass("loading"); - var response = await fetch($("#search-input").data("search-index")); - var data = await response.json(); - - var options = { - keys: ["what", "text", "code"], - ignoreLocation: true, - threshold: 0.1, - includeMatches: true, - includeScore: true, - }; - fuse = new Fuse(data, options); - - $(e.target).removeClass("loading"); - }); - - // Use algolia autocomplete - var options = { - autoselect: true, - debug: true, - hint: false, - minLength: 2, - }; - var q; -async function searchFuse(query, callback) { - await fuse; - - var items; - if (!fuse) { - items = []; - } else { - q = query; - var results = fuse.search(query, { limit: 20 }); - items = results - .filter((x) => x.score <= 0.75) - .map((x) => x.item); - if (items.length === 0) { - items = [{dir:"Sorry 😿",previous_headings:"",title:"No results found.",what:"No results found.",path:window.location.href}]; - } - } - callback(items); -} - $("#search-input").autocomplete(options, [ - { - name: "content", - source: searchFuse, - templates: { - suggestion: (s) => { - if (s.title == s.what) { - return `${s.dir} >
    ${s.title}
    `; - } else if (s.previous_headings == "") { - return `${s.dir} >
    ${s.title}
    > ${s.what}`; - } else { - return `${s.dir} >
    ${s.title}
    > ${s.previous_headings} > ${s.what}`; - } - }, - }, - }, - ]).on('autocomplete:selected', function(event, s) { - window.location.href = s.path + "?q=" + q + "#" + s.id; - }); - }); })(window.jQuery || window.$) - - diff --git a/pkgdown.yml b/pkgdown.yml index 6abb96e..e8d776b 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -1,9 +1,37 @@ -pandoc: 2.19.2 +pandoc: 3.1.11 pkgdown: 2.0.7 pkgdown_sha: ~ -articles: {} -last_built: 2023-04-05T01:21Z -urls: - reference: https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference - article: https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/articles +articles: + ADIPOCYTE_SIZE_STATS: ADIPOCYTE_SIZE_STATS.html + ANALYTES_STATS: ANALYTES_STATS.html + MAIN_FGSEA: MAIN_FGSEA.html + PHENO_WAT_STATS: PHENO_WAT_STATS.html + PHOSPHO_KSEA: PHOSPHO_KSEA.html + PROT_MITOCARTA_FGSEA: PROT_MITOCARTA_FGSEA.html + WAT_DA: WAT_DA.html + WAT_WGCNA: WAT_WGCNA.html + WGCNA_MODULE_ORA: WGCNA_MODULE_ORA.html + FGSEA_heatmaps: FGSEA_heatmaps.html + KSEA_heatmaps: KSEA_heatmaps.html + METAB_TAG_heatmap: METAB_TAG_heatmap.html + MitoCarta_FGSEA_heatmaps: MitoCarta_FGSEA_heatmaps.html + WGCNA_METAB_module_heatmaps: WGCNA_METAB_module_heatmaps.html + WGCNA_correlation_heatmaps: WGCNA_correlation_heatmaps.html + WGCNA_eigenfeature_plots: WGCNA_eigenfeature_plots.html + WGCNA_module_ORA: WGCNA_module_ORA.html + limma_diagnostics: limma_diagnostics.html + lipid_regulatory_proteins_heatmap: lipid_regulatory_proteins_heatmap.html + plot_FGSEA_male_vs_female_summary: plot_FGSEA_male_vs_female_summary.html + plot_Hk2: plot_Hk2.html + plot_TAG_chain_length_vs_logFC: plot_TAG_chain_length_vs_logFC.html + plot_UpSet: plot_UpSet.html + plot_adipocyte_size_distribution: plot_adipocyte_size_distribution.html + plot_analytes: plot_analytes.html + plot_mito_reads_and_cardiolipin: plot_mito_reads_and_cardiolipin.html + plot_mtDNA: plot_mtDNA.html + plot_pct_fat_vs_leptin: plot_pct_fat_vs_leptin.html + plot_pre_post: plot_pre_post.html + plot_proteins: plot_proteins.html + volcano_plots: volcano_plots.html +last_built: 2024-03-05T17:37Z diff --git a/reference/ADIPOCYTE_SIZE.html b/reference/ADIPOCYTE_SIZE.html index c078c5d..24420c3 100644 --- a/reference/ADIPOCYTE_SIZE.html +++ b/reference/ADIPOCYTE_SIZE.html @@ -1,77 +1,235 @@ -Measures of adipocyte size — ADIPOCYTE_SIZE • MotrpacRatTraining6moWATDataMeasures of adipocyte size — ADIPOCYTE_SIZE • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    +
    + + + +
    +
    + -
    -

    Measures of adipocyte size.

    +
    +

    Measures of adipocyte size: diameter, area, volume.

    -
    -

    Usage

    +
    ADIPOCYTE_SIZE
    -
    -

    Format

    -

    A data.frame with 55825 rows and 8 variables.

    +
    +

    Format

    +

    A data.frame with 55825 rows and 7 variables:

    +
    pid
    +

    integer; randomly generated 8-digit identifier used in + linkage to phenotypic data. All samples from the same animal have the same + PID.

    + +
    sex
    +

    factor; the sex of the rat with 2 levels "Female" and "Male".

    + +
    timepoint
    +

    factor; exercise training group. Either "SED" + (sedentary) or the number of weeks of training ("1W", "2W", "4W", "8W").

    + +
    diameter
    +

    numeric; adipocyte diameter in microns.

    + +
    diameter_bin
    +

    ordered factor; diameter binned in approximately 5 + micron intervals.

    + +
    area
    +

    numeric; adipocyte area in square microns.

    + +
    volume
    +

    volume; adipocyte volume in cubic microns.

    + +
    n_adipocytes
    +

    integer; total number of adipocytes across all images + for a particular animal.

    + + +
    +
    +

    Details

    +

    Adipocyte area was calculated using CellProfiler. Diameter was + derived from area, under the assumption of circular cross-sections. Volume + was derived from area, under the assumption of spherical adipocytes.

    -
    +
    +

    Examples

    +
    print.data.frame(head(ADIPOCYTE_SIZE))
    +#>        pid    sex timepoint diameter diameter_bin  area   volume n_adipocytes
    +#> 1 10043527 Female       SED 14.16105   [14.16,20) 157.5 1486.910         1471
    +#> 2 10043527 Female       SED 14.20593   [14.16,20) 158.5 1501.093         1471
    +#> 3 10043527 Female       SED 14.22832   [14.16,20) 159.0 1508.202         1471
    +#> 4 10043527 Female       SED 14.25067   [14.16,20) 159.5 1515.322         1471
    +#> 5 10043527 Female       SED 14.27299   [14.16,20) 160.0 1522.453         1471
    +#> 6 10043527 Female       SED 14.27299   [14.16,20) 160.0 1522.453         1471
    +
    +
    +
    +
    + +
    -
    +
    + diff --git a/reference/ADIPOCYTE_SIZE_STATS.html b/reference/ADIPOCYTE_SIZE_STATS.html index 3391f42..2d30737 100644 --- a/reference/ADIPOCYTE_SIZE_STATS.html +++ b/reference/ADIPOCYTE_SIZE_STATS.html @@ -1,77 +1,247 @@ -Analysis of adipocyte size differences — ADIPOCYTE_SIZE_STATS • MotrpacRatTraining6moWATDataAnalysis of differences in adipocyte diameter — ADIPOCYTE_SIZE_STATS • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    +
    + + + +
    +
    + -
    -

    Analysis of adipocyte size differences

    +
    +

    Comparisons of adipocyte diameter between timepoints using a + negative binomial regression model.

    -
    -

    Usage

    +
    ADIPOCYTE_SIZE_STATS
    -
    -

    Format

    -

    A data.frame with 40 rows and 11 variables.

    +
    +

    Format

    +

    A data.frame with 40 rows and 11 variables:

    +
    contrast
    +

    factor; the comparison being made ("4W / SED" or + "8W / SED").

    + +
    diameter_bin
    +

    factor; adipocyte diameter binned in approximately 5 + micron intervals.

    + +
    sex
    +

    factor; the sex of the rat with levels "Female" and "Male".

    + +
    ratio
    +

    numeric; ratio of the trained adipocyte rate to the sedentary + adipocyte rate. See details.

    + +
    SE
    +

    numeric; standard error for the ratio.

    + +
    df
    +

    integer; degrees of freedom for the test.

    + +
    asymp.LCL
    +

    numeric; lower bounds of the 95% confidence interval.

    + +
    asymp.UCL
    +

    numeric; upper bounds of the 95% confidence interval.

    + +
    null
    +

    integer; value for the null hypothesis: the ratio + specified by contrast is 1.

    + +
    z.ratio
    +

    numeric; Z-statistic.

    + +
    p.value
    +

    numeric; Dunnett p-value.

    + + +
    +
    +

    Details

    +

    Adipocytes are binned in approximately 5 micron intervals according + to their diameter (diameter_bin). The number of adipocytes in each + bin per animal, as well as the total number of adipocytes are tallied per + animal. The log of the total adipocytes per animal is included as an offset + term in a negative binomial regression model that contains all main effects + and interactions between sex, timepoint, and + diameter_bin as predictors of the number of binned adipocytes. The + offset term allows for modeling of the number of binned adipocytes per + total number of adipocytes by animal (modeled as a rate).

    +

    Within each combination of sex and diameter bin, the Dunnett procedure is + applied to test for differences between the trained timepoints (4W, 8W) and + the sedentary group (SED).

    +

    See vignette("ANALYTES_STATS") for details.

    +
    +
    +

    See also

    +
    -
    +
    + +
    -
    +
    + diff --git a/reference/ANALYTES.html b/reference/ANALYTES.html new file mode 100644 index 0000000..1be48f9 --- /dev/null +++ b/reference/ANALYTES.html @@ -0,0 +1,266 @@ + +Plasma clinical analytes — ANALYTES • MotrpacRatTraining6moWATData + + +
    +
    + + + +
    +
    + + +
    +

    A set of 9 common clinical analytes measured in plasma.

    +
    + +
    +
    ANALYTES
    +
    + +
    +

    Format

    +

    An object of class data.frame with 146 rows and 20 columns.

    +
    plate
    +

    integer; 96-well plate identifier (1–4).

    + +
    runseq
    +

    integer; run order (1–146).

    + +
    platepos
    +

    integer; position in each 96-well plate.

    + +
    pid
    +

    integer; randomly generated 8-digit identifier used in +linkage to phenotypic data. All samples from the same animal have the same +PID.

    + +
    bid
    +

    integer; unique 5 digit identifier of all samples +collected for an acute test/sample collection period. All samples collected +during that period will have the same BID.

    + +
    viallabel
    +

    integer; character, unique 11 digit numeric +identifier of a sample vial.

    + +
    omics_subset
    +

    logical; whether the sample was selected for +-omics analysis.

    + +
    sex
    +

    factor; the sex of the rat with levels "Female" and +"Male".

    + +
    timepoint
    +

    factor; exercise training group. Either "SED" +(sedentary) or the number of weeks of training ("1W", "2W", "4W", "8W").

    + +
    corticosterone
    +

    numeric; corticosterone (ng/mL).

    + +
    glucagon
    +

    numeric; glucagon (pmol).

    + +
    glucose
    +

    numeric; glucose (mg/dL).

    + +
    glycerol
    +

    numeric; glycerol (mg/dL).

    + +
    insulin
    +

    numeric; insulin (pg/mL).

    + +
    insulin_iu
    +

    numeric; insulin (\(\mu\)IU/mL) using the +conversion 1 pg/mL = 0.023 \(\mu\)IU/mL provided in the package insert.

    + +
    insulin_pm
    +

    numeric; insulin (pM) calculated by dividing +insulin (pg/mL) by its molecular weight (5.804 kDa).

    + +
    lactate
    +

    numeric; lactate (mmol/L).

    + +
    leptin
    +

    numeric; leptin (pg/mL).

    + +
    nefa
    +

    numeric; non-esterified fatty acids (NEFA) (mmol/L).

    + +
    total_ketones
    +

    numeric; total ketone bodies (\(\mu\)mol/L).

    + + +
    +
    +

    Details

    + +
    AnalyteCatalogue No.Company
    Corticosterone55-CORMS-E01Alpco (Salem, NH)
    GlucoseB24985Beckman Coulter (Brea, CA)
    Glycerol445850Beckman Coulter
    LactateA95550Beckman Coulter
    Total Ketones415-73301, 411-73401Fujifilm Wako (Osaka, Japan)
    NEFA995-34791, 999-34691, 993-35191, 991-34891Fujifilm Wako
    GlucagonK1535YKMeso Scale Discovery (Rockville, MD)
    Insulin, LeptinK15158C (multiplex assay)Meso Scale Discovery
    +
    +

    See also

    + +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/ANALYTES_EMM.html b/reference/ANALYTES_EMM.html new file mode 100644 index 0000000..83a79db --- /dev/null +++ b/reference/ANALYTES_EMM.html @@ -0,0 +1,254 @@ + +Plasma clinical analytes estimated marginal means — ANALYTES_EMM • MotrpacRatTraining6moWATData + + +
    +
    + + + +
    +
    + + +
    +

    A nested list of emmGrid objects. The first level + indicates whether the EMMs were for timewise or male vs. female (MvF) + comparisons. The second level is a list of emmGrid objects, one for + each clinical analyte: Glucagon, Glucose, Glycerol, Leptin, and NEFA.

    +
    + +
    +
    ANALYTES_EMM
    +
    + +
    +

    Format

    +

    An object of class list of length 2.

    +
    +
    +

    Details

    +

    See vignette("ANALYTES_STATS") for details.

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    names(ANALYTES_EMM$timewise) # clinical analytes
    +#> [1] "Glucagon" "Glucose"  "Glycerol" "Leptin"   "NEFA"    
    +
    +str(ANALYTES_EMM$timewise)
    +#> List of 5
    +#>  $ Glucagon:'emmGrid' object with variables:
    +#>     timepoint = SED, 1W, 2W, 4W, 8W
    +#>     sex = Female, Male
    +#> Transformation: “log” 
    +#>  $ Glucose :'emmGrid' object with variables:
    +#>     timepoint = SED, 1W, 2W, 4W, 8W
    +#>     sex = Female, Male
    +#> Transformation: “log” 
    +#>  $ Glycerol:'emmGrid' object with variables:
    +#>     timepoint = SED, 1W, 2W, 4W, 8W
    +#>     sex = Female, Male
    +#> Transformation: “log” 
    +#>  $ Leptin  :'emmGrid' object with variables:
    +#>     timepoint = SED, 1W, 2W, 4W, 8W
    +#>     sex = Female, Male
    +#> Transformation: “log” 
    +#>  $ NEFA    :'emmGrid' object with variables:
    +#>     timepoint = SED, 1W, 2W, 4W, 8W
    +#>     sex = Female, Male
    +#> Transformation: “log” 
    +
    +# Print one of the emmGrid objects
    +ANALYTES_EMM$timewise$Glucagon
    +#> sex = Female:
    +#>  timepoint response    SE df lower.CL upper.CL null t.ratio p.value
    +#>  SED          111.3 16.99 49     81.9    151.3    1  30.867  <.0001
    +#>  1W           102.4 15.63 49     75.3    139.2    1  30.320  <.0001
    +#>  2W            99.2 16.59 49     70.9    138.8    1  27.487  <.0001
    +#>  4W            54.2  8.28 49     39.9     73.7    1  26.156  <.0001
    +#>  8W            71.2 10.87 49     52.4     96.8    1  27.941  <.0001
    +#> 
    +#> sex = Male:
    +#>  timepoint response    SE df lower.CL upper.CL null t.ratio p.value
    +#>  SED           37.4  5.71 49     27.5     50.8    1  23.722  <.0001
    +#>  1W            33.2  5.07 49     24.4     45.1    1  22.939  <.0001
    +#>  2W            29.9  4.56 49     22.0     40.6    1  22.256  <.0001
    +#>  4W            34.9  5.33 49     25.7     47.4    1  23.269  <.0001
    +#>  8W            44.9  6.85 49     33.0     61.0    1  24.919  <.0001
    +#> 
    +#> Confidence level used: 0.95 
    +#> Intervals are back-transformed from the log scale 
    +#> Tests are performed on the log scale 
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/ANALYTES_STATS.html b/reference/ANALYTES_STATS.html new file mode 100644 index 0000000..b074deb --- /dev/null +++ b/reference/ANALYTES_STATS.html @@ -0,0 +1,227 @@ + +Statistical analyses of clinical analytes in plasma — ANALYTES_STATS • MotrpacRatTraining6moWATData + + +
    +
    + + + +
    +
    + + +
    +

    Statistical analyses of several clinical analytes described in + ANALYTES.

    +
    + +
    +
    ANALYTES_STATS
    +
    + +
    +

    Format

    +

    A list of data.frame objects with names "timewise" + (trained vs. SED comparisons) and "MvF" (male vs. female comparisons).

    +
    +
    +

    Details

    +

    See vignette("ANALYTES_STATS") for details.

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    head(ANALYTES_STATS$timewise) # trained vs. SED comparisons
    +#> # A tibble: 6 × 16
    +#>   response contrast sex    ratio    SE    df  null statistic_type statistic
    +#>   <chr>    <fct>    <fct>  <dbl> <dbl> <dbl> <dbl> <chr>              <dbl>
    +#> 1 Glucagon 1W / SED Female 0.920 0.199    49     1 t.ratio           -0.387
    +#> 2 Glucagon 2W / SED Female 0.891 0.202    49     1 t.ratio           -0.510
    +#> 3 Glucagon 4W / SED Female 0.487 0.105    49     1 t.ratio           -3.33 
    +#> 4 Glucagon 8W / SED Female 0.640 0.138    49     1 t.ratio           -2.07 
    +#> 5 Glucagon 1W / SED Male   0.887 0.192    49     1 t.ratio           -0.554
    +#> 6 Glucagon 2W / SED Male   0.799 0.173    49     1 t.ratio           -1.04 
    +#> # ℹ 7 more variables: p.value <dbl>, signif <ord>, model_type <chr>,
    +#> #   obs_removed <chr>, formula <chr>, family <chr>, weights <chr>
    +head(ANALYTES_STATS$MvF) # male vs. female comparisons
    +#> # A tibble: 6 × 16
    +#>   response contrast  timepoint ratio     SE    df  null statistic_type statistic
    +#>   <chr>    <fct>     <fct>     <dbl>  <dbl> <dbl> <dbl> <chr>              <dbl>
    +#> 1 Glucagon Male / F… SED       0.336 0.0725    49     1 t.ratio            -5.05
    +#> 2 Glucagon Male / F… 1W        0.324 0.0700    49     1 t.ratio            -5.22
    +#> 3 Glucagon Male / F… 2W        0.301 0.0683    49     1 t.ratio            -5.30
    +#> 4 Glucagon Male / F… 4W        0.644 0.139     49     1 t.ratio            -2.04
    +#> 5 Glucagon Male / F… 8W        0.630 0.136     49     1 t.ratio            -2.14
    +#> 6 Glucose  Male / F… SED       1.28  0.0727    50     1 t.ratio             4.35
    +#> # ℹ 7 more variables: p.value <dbl>, signif <ord>, model_type <chr>,
    +#> #   obs_removed <chr>, formula <chr>, family <chr>, weights <chr>
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/GO_FGSEA.html b/reference/GO_FGSEA.html index 4b89b60..9f03827 100644 --- a/reference/GO_FGSEA.html +++ b/reference/GO_FGSEA.html @@ -1,78 +1,300 @@ -Gene Ontology FGSEA results — GO_FGSEA • MotrpacRatTraining6moWATDataGene Ontology FGSEA results — GO_FGSEA • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    + +
    -
    +
    + diff --git a/reference/METAB_EXP.html b/reference/METAB_EXP.html index 889989f..24068e3 100644 --- a/reference/METAB_EXP.html +++ b/reference/METAB_EXP.html @@ -1,88 +1,190 @@ -Metabolomics ExpressionSet — METAB_EXP • MotrpacRatTraining6moWATDataMetabolomics ExpressionSet — METAB_EXP • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    + + - + diff --git a/reference/METAB_FGSEA.html b/reference/METAB_FGSEA.html index 5f499f1..9e894f1 100644 --- a/reference/METAB_FGSEA.html +++ b/reference/METAB_FGSEA.html @@ -1,77 +1,207 @@ -Metabolomics RefMet chemical subclass FGSEA — METAB_FGSEA • MotrpacRatTraining6moWATDataMetabolomics RefMet chemical subclass FGSEA — METAB_FGSEA • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    +
    + + + +
    +
    + -
    -

    Metabolomics RefMet chemical subclass FGSEA

    +
    +

    FGSEA of the metabolomics differential analysis results using + the Metabolomics Workbench RefMet chemical subclasses.

    -
    -

    Usage

    +
    METAB_FGSEA
    -
    -

    Format

    -

    An object of class list of length 3.

    +
    +

    Format

    +

    A named list of 3 data.frame objects. Similar to what is in + GO_FGSEA.

    +
    +
    +

    Details

    +

    Metabolites were grouped according to their RefMet subclass and + FGSEA was performed the same as for gene sets. Only those subclasses with + at least 10 metabolites, after filtering to what was detected in WAT, were + tested for enrichment.

    +
    +
    +

    References

    +

    Fahy, E., & Subramaniam, S. (2020). RefMet: A reference + nomenclature for metabolomics. Nature Methods, 17(12), 1173–1174. + https://doi.org/10.1038/s41592-020-01009-y

    +
    + -
    +
    + +
    -
    +
    + diff --git a/reference/METAB_TG_CONC.html b/reference/METAB_TG_CONC.html index f6e79c9..6473eab 100644 --- a/reference/METAB_TG_CONC.html +++ b/reference/METAB_TG_CONC.html @@ -1,77 +1,190 @@ -Metabolomics triacylglyceride concentration — METAB_TG_CONC • MotrpacRatTraining6moWATDataMetabolomics triglyceride concentration — METAB_TG_CONC • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    +
    + + + +
    +
    + -
    -

    Metabolomics triacylglyceride concentration

    +
    +

    Standardized median concentrations of triglyceride (normalized + to internal standard) detected in subcutaneous white adipose tissue.

    -
    -

    Usage

    +
    METAB_TG_CONC
    -
    -

    Format

    -

    An object of class ExpressionSet with 190 rows and 10 columns.

    +
    +

    Format

    +

    An object of class ExpressionSet with 190 features + (triglyceride) and 10 samples (each combination of sex and training + timepoint).

    -
    +
    + +
    -
    +
    + diff --git a/reference/MITOCARTA_HS.html b/reference/MITOCARTA_HS.html new file mode 100644 index 0000000..c011cd6 --- /dev/null +++ b/reference/MITOCARTA_HS.html @@ -0,0 +1,217 @@ + +Human MitoCarta3.0 Pathways — MITOCARTA_HS • MotrpacRatTraining6moWATData + + +
    +
    + + + +
    +
    + + +
    +

    Pathways from the human MitoCarta3.0 database.

    +
    + +
    +
    MITOCARTA_HS
    +
    + +
    +

    Format

    +

    A data.frame with 149 rows (pathways) and 3 variables:

    +
    pathway
    +

    character; pathway description.

    + +
    hierarchy
    +

    character; pathway hierarchy.

    + +
    human_genes
    +

    list; character list of human genes in each pathway.

    + + +
    +
    +

    Source

    +

    The "HumanMitoCarta3.0.xls" file was downloaded from + https://www.broadinstitute.org/files/shared/metabolism/mitocarta/human.mitocarta3.0.html. + Columns 2–4 were extracted from the "C MitoPathways" sheet and renamed.

    +
    +
    +

    References

    +

    Rath, S., Sharma, R., Gupta, R., Ast, T., Chan, C., Durham, T. + J., Goodman, R. P., Grabarek, Z., Haas, M. E., Hung, W. H. W., Joshi, P. + R., Jourdain, A. A., Kim, S. H., Kotrys, A. V., Lam, S. S., McCoy, J. G., + Meisel, J. D., Miranda, M., Panda, A., Patgiri, A., … Mootha, V. K. (2021). + MitoCarta3.0: an updated mitochondrial proteome now with sub-organelle + localization and pathway annotations. Nucleic acids research, + 49(D1), D1541–D1547. https://doi.org/10.1093/nar/gkaa1011

    +
    + + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/MITO_DNA.html b/reference/MITO_DNA.html index 49cc07c..d84a489 100644 --- a/reference/MITO_DNA.html +++ b/reference/MITO_DNA.html @@ -1,58 +1,165 @@ -Mitochondrial DNA qPCR — MITO_DNA • MotrpacRatTraining6moWATDataMitochondrial DNA qPCR — MITO_DNA • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    + +
    -
    + diff --git a/reference/MotrpacRatTraining6moWATData-package.html b/reference/MotrpacRatTraining6moWATData-package.html index 9c32806..58b634f 100644 --- a/reference/MotrpacRatTraining6moWATData-package.html +++ b/reference/MotrpacRatTraining6moWATData-package.html @@ -1,60 +1,166 @@ -MotrpacRatTraining6moWATData: Data and Analysis Results for the MoTrPAC PASS1B Rat White Adipose Tissue Companion Paper — MotrpacRatTraining6moWATData-package • MotrpacRatTraining6moWATDataMotrpacRatTraining6moWATData: Data and Analysis Results for the MoTrPAC PASS1B Rat White Adipose Tissue Companion Paper — MotrpacRatTraining6moWATData-package • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Contains data and code necessary to reproduce analyses that appear in "Sexual dimorphism and the multi-omic response to exercise training in rat subcutaneous white adipose tissue".

    -
    -

    See also

    -

    Useful links:

    + +
    -
    +
    + diff --git a/reference/PHENO_WAT.html b/reference/PHENO_WAT.html new file mode 100644 index 0000000..3c200d8 --- /dev/null +++ b/reference/PHENO_WAT.html @@ -0,0 +1,225 @@ + +scWAT Phenotype Data — PHENO_WAT • MotrpacRatTraining6moWATData + + +
    +
    + + + +
    +
    + + +
    +

    Phenotype data for scWAT samples from the MoTrPAC endurance + exercise training study in 6-month-old-rats: NMR body composition and + VO\(_2\)max testing results.

    +
    + +
    +
    PHENO_WAT
    +
    + +
    +

    Format

    +

    An object of class data.frame with 92 rows and 21 columns.

    +
    + +
    +

    Examples

    +
    head(PHENO_WAT)
    +#>        pid iowa_id omics_analysis    sex timepoint pre_weight vo2_pre_weight
    +#> 1 10043527  06F8T1           TRUE Female       SED      181.2          178.3
    +#> 2 10043799  06F8T3          FALSE Female       SED      179.0          182.8
    +#> 3 10043950  06F8T4           TRUE Female       SED      174.4          178.2
    +#> 4 10044094  06F8T5          FALSE Female       SED      181.2          182.0
    +#> 5 10044337  06F8T8           TRUE Female       SED      185.2          182.4
    +#> 6 10044418  06F8T9          FALSE Female       SED      178.3          174.5
    +#>   vo2_post_weight post_weight pre_fat pre_fat_pct post_fat post_fat_pct
    +#> 1           199.2         199 20.2944        11.2  21.2004         11.7
    +#> 2           203.0         203 19.1530        10.7  25.4180         14.2
    +#> 3           202.3         202 19.1840        11.0  27.0320         15.5
    +#> 4           190.4         190 20.4756        11.3  24.6432         13.6
    +#> 5           204.6         205 21.2980        11.5  27.5948         14.9
    +#> 6           190.8         191 20.1479        11.3  24.4271         13.7
    +#>   pre_lean pre_lean_pct post_lean post_lean_pct pre_vo2max_ml_kg_min
    +#> 1 109.2636         60.3  107.9952          59.6                 83.8
    +#> 2 105.9680         59.2   99.7030          55.7                 71.7
    +#> 3 103.2448         59.2   96.9664          55.6                 72.5
    +#> 4 105.4584         58.2  103.8276          57.3                 69.7
    +#> 5 108.8976         58.8  101.4896          54.8                 69.6
    +#> 6 104.1272         58.4  102.7008          57.6                 77.6
    +#>   post_vo2max_ml_kg_min pre_vo2max_ml_kg_lean_min post_vo2max_ml_kg_lean_min
    +#> 1                 73.16                  136.7476                   134.9456
    +#> 2                 63.77                  123.6860                   129.8387
    +#> 3                 64.63                  125.1346                   134.8369
    +#> 4                 61.85                  120.2882                   113.4211
    +#> 5                 73.52                  116.5778                   148.2141
    +#> 6                 63.65                  130.0448                   118.2505
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/PHENO_WAT_STATS.html b/reference/PHENO_WAT_STATS.html new file mode 100644 index 0000000..3490fc1 --- /dev/null +++ b/reference/PHENO_WAT_STATS.html @@ -0,0 +1,206 @@ + +Statistical analyses of scWAT phenotype data — PHENO_WAT_STATS • MotrpacRatTraining6moWATData + + +
    +
    + + + +
    +
    + + +
    +

    Analyses of phenotypic data from PHENO_WAT. See + vignette("PHENO_WAT_STATS") for details.

    +
    + +
    +
    PHENO_WAT_STATS
    +
    + +
    +

    Format

    +

    An object of class tbl_df (inherits from tbl, data.frame) with 27 rows and 16 columns.

    +
    + +
    +

    Examples

    +
    head(PHENO_WAT_STATS)
    +#> # A tibble: 6 × 16
    +#>   response   timepoint sex   emmean    SE    df lower.CL upper.CL statistic_type
    +#>   <chr>      <fct>     <fct>  <dbl> <dbl> <dbl>    <dbl>    <dbl> <chr>         
    +#> 1 NMR Weight SED       Fema…  22.6   1.90    30   17.8      27.4  t.ratio       
    +#> 2 NMR Weight 4W        Fema…   5.65  2.41    30   -0.473    11.8  t.ratio       
    +#> 3 NMR Weight 8W        Fema…  10.0   2.52    30    3.65     16.4  t.ratio       
    +#> 4 NMR Weight SED       Male   17.2   8.31    30   -3.86     38.3  t.ratio       
    +#> 5 NMR Weight 4W        Male   -8.85  6.33    30  -24.9       7.21 t.ratio       
    +#> 6 NMR Weight 8W        Male  -17.7   1.39    30  -21.2     -14.1  t.ratio       
    +#> # ℹ 7 more variables: statistic <dbl>, p.value <dbl>, signif <ord>,
    +#> #   model_type <chr>, formula <chr>, family <chr>, weights <chr>
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/PHOSPHO_EXP.html b/reference/PHOSPHO_EXP.html index 1c58848..51c0942 100644 --- a/reference/PHOSPHO_EXP.html +++ b/reference/PHOSPHO_EXP.html @@ -1,87 +1,189 @@ -Phosphoproteomics ExpressionSet — PHOSPHO_EXP • MotrpacRatTraining6moWATDataPhosphoproteomics ExpressionSet — PHOSPHO_EXP • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    + +
    -
    + diff --git a/reference/PHOSPHO_KSEA.html b/reference/PHOSPHO_KSEA.html index 14eb010..c6f4ebe 100644 --- a/reference/PHOSPHO_KSEA.html +++ b/reference/PHOSPHO_KSEA.html @@ -1,77 +1,216 @@ -Phosphoproteomics KSEA — PHOSPHO_KSEA • MotrpacRatTraining6moWATDataPhosphoproteomics KSEA — PHOSPHO_KSEA • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    +
    + + + +
    +
    + -
    -

    Phosphoproteomics KSEA

    +
    +

    Kinase—Substrate Enrichment Analysis (KSEA) of the + phosphoproteomics differential analysis results using kinase sets from + PhosphoSitePlus.

    -
    -

    Usage

    +
    PHOSPHO_KSEA
    -
    -

    Format

    -

    An object of class list of length 3.

    +
    +

    Format

    +

    A named list of 3 data.frame objects. Similar to what is in + GO_FGSEA.

    +
    +
    +

    Details

    +

    See PSP_KINASE_SUBSTRATE for details on the kinase + sets.

    +

    Rat phosphorylation sites in PHOSPHO_DA were mapped to their + human orthologs and multiply-phosphorylated sites were split and aggregated + to the single-site level by taking the arithmetic mean of the + -log\(_{10}\)(p-value) signed by the log\(_2\) fold-change. FGSEA was + then performed with fgsea2 by + grouping substrates according to their kinases and treating these kinase + groups as gene sets. Only those kinases with at least 3 substrates were + tested for enrichment.

    +
    +
    +

    References

    +

    Hornbeck, P. V., Zhang, B., Murray, B., Kornhauser, J. M., + Latham, V., & Skrzypek, E. (2015). PhosphoSitePlus, 2014: mutations, PTMs + and recalibrations. Nucleic acids research, 43(Database issue), + D512–D520. https://doi.org/10.1093/nar/gku1267

    +
    + -
    +
    + +
    -
    +
    + diff --git a/reference/PROT_EXP.html b/reference/PROT_EXP.html index 852c91d..73af691 100644 --- a/reference/PROT_EXP.html +++ b/reference/PROT_EXP.html @@ -1,85 +1,187 @@ -Proteomics ExpressionSet — PROT_EXP • MotrpacRatTraining6moWATDataProteomics ExpressionSet — PROT_EXP • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    + +
    - + diff --git a/reference/PROT_MITOCARTA_FGSEA.html b/reference/PROT_MITOCARTA_FGSEA.html index d5df733..73b357c 100644 --- a/reference/PROT_MITOCARTA_FGSEA.html +++ b/reference/PROT_MITOCARTA_FGSEA.html @@ -1,77 +1,213 @@ -Proteomics MitoCarta FGSEA — PROT_MITOCARTA_FGSEA • MotrpacRatTraining6moWATDataProteomics MitoCarta FGSEA — PROT_MITOCARTA_FGSEA • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    +
    + + + +
    +
    + -
    -

    Proteomics MitoCarta FGSEA

    +
    +

    FGSEA of the proteomics differential analysis using terms from + the MitoCarta3.0 database.

    -
    -

    Usage

    +
    PROT_MITOCARTA_FGSEA
    -
    -

    Format

    -

    An object of class list of length 3.

    +
    +

    Format

    +

    A named list of 3 data.frame objects. See + GO_FGSEA for details.

    +
    +
    +

    References

    +

    Korotkevich, G., Sukhov, V., Budin, N., Shpak, B., Artyomov, M. + N., & Sergushichev, A. (2021). Fast gene set enrichment analysis. + BioRxiv. https://doi.org/10.1101/060012

    +

    Rath, S., Sharma, R., Gupta, R., Ast, T., Chan, C., Durham, T. J., Goodman, + R. P., Grabarek, Z., Haas, M. E., Hung, W. H. W., Joshi, P. R., Jourdain, + A. A., Kim, S. H., Kotrys, A. V., Lam, S. S., McCoy, J. G., Meisel, J. D., + Miranda, M., Panda, A., … Mootha, V. K. (2020). MitoCarta3.0: An updated + mitochondrial proteome now with sub-organelle localization and pathway + annotations. Nucleic Acids Research, 49(D1), D1541–D1547. + https://doi.org/10.1093/nar/gkaa1011

    +

    Subramanian, A., Tamayo, P., Mootha, V. K., Mukherjee, S., Ebert, B. L., + Gillette, M. A., Paulovich, A., Pomeroy, S. L., Golub, T. R., Lander, E. + S., & Mesirov, J. P. (2005). Gene set enrichment analysis: A + knowledge-based approach for interpreting genome-wide expression profiles. + Proceedings of the National Academy of Sciences of the United States + of America, 102(43), 15545–15550. + https://doi.org/10.1073/pnas.0506580102

    +
    +
    +

    See also

    +
    -
    +
    + +
    -
    +
    + diff --git a/reference/PSP_KINASE_SUBSTRATE.html b/reference/PSP_KINASE_SUBSTRATE.html index 873a91c..e072511 100644 --- a/reference/PSP_KINASE_SUBSTRATE.html +++ b/reference/PSP_KINASE_SUBSTRATE.html @@ -1,95 +1,256 @@ -PhosphoSitePlus kinase-substrate relationships — PSP_KINASE_SUBSTRATE • MotrpacRatTraining6moWATDataPhosphoSitePlus kinase-substrate relationships — PSP_KINASE_SUBSTRATE • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    + +
    -
    +
    + diff --git a/reference/TRNSCRPT_EXP.html b/reference/TRNSCRPT_EXP.html index 9d11c79..c571c0f 100644 --- a/reference/TRNSCRPT_EXP.html +++ b/reference/TRNSCRPT_EXP.html @@ -1,73 +1,175 @@ -Transcriptomics ExpressionSet — TRNSCRPT_EXP • MotrpacRatTraining6moWATDataTranscriptomics ExpressionSet — TRNSCRPT_EXP • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    + + - + diff --git a/reference/WAT_DA.html b/reference/WAT_DA.html new file mode 100644 index 0000000..b179601 --- /dev/null +++ b/reference/WAT_DA.html @@ -0,0 +1,367 @@ + +Differential analysis results — WAT_DA • MotrpacRatTraining6moWATData + + +
    +
    + + + +
    +
    + + +
    +

    Differential analysis of proteins, transcripts, phosphorylation + sites, and metabolites measured in rat scWAT.

    +
    + +
    +
    PROT_DA     # proteomics
    +PHOSPHO_DA  # phosphoproteomics
    +TRNSCRPT_DA # transcriptomics
    +METAB_DA    # metabolomics
    +
    + +
    +

    Format

    +

    A named list of 3 data.frame objects:

    +

    "trained_vs_SED"
    +

    All trained timepoints compared to their + sex-matched sedentary control group. Example: F_1W - F_SED. Total of 8 + contrasts.

    + +
    "MvF_SED"
    +

    Sedentary males compared to sedentary females. Only 1 + contrast.

    + +
    "MvF_exercise_response"
    +

    Comparisons of the male and female + training responses. Example: (M_8W - M_SED) - (F_8W - F_SED). Total of 4 + contrasts.

    + + +

    In addition to all columns present in the Biobase::fData tables, + each data.frame contains the following 8 variables:

    +

    logFC
    +

    numeric; difference in the weighted mean log\(_2\) + values of the groups specified in the contrast column.

    + +
    AveExpr
    +

    numeric; mean log\(_2\) relative abundance of + each feature.

    + +
    t
    +

    numeric; LIMMA moderated t-statistic.

    + +
    P.Value
    +

    numeric; p-value.

    + +
    adj.P.Val
    +

    numeric; Benjamini-Hochberg adjusted p-value. + P-values are adjusted across all contrasts.

    + +
    feature
    +

    character; uniquely defines each feature that was + tested. Same as feature_ID.

    + +
    contrast
    +

    factor; the contrast(s) being tested.

    + +
    se
    +

    numeric; standard error (SE) of the + logFC column.

    + + +
    +
    +

    Details

    +

    Differential analysis was performed with + MotrpacRatTraining6moWAT::limma_full + on the ExpressionSet objects.

    +
    + + +
    +

    Examples

    +
    ## Number of differential features (-ome-wide FDR < 0.05)
    +# Convenience function
    +f1 <- function(x) {
    +  lapply(x, function(.x) with(.x, table(contrast, adj.P.Val < 0.05)))
    +}
    +
    +f1(PROT_DA)     # Proteins
    +#> $trained_vs_SED
    +#>               
    +#> contrast       FALSE TRUE
    +#>   F_1W - F_SED  9875   89
    +#>   F_2W - F_SED  9743  221
    +#>   F_4W - F_SED  9825  139
    +#>   F_8W - F_SED  9839  125
    +#>   M_1W - M_SED  9811  153
    +#>   M_2W - M_SED  9888   76
    +#>   M_4W - M_SED  9393  571
    +#>   M_8W - M_SED  9310  654
    +#> 
    +#> $MvF_SED
    +#>                
    +#> contrast        FALSE TRUE
    +#>   M_SED - F_SED  5738 4226
    +#> 
    +#> $MvF_exercise_response
    +#>                                  
    +#> contrast                          FALSE TRUE
    +#>   (M_1W - M_SED) - (F_1W - F_SED)  9943   21
    +#>   (M_2W - M_SED) - (F_2W - F_SED)  9926   38
    +#>   (M_4W - M_SED) - (F_4W - F_SED)  9824  140
    +#>   (M_8W - M_SED) - (F_8W - F_SED)  9943   21
    +#> 
    +f1(PHOSPHO_DA)  # Phosphosites
    +#> $trained_vs_SED
    +#>               
    +#> contrast       FALSE  TRUE
    +#>   F_1W - F_SED 30065   239
    +#>   F_2W - F_SED 29952   352
    +#>   F_4W - F_SED 30083   221
    +#>   F_8W - F_SED 30147   157
    +#>   M_1W - M_SED 30235    69
    +#>   M_2W - M_SED 30166   138
    +#>   M_4W - M_SED 30022   282
    +#>   M_8W - M_SED 29360   944
    +#> 
    +#> $MvF_SED
    +#>                
    +#> contrast        FALSE  TRUE
    +#>   M_SED - F_SED 24276  6028
    +#> 
    +#> $MvF_exercise_response
    +#>                                  
    +#> contrast                          FALSE
    +#>   (M_1W - M_SED) - (F_1W - F_SED) 30304
    +#>   (M_2W - M_SED) - (F_2W - F_SED) 30304
    +#>   (M_4W - M_SED) - (F_4W - F_SED) 30304
    +#>   (M_8W - M_SED) - (F_8W - F_SED) 30304
    +#> 
    +f1(TRNSCRPT_DA) # Transcripts
    +#> $trained_vs_SED
    +#>               
    +#> contrast       FALSE  TRUE
    +#>   F_1W - F_SED 16237   167
    +#>   F_2W - F_SED 16345    59
    +#>   F_4W - F_SED 16349    55
    +#>   F_8W - F_SED 16211   193
    +#>   M_1W - M_SED 16248   156
    +#>   M_2W - M_SED 15875   529
    +#>   M_4W - M_SED 16391    13
    +#>   M_8W - M_SED 16314    90
    +#> 
    +#> $MvF_SED
    +#>                
    +#> contrast        FALSE  TRUE
    +#>   M_SED - F_SED  6068 10336
    +#> 
    +#> $MvF_exercise_response
    +#>                                  
    +#> contrast                          FALSE  TRUE
    +#>   (M_1W - M_SED) - (F_1W - F_SED) 16270   134
    +#>   (M_2W - M_SED) - (F_2W - F_SED) 16314    90
    +#>   (M_4W - M_SED) - (F_4W - F_SED) 16390    14
    +#>   (M_8W - M_SED) - (F_8W - F_SED) 16361    43
    +#> 
    +f1(METAB_DA)    # Metabolites
    +#> $trained_vs_SED
    +#>               
    +#> contrast       FALSE TRUE
    +#>   F_1W - F_SED   969   94
    +#>   F_2W - F_SED   928  135
    +#>   F_4W - F_SED  1043   20
    +#>   F_8W - F_SED   924  139
    +#>   M_1W - M_SED   973   90
    +#>   M_2W - M_SED   902  161
    +#>   M_4W - M_SED   909  154
    +#>   M_8W - M_SED   852  211
    +#> 
    +#> $MvF_SED
    +#>                
    +#> contrast        FALSE TRUE
    +#>   M_SED - F_SED   448  615
    +#> 
    +#> $MvF_exercise_response
    +#>                                  
    +#> contrast                          FALSE TRUE
    +#>   (M_1W - M_SED) - (F_1W - F_SED)  1027   36
    +#>   (M_2W - M_SED) - (F_2W - F_SED)  1025   38
    +#>   (M_4W - M_SED) - (F_4W - F_SED)  1007   56
    +#>   (M_8W - M_SED) - (F_8W - F_SED)  1031   32
    +#> 
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/WAT_WGCNA.html b/reference/WAT_WGCNA.html new file mode 100644 index 0000000..9436456 --- /dev/null +++ b/reference/WAT_WGCNA.html @@ -0,0 +1,208 @@ + +WGCNA results — WAT_WGCNA • MotrpacRatTraining6moWATData + + +
    +
    + + + +
    +
    + + +
    +

    Weighted Gene Co-expression Network Analysis (WGCNA) applied to + subcutaneous white adipose tissue proteomics, transcriptomics, and + metabolomics datasets to derive clusters of similarly-behaving features for + further examination.

    +
    + +
    +
    PROT_WGCNA     # proteomics
    +TRNSCRPT_WGCNA # transcriptomics
    +METAB_WGCNA    # metabolomics
    +
    + +
    +

    Details

    +

    See run_WGCNA for a + description of the output.

    +
    +
    +

    References

    +

    Horvath, S. (2011). Weighted Network Analysis. Springer New + York. https://doi.org/10.1007/978-1-4419-8819-5

    +

    Langfelder, P., & Horvath, S. (2008). WGCNA: an R package for weighted + correlation network analysis. BMC Bioinformatics, 9(1), 1–13. + https://doi.org/10.1186/1471-2105-9-559

    +
    +
    +

    See also

    + +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/index.html b/reference/index.html index bad8d85..0df2033 100644 --- a/reference/index.html +++ b/reference/index.html @@ -1,251 +1,268 @@ -Function reference • MotrpacRatTraining6moWATDataFunction reference • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    - -
    -

    Input Data

    - - - - -
    - -

    ExpressionSet Objects

    - - - -
    - - - - -
    - - TRNSCRPT_EXP -
    -
    Transcriptomics ExpressionSet
    -
    - - PROT_EXP -
    -
    Proteomics ExpressionSet
    -
    - - PHOSPHO_EXP -
    -
    Phosphoproteomics ExpressionSet
    -
    - - METAB_EXP -
    -
    Metabolomics ExpressionSet
    -
    - -

    FGSEA Feature Sets

    -

    Gene Ontology terms and kinase sets for FGSEA.

    - - -
    - - - - -
    - - MSIGDB_PATHWAYS -
    -
    MSigDB Gene Ontology sets
    -
    - - PSP_KINASE_SUBSTRATE -
    -
    PhosphoSitePlus kinase-substrate relationships
    -
    -

    Analysis Results

    - - - - -
    - -

    Differential Analysis

    - - - -
    - - - - -
    - - PROT_DA PHOSPHO_DA TRNSCRPT_DA METAB_DA -
    -
    Differential analysis results
    -
    - -

    Enrichment Analysis

    -

    Fast Gene Set Enrichment Analysis (FGSEA) results.

    - - -
    - - - - -
    - - TRNSCRPT_FGSEA PROT_FGSEA -
    -
    Gene Ontology FGSEA results
    -
    - - PROT_MITOCARTA_FGSEA -
    -
    Proteomics MitoCarta FGSEA
    -
    - - METAB_FGSEA -
    -
    Metabolomics RefMet chemical subclass FGSEA
    -
    - - PHOSPHO_KSEA -
    -
    Phosphoproteomics KSEA
    -
    - -

    WGCNA

    -

    Weighted Gene Co-Expression Network Analysis (WGCNA).

    - - -
    - - - - -
    - - PROT_WGCNA TRNSCRPT_WGCNA METAB_WGCNA -
    -
    WGCNA results
    -
    - -

    WGCNA Module ORA

    -

    Over-representation analysis performed on WGCNA modules.

    +
    +
    +
    -
    - - - -
    - - PROT_MODULE_ORA TRNSCRPT_MODULE_ORA METAB_MODULE_ORA -
    -
    Over-representation analysis of WGCNA modules
    -
    -

    Miscellaneous

    - -

    Catch-all until I can move these elsewhere.

    +
    +
    + - -
    - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    All functions

    +

    +
    +

    ADIPOCYTE_SIZE

    +

    Measures of adipocyte size

    +

    ADIPOCYTE_SIZE_STATS

    +

    Analysis of differences in adipocyte diameter

    +

    ANALYTES

    +

    Plasma clinical analytes

    +

    ANALYTES_EMM

    +

    Plasma clinical analytes estimated marginal means

    +

    ANALYTES_STATS

    +

    Statistical analyses of clinical analytes in plasma

    +

    TRNSCRPT_FGSEA PROT_FGSEA

    +

    Gene Ontology FGSEA results

    +

    METAB_EXP

    +

    Metabolomics ExpressionSet

    +

    METAB_FGSEA

    +

    Metabolomics RefMet chemical subclass FGSEA

    +

    METAB_TG_CONC

    +

    Metabolomics triglyceride concentration

    +

    MITOCARTA_HS

    +

    Human MitoCarta3.0 Pathways

    +

    MITO_DNA

    +

    Mitochondrial DNA qPCR

    +

    PHENO_WAT

    +

    scWAT Phenotype Data

    +

    PHENO_WAT_STATS

    +

    Statistical analyses of scWAT phenotype data

    +

    PHOSPHO_EXP

    +

    Phosphoproteomics ExpressionSet

    +

    PHOSPHO_KSEA

    +

    Phosphoproteomics KSEA

    +

    PROT_EXP

    +

    Proteomics ExpressionSet

    +

    PROT_MITOCARTA_FGSEA

    +

    Proteomics MitoCarta FGSEA

    +

    PSP_KINASE_SUBSTRATE

    +

    PhosphoSitePlus kinase-substrate relationships

    +

    TRNSCRPT_EXP

    +

    Transcriptomics ExpressionSet

    +

    PROT_DA PHOSPHO_DA TRNSCRPT_DA METAB_DA

    +

    Differential analysis results

    +

    PROT_WGCNA TRNSCRPT_WGCNA METAB_WGCNA

    +

    WGCNA results

    +

    TRNSCRPT_MODULE_ORA PROT_MODULE_ORA METAB_MODULE_ORA

    +

    Over-representation analysis of WGCNA modules

    +

    MSIGDB_PATHWAYS

    +

    MSigDB Gene Ontology sets

    -
    - - METAB_TG_CONC -
    -
    Metabolomics triacylglyceride concentration
    -
    - - MITO_DNA -
    -
    Mitochondrial DNA qPCR
    -
    - - PLASMA_ANALYTES -
    -
    Plasma clinical analytes
    -
    - - PLASMA_ANALYTE_STATS -
    -
    Plasma analyte statistical analyses
    -
    - - ADIPOCYTE_SIZE -
    -
    Measures of adipocyte size
    -
    - - ADIPOCYTE_SIZE_STATS -
    -
    Analysis of adipocyte size differences
    -
    - - WATSC_PHENO -
    -
    Phenotype Measures
    -
    -
    + + -
    +
    + diff --git a/reference/module_ORA.html b/reference/module_ORA.html index e9d120e..9d3e2c7 100644 --- a/reference/module_ORA.html +++ b/reference/module_ORA.html @@ -1,85 +1,222 @@ -Over-representation analysis of WGCNA modules — module_ORA • MotrpacRatTraining6moWATDataOver-representation analysis of WGCNA modules — module_ORA • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    +
    + + + +
    +
    + -
    -

    Results of performing Gene Ontology (GO) over-representation - analysis (Fisher Exact / Hypergeometric test) on the modules produced by - weighted gene co-expression network analysis (WGCNA).

    +
    +

    Results of performing Gene Ontology over-representation analysis + (Fisher Exact / Hypergeometric test) on each of the modules produced by + Weighted Gene Co-expression Network Analysis (WGCNA).

    -
    -

    Usage

    -
    PROT_MODULE_ORA     # proteomics
    -TRNSCRPT_MODULE_ORA # transcriptomics
    +    
    +
    TRNSCRPT_MODULE_ORA # transcriptomics
    +PROT_MODULE_ORA     # proteomics
     METAB_MODULE_ORA    # metabolomics
    -
    -

    Format

    +
    +

    Format

    An object of class data.table (inherits from data.frame) with 2615 rows and 12 columns.

    +
    +

    Details

    +

    The same gene sets and RefMet subclasses that were used to generate + the FGSEA results were also used here.

    +
    +
    +

    References

    +

    Ashburner, M., Ball, C. A., Blake, J. A., Botstein, D., Butler, + H., Cherry, J. M., Davis, A. P., Dolinski, K., Dwight, S. S., Eppig, J. T., + Harris, M. A., Hill, D. P., Issel-Tarver, L., Kasarskis, A., Lewis, S., + Matese, J. C., Richardson, J. E., Ringwald, M., Rubin, G. M., & Sherlock, + G. (2000). Gene ontology: tool for the unification of biology. The Gene + Ontology Consortium. Nature genetics, 25(1), 25–29. + https://doi.org/10.1038/75556

    +

    Dolgalev, I. msigdbr: MSigDB Gene Sets for Multiple Organisms in a Tidy + Data Format. R package version 7.5.1, + https:://igordot.github.io/msigdbr

    +

    Gene Ontology Consortium (2021). The Gene Ontology resource: enriching a + GOld mine. Nucleic acids research, 49(D1), D325–D334. + https://doi.org/10.1093/nar/gkaa1113

    +

    Liberzon, A., Birger, C., Thorvaldsdóttir, H., Ghandi, M., Mesirov, J. P., + & Tamayo, P. (2015). The Molecular Signatures Database (MSigDB) hallmark + gene set collection. Cell systems, 1(6), 417–425. + https://doi.org/10.1016/j.cels.2015.12.004

    +
    +
    +

    See also

    + +
    -
    +
    + +
    -
    +
    + diff --git a/reference/msigdb_pathways.html b/reference/msigdb_pathways.html index 310fbb4..767d5d8 100644 --- a/reference/msigdb_pathways.html +++ b/reference/msigdb_pathways.html @@ -1,61 +1,165 @@ -MSigDB Gene Ontology sets — MSIGDB_PATHWAYS • MotrpacRatTraining6moWATDataMSigDB Gene Ontology sets — MSIGDB_PATHWAYS • MotrpacRatTraining6moWATData - Skip to contents + -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Gene sets from the Molecular Signatures Database (MSigDB). Used for Fast Gene Set Enrichment Analysis (FGSEA).

    -
    -

    Usage

    +
    MSIGDB_PATHWAYS
    -
    -

    Format

    +
    +

    Format

    A data.frame with 5106 rows and 5 columns:

    gs_subcat

    character; the database to which the gene set belongs. One of "GO:BP", "GO:MF", or "GO:CC".

    @@ -75,53 +179,57 @@

    Format<

    -
    -

    Details

    +
    +

    Details

    Gene Ontology (Biological Process, Cellular Component, Molecular Function) pathways from version 7.5.1 of the Molecular Signatures Database - (MSigDB). Obtained via msigdbr (organism = + (MSigDB). Obtained via msigdbr (organism = "Rattus norvegicus") and reformatted. Prefiltered to pathways with at least 15 and no more than 300 genes. Filtering by size was done because smaller gene sets tend to be less reliable, while larger gene sets tend to be less interpretable.

    -
    -

    References

    -

    Liberzon, A., Birger, C., Thorvaldsdóttir, H., Ghandi, M., - Mesirov, J. P., & Tamayo, P. (2015). The Molecular Signatures Database - (MSigDB) hallmark gene set collection. Cell systems, 1(6), 417--425. - https://doi.org/10.1016/j.cels.2015.12.004

    +
    +

    References

    +

    Ashburner, M., Ball, C. A., Blake, J. A., Botstein, D., Butler, + H., Cherry, J. M., Davis, A. P., Dolinski, K., Dwight, S. S., Eppig, J. T., + Harris, M. A., Hill, D. P., Issel-Tarver, L., Kasarskis, A., Lewis, S., + Matese, J. C., Richardson, J. E., Ringwald, M., Rubin, G. M., & Sherlock, + G. (2000). Gene ontology: tool for the unification of biology. The Gene + Ontology Consortium. Nature genetics, 25(1), 25–29. + https://doi.org/10.1038/75556

    Dolgalev, I. msigdbr: MSigDB Gene Sets for Multiple Organisms in a Tidy Data Format. R package version 7.5.1, https:://igordot.github.io/msigdbr

    -

    Ashburner, M., Ball, C. A., Blake, J. A., Botstein, D., Butler, H., Cherry, - J. M., Davis, A. P., Dolinski, K., Dwight, S. S., Eppig, J. T., Harris, M. - A., Hill, D. P., Issel-Tarver, L., Kasarskis, A., Lewis, S., Matese, J. C., - Richardson, J. E., Ringwald, M., Rubin, G. M., & Sherlock, G. (2000). Gene - ontology: tool for the unification of biology. The Gene Ontology - Consortium. Nature genetics, 25(1), 25--29. - https://doi.org/10.1038/75556

    Gene Ontology Consortium (2021). The Gene Ontology resource: enriching a - GOld mine. Nucleic acids research, 49(D1), D325--D334. + GOld mine. Nucleic acids research, 49(D1), D325–D334. https://doi.org/10.1093/nar/gkaa1113

    +

    Liberzon, A., Birger, C., Thorvaldsdóttir, H., Ghandi, M., Mesirov, J. P., + & Tamayo, P. (2015). The Molecular Signatures Database (MSigDB) hallmark + gene set collection. Cell systems, 1(6), 417–425. + https://doi.org/10.1016/j.cels.2015.12.004

    -
    +
    + +
    -
    +
    + diff --git a/sitemap.xml b/sitemap.xml index 2824c75..2e10555 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1,84 +1,192 @@ - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/404.html + /404.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/LICENSE-text.html + /LICENSE-text.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/LICENSE.html + /LICENSE.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/authors.html + /articles/ADIPOCYTE_SIZE_STATS.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/index.html + /articles/ANALYTES_STATS.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/ADIPOCYTE_SIZE.html + /articles/FGSEA_heatmaps.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/ADIPOCYTE_SIZE_STATS.html + /articles/KSEA_heatmaps.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/GO_FGSEA.html + /articles/MAIN_FGSEA.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/METAB_EXP.html + /articles/METAB_TAG_heatmap.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/METAB_FGSEA.html + /articles/MitoCarta_FGSEA_heatmaps.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/METAB_TG_CONC.html + /articles/PHENO_WAT_STATS.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/MITO_DNA.html + /articles/PHOSPHO_KSEA.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/MotrpacRatTraining6moWATData-package.html + /articles/PROT_MITOCARTA_FGSEA.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/PHOSPHO_EXP.html + /articles/WAT_DA.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/PHOSPHO_KSEA.html + /articles/WAT_WGCNA.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/PLASMA_ANALYTES.html + /articles/WGCNA_METAB_module_heatmaps.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/PLASMA_ANALYTE_STATS.html + /articles/WGCNA_MODULE_ORA.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/PROT_EXP.html + /articles/WGCNA_correlation_heatmaps.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/PROT_MITOCARTA_FGSEA.html + /articles/WGCNA_eigenfeature_plots.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/PSP_KINASE_SUBSTRATE.html + /articles/WGCNA_module_ORA.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/TRNSCRPT_EXP.html + /articles/index.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/WATSC_DA.html + /articles/limma_diagnostics.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/WATSC_PHENO.html + /articles/lipid_regulatory_proteins_heatmap.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/WATSC_WGCNA.html + /articles/plot_FGSEA_male_vs_female_summary.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/index.html + /articles/plot_Hk2.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/module_ORA.html + /articles/plot_TAG_chain_length_vs_logFC.html - https://pnnl-comp-mass-spec.github.io/MotrpacRatTraining6moWATData/reference/msigdb_pathways.html + /articles/plot_UpSet.html + + + /articles/plot_adipocyte_size_distribution.html + + + /articles/plot_analytes.html + + + /articles/plot_mito_reads_and_cardiolipin.html + + + /articles/plot_mtDNA.html + + + /articles/plot_pct_fat_vs_leptin.html + + + /articles/plot_pre_post.html + + + /articles/plot_proteins.html + + + /articles/volcano_plots.html + + + /authors.html + + + /index.html + + + /news/index.html + + + /reference/ADIPOCYTE_SIZE.html + + + /reference/ADIPOCYTE_SIZE_STATS.html + + + /reference/ANALYTES.html + + + /reference/ANALYTES_EMM.html + + + /reference/ANALYTES_STATS.html + + + /reference/GO_FGSEA.html + + + /reference/METAB_EXP.html + + + /reference/METAB_FGSEA.html + + + /reference/METAB_TG_CONC.html + + + /reference/MITOCARTA_HS.html + + + /reference/MITO_DNA.html + + + /reference/MotrpacRatTraining6moWATData-package.html + + + /reference/PHENO_WAT.html + + + /reference/PHENO_WAT_STATS.html + + + /reference/PHOSPHO_EXP.html + + + /reference/PHOSPHO_KSEA.html + + + /reference/PROT_EXP.html + + + /reference/PROT_MITOCARTA_FGSEA.html + + + /reference/PSP_KINASE_SUBSTRATE.html + + + /reference/TRNSCRPT_EXP.html + + + /reference/WAT_DA.html + + + /reference/WAT_WGCNA.html + + + /reference/index.html + + + /reference/module_ORA.html + + + /reference/msigdb_pathways.html