Exploring patterns enriched in a dataset with contrastive principal component analysis

Abubakar Abid, Martin Jinye Zhang, Vivek Bagaria, James ZouNature Communications 2018 · DOI

TL;DR

This paper introduces Contrastive Principal Component Analysis (cPCA), a novel method for visualizing patterns specific to a "target" dataset by contrasting it with a "background" dataset. cPCA effectively uncovers dataset-specific structures that standard PCA often misses, making it a powerful tool for exploratory data analysis in diverse fields.

What Problem Does This Paper Address?

Exploring and visualizing high-dimensional data is a common challenge across many scientific disciplines. Principal Component Analysis (PCA) is a widely used technique for this purpose, aiming to identify the dominant trends within a single dataset. However, a significant limitation arises when researchers have multiple datasets or data collected under different conditions (e.g., treatment vs. control, healthy vs. diseased). In such scenarios, the goal is often to find patterns that are unique to one dataset, rather than just the overall dominant trends. Current practice involves applying PCA (or similar methods) to each dataset separately and then manually comparing the results, which can be cumbersome and may miss subtle, dataset-specific patterns. This paper addresses this gap by proposing a method that can automatically identify and visualize these enriched patterns by leveraging a comparison dataset.

Methods

The core contribution of this paper is the development of Contrastive Principal Component Analysis (cPCA). Unlike standard PCA, which seeks directions of maximum variance in a single dataset, cPCA aims to find directions that maximize variance in a "target" dataset while simultaneously minimizing variance in a "background" dataset.

The method works by:

  1. Computing Covariance Matrices: Calculate the empirical covariance matrices ($C_x$ for the target dataset and $C_y$ for the background dataset).
  2. Optimizing a Contrastive Objective: cPCA finds directions ($v$) that maximize the objective function $v^T(C_x - \alpha C_y)v$, where $\alpha$ is a contrast parameter. This parameter controls the trade-off between maximizing variance in the target data and minimizing it in the background data.
  3. Eigenvalue Decomposition: The optimal directions (contrastive principal components or cPCs) are the eigenvectors of the matrix $(C_x - \alpha C_y)$.
  4. Subspace Selection: Instead of relying on a single $\alpha$, cPCA computes subspaces for a range of $\alpha$ values. These subspaces are then clustered, and representative ones are selected to reveal different trends.

This approach is fundamentally unsupervised and aims to highlight variations specific to the target dataset, rather than discriminating between the target and background datasets directly.

Datasets

The paper evaluates cPCA on several datasets:

  • Synthetic Noisy Digits: A dataset created by superimposing handwritten digits (0 and 1) onto images of grass. This dataset was used to demonstrate cPCA's ability to separate patterns (digits) from background noise (grass).
  • Mice Protein Expression Data: A dataset of protein expression measurements from mice with and without Down Syndrome (DS). This dataset was used to show cPCA's effectiveness in discovering subgroups (DS vs. non-DS) that were not apparent with standard PCA.
  • Single-cell RNA-Seq Data: Two datasets were used:
  • From a leukemia patient before and after stem-cell transplant.
  • Augmented with samples from a second leukemia patient, also before and after transplant. These datasets were used to visualize differences between cell populations and treatment effects.

  • Mexican Ancestry Genetic Data: SNP data from individuals across five Mexican states. This dataset was used to demonstrate cPCA's ability to reveal geographically relevant ancestry patterns that standard PCA failed to capture due to dominant European/Native American heritage variations.

The paper does not introduce new benchmark datasets but rather uses publicly available datasets or those from prior studies to showcase cPCA's utility.

Key Insights and Ideas

  • Beyond Dominant Trends: The most significant insight is that cPCA moves beyond identifying the overall dominant trends in a dataset (as PCA does) to specifically highlighting trends that are enriched in one dataset relative to another. This is crucial for comparative analyses.
  • The Power of Contrast: By explicitly using a "background" dataset, cPCA acts as a form of "noise cancellation" for variations that are common to both datasets, thereby amplifying the unique signals in the target dataset.
  • Unsupervised Subgroup Discovery: cPCA offers a powerful unsupervised approach to discover hidden subgroups or variations within data, even when these subgroups are not pre-labeled. This is demonstrated effectively in the biological datasets.
  • Geometric Interpretation: The paper provides a clear geometric interpretation of cPCA, relating it to finding directions that lie on the "Pareto frontier" of target vs. background variance. This offers a deeper understanding of why it works.
  • Generality and Ease of Use: cPCA is presented as a general-purpose tool, computationally efficient (similar to PCA), and applicable to a wide range of problems where comparative visualization is needed.

Key Results

  • Noisy Digits: cPCA successfully separated images of digits 0 and 1, which were indistinguishable using standard PCA due to background noise.
  • Mice Protein Expression: cPCA clearly clustered mice with and without Down Syndrome, a distinction missed by PCA.
  • Single-cell RNA-Seq: cPCA effectively separated cell samples from different time points (pre/post-transplant) and patients, revealing more distinct clusters than PCA.
  • Mexican Ancestry: cPCA revealed geographically meaningful clusters of Mexican ancestry groups, which standard PCA failed to do due to confounding global ancestry variations.
  • Theoretical Guarantees: The paper provides mathematical guarantees for cPCA, showing its convergence rates are comparable to standard PCA.

Limitations and Future Work

  • Parameter $\alpha$: While an automatic scheme for selecting the contrast parameter $\alpha$ is provided, users can also manually tune it for more fine-grained exploration. The paper suggests that the default automatic selection is sufficient for many applications.
  • Hypothesis Testing: Like PCA, cPCA is an exploratory tool and does not provide statistical significance quantifications (p-values). Discovered patterns require validation through hypothesis testing or further analysis.
  • Kernelization: The paper mentions that cPCA can be kernelized to uncover nonlinear contrastive patterns, suggesting a promising avenue for future work.
  • Domain-Specific Tools: The authors acknowledge that for specific domains, expert-crafted algorithms might outperform cPCA, but cPCA offers a general and accessible alternative.

Summary updated

Abstract

Visualization and exploration of high-dimensional data is a ubiquitous challenge across disciplines. Widely used techniques such as principal component analysis (PCA) aim to identify dominant trends in one dataset. However, in many settings we have datasets collected under different conditions, e.g., a treatment and a control experiment, and we are interested in visualizing and exploring patterns that are specific to one dataset. This paper proposes a method, contrastive principal component analysis (cPCA), which identifies low-dimensional structures that are enriched in a dataset relative to comparison data. In a wide variety of experiments, we demonstrate that cPCA with a background dataset enables us to visualize dataset-specific patterns missed by PCA and other standard methods. We further provide a geometric interpretation of cPCA and strong mathematical guarantees. An implementation of cPCA is publicly available, and can be used for exploratory data analysis in many applications where PCA is currently used.
BibTeX
@inproceedings{abid2018exploring,
  author = {Abubakar Abid and Martin Jinye Zhang and Vivek Bagaria and James Zou},
  title = {{Exploring patterns enriched in a dataset with contrastive principal component analysis}},
  booktitle = {Nature Communications},
  year = {2018},
  doi = {10.1038/s41467-018-04608-8},
}

Loading related content...

Figure