Chapter 3 Applications

3.1 Application I: Individual-level data

The dataset used here consists of a total of 14 metabolites (N = 14) and two groups (Liyanage et al. 2024). The 12 samples in the two groups had been extracted using the same method in a controlled experiment but run separately in two different instruments: Liquid Chromatography-Mass Spectrometry (LC/MS) and Gas Chromatography-Mass Spectrometry (GC/MS), leading to two separate datasets. Thus, in this example, each separate dataset from each instrument forms a different ‘study’ (\(K = 2\)), which can be integrated using meta-analysis methods. We will use `MetaHD’ for combining summary estimates obtained from these multiple metabolomic studies.

This GC-LC dataset is available in the `MetaHD’ package and can be loaded using the following command.

# Read the data
GCLC_data <- realdata

As explained in Section 3.1 `MetaHDInput’ function can then be used to calculate the treatment effect sizes and their associated variances and within-study covariance matrices as shown below.

input_data <- MetaHDInput(GCLC_data)

Y <- input_data$Y
Slist <- input_data$Slist

Y
##               met1      met2       met3      met4        met5         met6
## study1 -0.08509765 0.0693374 0.21205246 0.1555140 -0.07131115 -0.010729262
## study2 -0.19103975 0.1985993 0.05266387 0.3042082 -0.08507508 -0.002200277
##               met7        met8        met9      met10      met11       met12
## study1 -0.06351313  0.07239534 -0.02854481 -0.1874413 0.07670815 -0.04170964
## study2 -0.02427915 -0.08497286 -0.10315078 -0.1196099 0.07105905  0.21213759
##            met13       met14
## study1 0.3378766 -0.20944830
## study2 0.2136121 -0.03345043
head(Slist[[1]])
##               met1         met2          met3         met4         met5
## met1  0.0194438538 0.0005017922 -0.0025219163 -0.002766591  0.004992537
## met2  0.0005017922 0.0161291933  0.0042058671  0.019843118  0.002535913
## met3 -0.0025219163 0.0042058671  0.0078052190  0.007030307 -0.001285968
## met4 -0.0027665912 0.0198431182  0.0070303073  0.074406890 -0.003247293
## met5  0.0049925375 0.0025359133 -0.0012859676 -0.003247293  0.007725915
## met6  0.0036952818 0.0035899796  0.0007582538  0.004244171  0.003155352
##              met6          met7          met8        met9        met10
## met1 0.0036952818  0.0036649961  0.0014738763 0.002466527  0.006057970
## met2 0.0035899796  0.0023004763  0.0009291760 0.003908964  0.001622693
## met3 0.0007582538 -0.0002967142  0.0010746462 0.001839553 -0.002939468
## met4 0.0042441714  0.0033677211  0.0053704235 0.004464203 -0.001121570
## met5 0.0031553517  0.0026034856 -0.0006582206 0.002925312  0.005845677
## met6 0.0035383608  0.0025416742  0.0003542152 0.003045991  0.003098343
##            met11        met12        met13        met14
## met1 0.003742686 0.0058389366 -0.017656900  0.006189749
## met2 0.006128897 0.0057661483 -0.015584915  0.002615291
## met3 0.002551313 0.0003375944  0.001663327 -0.001850528
## met4 0.005545238 0.0033374745 -0.012707585  0.001019416
## met5 0.004305489 0.0060072612 -0.020351263  0.004988612
## met6 0.003080440 0.0039539767 -0.012411644  0.003099160

When both within and between study correlations are set to zero, MetaHD reduces to the usual random effects model analysis of individual metabolites (i.e. univariate meta-analyses). Additionally, when the between-study variances are also set to zero, then MetaHD reduces to a fixed-effects model univariate meta-analysis. We can perform univariate random-effects and univariate fixed-effects meta-analysis in MetaHD as follows:

diag_Slist <- list()
K <- nrow(Y)
for (k in 1:K) {
  diag_Slist[[k]] <- diag(diag(Slist[[k]]))
}
# Univariate random-effects meta-analysis
model2 <- MetaHD(Y, diag_Slist, method = "reml", bscov = "diag")
model2$estimate
##  [1] -0.152812327  0.137090057  0.125448886  0.236485102 -0.079158201
##  [6] -0.003400281 -0.041614290 -0.005823006 -0.067093550 -0.145743651
## [11]  0.073429537  0.097636180  0.224770248 -0.115441898
model2$pVal
##  [1] 0.06809548 0.11762486 0.11412429 0.19892382 0.16958255 0.87887530
##  [7] 0.28159217 0.94100531 0.29722212 0.01244124 0.16187645 0.43956056
## [13] 0.00950358 0.18855174
# Univariate fixed-effects meta-analysis
model3 <- MetaHD(Y, diag_Slist, method = "fixed")
model3$estimate
##  [1] -0.152812327  0.137090057  0.119263841  0.236485102 -0.079158213
##  [6] -0.003400281 -0.041614290 -0.004927685 -0.067093550 -0.145743651
## [11]  0.073429398  0.139309196  0.224769883 -0.102735148
model3$pVal
##  [1] 0.068095484 0.117624861 0.036764299 0.198923825 0.169579632 0.878875296
##  [7] 0.281592165 0.914730005 0.297222122 0.012441239 0.161809425 0.011347289
## [13] 0.009502382 0.034970100

When missing data are available, we can use MetaHD to handle missing values by setting the argument “impute.na = TRUE”. This replaces the missing effect sizes and variances by zero and a large constant value respectively, so that the missing outcome is allocated a lower weight in the meta-analysis.

3.2 Application II: Summary-level data

In this example, we use a simulated dataset as described by (Liyanage et al. 2024). Here we have prepared separate data frames for effect- sizes and within-study covariance matrices in the ‘simdata.1’ dataset as follows..

Now, we can carry out the meta-analysis using MetaHD as follows.

Y <- simdata.1$Y #as.matrix(unname(Y1[[1]]))
Slist <- simdata.1$Slist

## Multivariate random-effects meta analyis
model_1 <- MetaHD(Y,
                  Slist,
                  method = "reml",
                  bscov = "unstructured")
model_1$estimate # TRUE VALUES ARE: 5, 1, 3, 2, 4, 2, 1, 1, 5, 1, 1, 5, 5, 2, 3, 5, 4, 5, 1, 1, 2, 5, 1, 2, 1, 5, 4, 1, 4, 2

References

Liyanage, Jayamini C, Luke Prendergast, Robert Staudte, and Alysha M De Livera. 2024. “MetaHD: A Multivariate Meta-Analysis Model for Metabolomics Data.” Bioinformatics 40 (7): btae470. https://doi.org/10.1093/bioinformatics/btae470.