MAGIC: A diffusion-based imputation method reveals gene-gene interactions in single-cell RNA-sequencing data

David van Dijk, Juozas Nainys, Roshan Sharma, Pooja Kaithail, Ambrose Carr, Kevin R. Moon, Linas Mažutis, Guy Wolf, Smita Krishnaswamy, Dana Pe’erbioRxiv 2017

Abstract

Single-cell RNA-sequencing (scRNA-seq) is revolutionizing biological discovery by measuring thousands of genes at single-cell resolution. However, these technologies suffer from significant technical noise, most notably "dropout" due to inefficient mRNA capture. This results in highly sparse data, typically with only ~10% non-zero values, which obscures gene regulatory networks and developmental trajectories. To address this, we developed MAGIC (Markov Affinity-based Graph Imputation of Cells), a method for imputing missing values and restoring data structure. MAGIC restores complex, non-linear gene interactions and trajectories in various biological systems, including mouse retinal bipolar cells, hematopoiesis, and epithelial-to-mesenchymal transition (EMT) datasets.

Introduction: The Challenge of Dropout

While scRNA-seq allows researchers to examine the gene expression of thousands of individual cells simultaneously, the technology has a major technical hurdle: dropout. Because the process of capturing mRNA from a single cell is inefficient, researchers typically detect only 5–15% of the transcripts actually present. This results in sparse data matrices filled with zeros that do not necessarily represent a true absence of expression. This noise makes it difficult to identify gene correlations or track how cells transition between states, such as a stem cell differentiating into a specialized blood cell.

The MAGIC Method

MAGIC treats the dataset as a graph where each node is a cell and edges represent similarity. The algorithm restores the underlying biological signal through a three-step process:

  1. Graph Construction: After normalization and Principal Component Analysis (PCA), MAGIC calculates distances between cells and converts them into an affinity matrix using an adaptive Gaussian kernel. This adaptive approach is critical; it adjusts the kernel width based on local cell density, preventing rare cell types from being overwhelmed by more common populations.
  2. Data Diffusion: The affinity matrix is converted into a Markov transition matrix. By raising this matrix to the power $t$ (the diffusion time), the algorithm simulates a random walk across the data. This process aggregates local similarities into a global "manifold" structure, effectively filling in the gaps in the data.
  3. Imputation: The original data is multiplied by this powered transition matrix. Essentially, a cell’s missing gene values are replaced by a weighted average of the values in its neighboring (similar) cells.

To quantify the effectiveness of this restoration, the authors also developed kNN-DREMI, a shape-agnostic metric capable of measuring non-linear relationships that standard Pearson correlations often miss.

Validation and Biological Insights

The authors validated MAGIC across several diverse contexts, ranging from synthetic models to complex biological systems:

  • Synthetic and Ground Truth Data: Using a "Swiss roll" manifold and C. elegans developmental data (artificially subjected to dropout), MAGIC demonstrated the ability to restore known values and shapes. In tests with 90% dropout, MAGIC improved the correlation ($R^2$) between the ground truth and observed data from 0.07 to 0.43.
  • Epithelial-to-Mesenchymal Transition (EMT): In a newly generated dataset of ~7,500 human breast cancer cells induced by TGF-β, the classic inverse relationship between E-cadherin (an epithelial marker) and Vimentin (a mesenchymal marker) was invisible in the raw data but clearly restored after MAGIC imputation.
  • Hematopoiesis and Development: In mouse bone marrow data, MAGIC revealed a continuous developmental arc, showing the clear differentiation of progenitor cells into erythroid or myeloid lineages. In retinal bipolar cells, MAGIC maintained distinct cell sub-types (achieving a Rand index of 0.93) while enhancing cluster-specific gene signals.

Discussion: The Manifold Hypothesis

The success of MAGIC relies on the Manifold Hypothesis: the idea that biological data is not random but follows structured paths constrained by underlying biological processes. Diffusion acts as a low-pass filter, removing high-frequency technical noise (dropout) while preserving the low-frequency biological signal (the trajectory). By sharing information across similar cells, MAGIC allows the true expression levels to emerge even when individual cells are missing specific transcripts.

Limitations

Despite its power, MAGIC requires careful parameter tuning. The choice of diffusion time $t$ is critical; if $t$ is too large, the data may "over-smooth," eventually collapsing distinct biological variations into a single point. Additionally, while MAGIC effectively removes technical noise, it may also remove some degree of true stochastic biological variation. Future work involves refining the heuristics for selecting optimal diffusion parameters to ensure biological features are preserved without introducing artifacts.

Summary updated

BibTeX
@misc{dijk2017magic,
  author = {David van Dijk and Juozas Nainys and Roshan Sharma and Pooja Kaithail and Ambrose Carr and Kevin R. Moon and Linas Mažutis and Guy Wolf and Smita Krishnaswamy and Dana Pe’er},
  title = {{MAGIC: A diffusion-based imputation method reveals gene-gene interactions in single-cell RNA-sequencing data}},
  year = {2017},
  doi = {10.1101/111591},
  howpublished = {bioRxiv},
}
Figure