22  Supervised integration

In the previous chapter (Chapter 21), we integrated omic layers without using any information on the outcome. The aim was to find the main shared patterns of variation in the data. In supervised integration, the outcome, such as disease status or a treatment group, guides the analysis. The aim is to combine information from multiple omic layers to predict or classify the outcome, and to identify the features that contribute to the prediction.

Supervised integration builds on the concepts of machine learning (see the machine learning chapter in OMA extras). However, combining multiple omic layers brings additional challenges, as discussed in Introduction to multi-omics. For instance, the layers can differ in their scale, distribution, and number of features.

This chapter introduces two approaches for supervised integration: IntegratedLearner and DIABLO. IntegratedLearner works directly with MultiAssayExperiment data containers (Ramos et al. 2017), and we show a complete workflow with it. DIABLO does not yet support MultiAssayExperiment, so we describe the ideas behind it and point to further resources.

Software for the integration of multiomics experiments in Bioconductor. Ramos et al. (2017). Cancer Res. doi:10.1158/0008-5472.CAN-17-0344.

22.1 IntegratedLearner

IntegratedLearner is a framework for multi-omics prediction and classification (Mallick et al. 2024), available in the IntegratedLearner package. It builds on the SuperLearner package (van der Laan et al. 2007), which allows a wide range of machine learning algorithms to be used as the underlying models. IntegratedLearner supports early, late and intermediate fusion.

An integrated Bayesian framework for multi-omics prediction and classification. Mallick et al. (2024). Stat Med 43:983–1002. doi:10.1002/sim.9953.
Super learner. van der Laan et al. (2007). Stat Appl Genet Mol Biol 6:Article 25. doi:https://doi.org/10.2202/1544-6115.1309.

22.1.1 Fusion strategies

Multi-omic data can be combined in a predictive model at different stages. These strategies are often referred to as fusion strategies (Figure 22.1):

  • Early fusion combines all omic layers into a single table, for example, by concatenating the features. A single model is then trained on the combined table. The approach is simple, but the layers with the most features can dominate the model, and the differences between the layers are ignored.

  • Late fusion trains a separate model, i.e., a base learner, for each omic layer. The predictions of these models are then combined with a second-level model, i.e., a meta learner, which produces the final prediction. This approach is also known as stacking (Wolpert 1992). Each layer is modeled on its own terms, but interactions between the layers are not taken into account.

  • Intermediate fusion integrates the layers during the model fitting. For example, cooperative learning (Ding et al. 2022) encourages the predictions from different omic layers to agree with each other, which allows the model to exploit information shared between the layers.

Stacked generalization. Wolpert (1992). Neural Netw 5:241–259. doi:10.1016/S0893-6080(05)80023-1.
Cooperative learning for multiview analysis. Ding et al. (2022). Proc Natl Acad Sci USA 119:e2202113119. doi:https://doi.org/10.1073/pnas.2202113119.
flowchart LR
    subgraph early["Early fusion"]
        direction TB
        e1["Omic 1"] & e2["Omic 2"] --> ec["Combined<br/>table"] --> em["Model"] --> ep(["Prediction"])
    end
    subgraph late["Late fusion"]
        direction TB
        l1["Omic 1"] --> b1["Base<br/>learner"]
        l2["Omic 2"] --> b2["Base<br/>learner"]
        b1 & b2 --> meta["Meta<br/>learner"] --> lp(["Prediction"])
    end
    subgraph inter["Intermediate fusion"]
        direction TB
        i1["Omic 1"] & i2["Omic 2"] --> im["Joint model,<br/>layers agree"] --> ip(["Prediction"])
    end
    early ~~~ late ~~~ inter
    classDef omic fill:#ffffff,stroke:#6c757d,color:#070707
    classDef model fill:#e6f3f7,stroke:#0087af,color:#070707
    class e1,e2,l1,l2,i1,i2 omic
    class ec,em,b1,b2,meta,im model
Figure 22.1: Fusion strategies for combining omic layers in a predictive model. Early fusion concatenates the layers before modeling, late fusion combines the predictions of layer-specific base learners with a meta learner, and intermediate fusion models the layers jointly.

22.1.2 Preparing the data

