Multi-omics integration with matched samples and balanced blocks

Practical 21: Genomics, systems biology and multi-omics

Learning objectives

Align layers; compare unit scaling and block weighting; inspect a joint representation; distinguish shared latent variation from independent confirmation.

Biological question and data

What changes when protein and metabolite layers are integrated rather than inspected separately?

The 48 animals have complete matched log2 measurements in these two layers. A shared latent factor was deliberately used to generate them. PCA is descriptive; its full-sample transformation is not used as a prediction evaluation.

No biological download is required. Numerical inputs are hypothetical, not observed animal data. The runnable examples use base R. Count and abundance units are specified where used.

1. Align layers before integration

Keep biological IDs visible and check them against metadata.

Show R code
helper_dir <- if (dir.exists("R")) "R" else "../R"
stopifnot(file.exists(file.path(helper_dir,"teaching_data.R")))
source(file.path(helper_dir,"teaching_data.R"))
d <- teaching_data()
P <- t(d$protein);M <- t(d$metabolite)
stopifnot(identical(rownames(P),d$metadata$animal),identical(rownames(P),rownames(M)))
c(protein_features=ncol(P),metabolite_features=ncol(M),animals=nrow(P))
   protein_features metabolite_features             animals 
                  8                   6                  48 

An assay match requires the right animal and sampling context, not just equal matrix dimensions.

2. Scale features and weight blocks

Standardize each feature. Then divide each block by the square root of its feature count so its total marginal variance is one.

Show R code
ZP <- scale(P);ZM <- scale(M)
balanced <- cbind(ZP/sqrt(ncol(P)),ZM/sqrt(ncol(M)))
c(protein_total_variance=sum(apply(ZP/sqrt(ncol(P)),2,var)),
 metabolite_total_variance=sum(apply(ZM/sqrt(ncol(M)),2,var)))
   protein_total_variance metabolite_total_variance 
                        1                         1 
Show R code
stopifnot(abs(sum(apply(ZP/sqrt(ncol(P)),2,var))-1)<1e-12,
 abs(sum(apply(ZM/sqrt(ncol(M)),2,var))-1)<1e-12)
fit <- prcomp(balanced,center=FALSE,scale.=FALSE)
head(fit$sdev^2/sum(fit$sdev^2))
[1] 0.57637485 0.07750314 0.07220047 0.05527056 0.04574651 0.03833449

Equal total marginal variance is a specified weighting choice. It does not assert equal information, independence or biological importance.

3. Inspect the representation and shared association

Label scores by the biological design and calculate one paired cross-layer association.

Show R code
plot(fit$x[,1],fit$x[,2],col=as.integer(d$metadata$diet),pch=19,
 xlab="Joint PC1",ylab="Joint PC2")
legend("topleft",levels(d$metadata$diet),col=1:2,pch=19,bty="n")

Show R code
c(cross_layer_correlation=cor(P[,1],M[,1]))
cross_layer_correlation 
              0.2367859 

The panels can agree because they share the same generating driver. In actual data, biological and technical common causes both need examination.

4. Demonstrate redundant feature influence

Duplicating a feature changes an unweighted joint representation without adding another biological observation. Use an independent small matrix to isolate the effect.

Show R code
set.seed(2102)
small <- cbind(shared=rnorm(30),other=rnorm(30))
duplicated <- cbind(small,small[,1],small[,1])
fraction <- function(x) {
 fit <- prcomp(x,scale.=TRUE)
 fit$sdev[1]^2/sum(fit$sdev^2)
}
c(original_PC1=fraction(small),duplicated_PC1=fraction(duplicated))
  original_PC1 duplicated_PC1 
     0.5107942      0.7501747 

5. Assess the biological representation

A joint component describes covariance under the selected features, transformations and weights. Inspect its loadings, score relationships with design factors and sensitivity to leaving out one layer. A shared pattern can reflect common biology or batch.

Before using the representation for prediction, fit scaling and representation within training and apply it to test observations. Missing whole assays require an explicit strategy; using only complete animals changes the represented population. More layers are helpful when they add relevant information, not because concatenation itself creates independent confirmation.

Interpretation challenge

Does equal total block variance guarantee equal biological contribution?

No. It balances a numerical quantity. Reliability, redundancy, covariance and relevance to the task can differ substantially between blocks.

Interpretation and limits

Concatenation is one integration strategy, not a universal method. Unmatched samples, incompatible timing, missing layers and leakage need explicit handling. Do not interpret joint PCs as mechanisms or use full-sample scaling for an untouched predictive test.

Exercises

  1. What happens without the block weights?
  2. Does matching animal IDs establish matching tissue/time?
  3. Are correlated layers independent replications?
  1. The eight standardized protein features contribute more marginal variance than the six metabolite features.
  2. No; specimen metadata must confirm context.
  3. Not generally; shared samples, drivers and processing can create dependence.

Continue learning

B15 Integration, B02 Design and B12 Statistics.

Continue with integrated predictive analysis. Return to the practical index or the unified map.