TwinPurify: Purifying gene expression data to reveal tumor-intrinsic transcriptional programs via self-supervised learning
Zhiwei Zheng, Kevin Bryson
TL;DR
Tumor purity variation in bulk transcriptomics obscures tumor-intrinsic programs and hinders molecular discovery. TwinPurify introduces a external-reference-free, self-supervised framework based on a Barlow Twins objective that uses adjacent-normal tissue as structured perturbations to disentangle tumor signals, yielding purified embeddings. Across three large breast cancer cohorts and multiple platforms, TwinPurify outperforms reconstruction-based baselines in recovering tumor-intrinsic and immune signals, improves molecular subtyping and histological grading, and enhances survival-prediction using embedding-derived gene sets. The approach reveals interpretable, orthogonal transcriptional axes tied to immune and cell cycle programs, providing a scalable and transferable tool for reusing bulk data in precision oncology.
Abstract
Advances in single-cell and spatial transcriptomic technologies have transformed tumor ecosystem profiling at cellular resolution. However, large scale studies on patient cohorts continue to rely on bulk transcriptomic data, where variation in tumor purity obscures tumor-intrinsic transcriptional signals and constrains downstream discovery. Many deconvolution methods report strong performance on synthetic bulk mixtures but fail to generalize to real patient cohorts because of unmodeled biological and technical variation. Here, we introduce TwinPurify, a representation learning framework that adapts the Barlow Twins self-supervised objective, representing a fundamental departure from the deconvolution paradigm. Rather than resolving the bulk mixture into discrete cell-type fractions, TwinPurify instead learns continuous, high-dimensional tumor embeddings by leveraging adjacent-normal profiles within the same cohort as "background" guidance, enabling the disentanglement of tumor-specific signals without relying on any external reference. Benchmarked against multiple large cancer cohorts across RNA-seq and microarray platforms, TwinPurify outperforms conventional representation learning baselines like auto-encoders in recovering tumor-intrinsic and immune signals. The purified embeddings improve molecular subtype and grade classification, enhance survival model concordance, and uncover biologically meaningful pathway activities compared to raw bulk profiles. By providing a transferable framework for decontaminating bulk transcriptomics, TwinPurify extends the utility of existing clinical datasets for molecular discovery.