We use the Inflammatory Bowel Diseases (IBD) data from the Human Microbiome Project 2 (Lloyd-Price et al. 2019), which is available in the curatedMetagenomicData package. The aim is to classify the samples into IBD patients and healthy controls based on two omic layers: the abundances of species (taxonomic profiles) and of metabolic pathways (functional profiles).

Multi-omics of the gut microbial ecosystem in inflammatory bowel diseases. Lloyd-Price et al. (2019). Nature 569:655–662. doi:https://doi.org/10.1038/s41586-019-1237-9.
library(curatedMetagenomicData)
library(dplyr)
library(mia)

# Select the samples of the study
samples <- sampleMetadata |>
    filter(study_name == "HMP_2019_ibdmdb")

# Species and pathway abundances
tse_species <- returnSamples(samples, "relative_abundance", rownames = "short")
tse_pathway <- returnSamples(samples, "pathway_abundance", rownames = "short")

# Create a MultiAssayExperiment
mae <- MultiAssayExperiment(
    ExperimentList(microbiota = tse_species, pathway = tse_pathway)
)
mae
##  A MultiAssayExperiment object of 2 listed
##   experiments with user-defined names and respective classes.
##   Containing an ExperimentList class object of length 2:
##   [1] microbiota: TreeSummarizedExperiment with 582 rows and 1627 columns
##   [2] pathway: SummarizedExperiment with 22113 rows and 1627 columns
##  Functionality:
##   experiments() - obtain the ExperimentList instance
##   colData() - the primary/phenotype DataFrame
##   sampleMap() - the sample coordination DataFrame
##   `$`, `[`, `[[` - extract colData columns, subset, or experiment
##   *Format() - convert into a long or wide DataFrame
##   assays() - convert ExperimentList to a SimpleList of matrices
##   exportClass() - save data to flat files

IntegratedLearner matches the samples across the experiments by their column names, so each experiment should contain the same samples. intersectColumns() keeps only the samples that are found in all experiments.

mae <- intersectColumns(mae)

Next, we check how the samples are divided between the groups.

table(mae[["microbiota"]]$disease)
##  
##      IBD healthy 
##     1201     426

The groups are of different sizes. With imbalanced groups, a model can achieve a high accuracy just by predicting the larger group, which should be taken into account when the performance of the model is assessed.

The pathway table contains, in addition to the abundances of the pathways, the abundances that HUMAnN could not assign to any pathway (UNMAPPED and UNINTEGRATED), and the pathway abundances divided between the species that contribute to them (rows with | in their name). We keep only the abundances of the pathways.

pathways <- rownames(mae[["pathway"]])
keep <- !grepl("\\|", pathways) & !pathways %in% c("UNMAPPED", "UNINTEGRATED")
mae[["pathway"]] <- mae[["pathway"]][keep, ]

Microbiome data contains many rare features. We keep only the features that are present in at least 10% of the samples (see Section 8.6) and that vary between the samples, that is, have a standard deviation over zero. Finally, we apply the CLR transformation to both layers (see Chapter 10).

# Keep prevalent features that vary between samples
mae[["microbiota"]] <- addPrevalence(
    mae[["microbiota"]], assay.type = "relative_abundance")
mae[["microbiota"]] <- addQC(
    mae[["microbiota"]], assay.type = "relative_abundance", by = "rows")
mae[["microbiota"]] <- subsetBy(
    mae[["microbiota"]],
    rows = prevalence >= 0.1 & sd > 0
)
mae[["pathway"]] <- addPrevalence(
    mae[["pathway"]], assay.type = "pathway_abundance")
mae[["pathway"]] <- addQC(
    mae[["pathway"]], assay.type = "pathway_abundance", by = "rows")
mae[["pathway"]] <- subsetBy(
    mae[["pathway"]],
    rows = prevalence >= 0.1 & sd > 0
)

# Apply CLR transformation
mae[["microbiota"]] <- transformAssay(
    mae[["microbiota"]],
    assay.type = "relative_abundance", method = "clr", pseudocount = TRUE
)
mae[["pathway"]] <- transformAssay(
    mae[["pathway"]],
    assay.type = "pathway_abundance", method = "clr", pseudocount = TRUE
)

After the filtering, the data contains 124 species and 358 pathways.

The data includes several samples from each subject. To estimate how well the model generalizes to new subjects, we select 20% of the subjects for a validation set, which is not used in training. All samples of a subject are placed in the same set.

set.seed(377)

# Subject of each sample
subject <- mae[["microbiota"]]$subject_id
names(subject) <- colnames(mae[["microbiota"]])

# Select 20% of the subjects for validation
subjects <- unique(subject)
valid_subjects <- sample(subjects, round(0.2 * length(subjects)))

# Match the samples in the order of the MultiAssayExperiment
is_valid <- subject[rownames(colData(mae))] %in% valid_subjects

# Split the data
mae_train <- mae[, !is_valid, ]
mae_valid <- mae[, is_valid, ]

22.1.3 Fitting the model

We fit the model with IntegratedLearner(). First, a base learner is trained for each omic layer separately. Then, a meta learner combines the predictions of the base learners into the final prediction. We use random forest ("SL.randomForest") as the base learner and rank loss minimization ("sl_nnls_auc") as the meta learner. The outcome is binary, so we use the binomial family.

library(IntegratedLearner)
library(SuperLearner)

fit <- IntegratedLearner(
    MAE_train = mae_train,
    MAE_valid = mae_valid,
    # Experiments and assays
    experiment = c("microbiota", "pathway"),
    assay.type = c("clr", "clr"),
    # Columns of the sample metadata
    outcome_col = "disease",
    subject_id_col = "subject_id",
    # Base and meta learners
    base_learner = "SL.randomForest",
    meta_learner = "sl_nnls_auc",
    # Binary outcome
    family = binomial()
)

The result includes the following models:

  • Individual models (microbiota and pathway) are trained separately for each omic layer.
  • The stacked model (late fusion) combines the predictions of the individual models with the meta learner.
  • The concatenated model (early fusion) is trained on all features of the layers combined.

22.1.4 Model performance

The performance of the models can be visualized with Receiver Operating Characteristic (ROC) curves (Figure 22.2). The curve shows the true positive rate against the false positive rate at different classification thresholds. The area under the curve (AUC) summarizes the performance: an AUC of 1 means a perfect classification, and an AUC of 0.5 a classification that is no better than chance. The upper panel shows the performance in the cross-validation of the training data, and the lower panel in the independent validation set.

p <- plot(fit)
p$plot
Two panels of ROC curves, cross-validation on top and independent validation below. Each panel has the false positive rate on the x-axis and the true positive rate on the y-axis, with one curve per model: microbiota, pathway, stacked and concatenated.
Figure 22.2: ROC curves of the IntegratedLearner models that classify the samples of the HMP2 IBD data into IBD patients and healthy controls. Panel A shows the performance in five-fold cross-validation of the training data and panel B in the independent validation set, for the models based on species, on pathways, and on both layers with late fusion (stacked) and early fusion (concatenated).

The AUC, the accuracy and the balanced accuracy of each model in the validation set are stored in the result. The balanced accuracy is the average of the accuracies within each group, so it is not affected by the imbalance of the groups.

fit$metrics.test
##           model   auc accuracy balanced_accuracy
##  1   microbiota 0.599   0.5949            0.5138
##  2      pathway 0.581   0.6289            0.5410
##  3      stacked 0.606   0.5892            0.5044
##  4 concatenated 0.621   0.6346            0.5538

22.1.5 Feature importance

To identify the features that contribute most to the prediction, we take the importance scores of the features from the random forest models of the individual layers. We then scale them by the weight that each layer has in the stacked model, which gives the importance of each feature in the final model (Figure 22.3).

library(miaViz)

# Feature importances of each layer, scaled by the weight of the layer
layers <- fit$model_fits$model_layers
importance <- rbind(
    layers[["microbiota"]]$importance * fit$weights[["microbiota"]],
    layers[["pathway"]]$importance * fit$weights[["pathway"]]
)

plotLoadings(importance, ncomponents = 1, n = 20, show.color = FALSE)
Lollipop plot of the 20 features with the highest importance in the stacked model, with the features on the y-axis and the scaled importance on the x-axis.
Figure 22.3: The 20 most important features of the stacked IntegratedLearner model of the HMP2 IBD data. The importance of each feature is its random forest importance (mean decrease in Gini impurity) scaled by the weight of its omic layer in the stacked model.

More details on modeling with IntegratedLearner, including intermediate fusion and other types of outcomes, can be found in the IntegratedLearner vignette.

22.2 DIABLO

DIABLO (Data Integration Analysis for Biomarker Discovery using Latent Variable Approaches for Omics Studies) is a supervised integration method implemented in the mixOmics package (Rohart et al. 2017; Singh et al. 2019). It extends sparse partial least squares discriminant analysis (sPLS-DA) (Lê Cao et al. 2011) to multiple omic layers. DIABLO identifies correlated features across the layers that discriminate between the outcome groups.

mixOmics: An R package for ’omics feature selection and multiple data integration. Rohart et al. (2017). PLoS Comput Biol 13:e1005752. doi:10.1371/journal.pcbi.1005752.
DIABLO: An integrative approach for identifying key molecular drivers from multi-omics assays. Singh et al. (2019). Bioinformatics 35:3055–3062. doi:10.1093/bioinformatics/bty1054.
Sparse PLS discriminant analysis: Biologically relevant feature selection and graphical displays for multiclass problems. Lê Cao et al. (2011). BMC Bioinformatics 12:253. doi:10.1186/1471-2105-12-253.

DIABLO does not yet support MultiAssayExperiment data containers. More information and examples can be found in the DIABLO manual and the mixOmics Bioconductor page.

22.3 Exercises

We use the HMP2 IBD data from curatedMetagenomicData, as in this chapter.

Solve the exercises in order, as each exercise continues from the previous one. Try to solve each exercise yourself before opening the solution.

Exercise 1: Fusion strategies

Goal: Explain how the fusion strategies combine the omic layers.

Answer the following questions without writing any code. The section Section 22.1 will help you.

  1. How do early and late fusion differ?

  2. In early fusion, one omic layer has 1000 features and another 50 features. Why can this be a problem?

  3. In the stacked model, the meta learner gives a weight to each omic layer. What does a large weight tell about the layer?

  4. Why are all samples of a subject placed either in the training set or in the validation set?

  1. Early fusion combines the omic layers into a single table before modeling, and a single model is trained on it. Late fusion trains a separate model for each layer and combines their predictions with a meta learner.

  2. The layer with more features can dominate the model, and the smaller layer has little influence on the prediction, even if it is informative.

  3. The predictions based on that layer contribute much to the final prediction of the stacked model.

  4. The samples of the same subject are similar to each other. If they were in both sets, the model would be validated partly on subjects that it has already seen, and the performance would be overestimated for new subjects.

Exercise 2: Use another base learner

Goal: Fit a model with IntegratedLearner and compare the performance of models.

  1. Prepare and split the data as in this chapter, so that you have the objects mae_train and mae_valid.

  2. Fit a model with IntegratedLearner() as in this chapter, but use lasso regression ("SL.glmnet") as the base learner. Store the result in a variable called fit_lasso.

  3. Visualize the ROC curves of fit_lasso.

  4. Show the performance metrics of fit_lasso in the validation set, and compare them to those of the random forest model of this chapter.

  5. Why is the balanced accuracy a better measure than the accuracy for these data?

Useful functions: IntegratedLearner::IntegratedLearner(), plot()

# 2. Fit a model with lasso as the base learner
fit_lasso <- IntegratedLearner(
    MAE_train = mae_train,
    MAE_valid = mae_valid,
    experiment = c("microbiota", "pathway"),
    assay.type = c("clr", "clr"),
    outcome_col = "disease",
    subject_id_col = "subject_id",
    base_learner = "SL.glmnet",
    meta_learner = "sl_nnls_auc",
    family = binomial()
)

# 3. ROC curves
p <- plot(fit_lasso)
p$plot


# 4. Performance metrics of both models
fit_lasso$metrics.test
##           model   auc accuracy balanced_accuracy
##  1   microbiota 0.463   0.5439            0.4792
##  2      pathway 0.551   0.5722            0.5098
##  3      stacked 0.542   0.5637            0.4957
##  4 concatenated 0.433   0.5552            0.4967
fit$metrics.test
##           model   auc accuracy balanced_accuracy
##  1   microbiota 0.599   0.5949            0.5138
##  2      pathway 0.581   0.6289            0.5410
##  3      stacked 0.606   0.5892            0.5044
##  4 concatenated 0.621   0.6346            0.5538
  1. Most samples are from IBD patients. A model that predicts IBD for all samples has a high accuracy, although it does not separate the groups at all. The balanced accuracy averages the accuracies within each group, so it is not affected by the sizes of the groups.
Back to top