As a result of the above limitations, reference-free methods, which do not rely on external reference data, have been proposed 2, 5 . We show that none of the current methods adequately controls for false positives, and we present a new method, reference-free adjustment for cell type composition (ReFACTor), to address the shortcomings of current methods. ReFACTor is based on a variant of PCA and can be applied to any tissue. PCA is a natural candidate for the correction of cell type heterogeneity, since the first several principal components (PCs) are correlated with cell type composition 6 . However, only a small number of sites (known as differentially methylated regions, or DMRs) differ significantly between cell types, and therefore using all the sites in PCA potentially reduces the correlation. Motivated by this observation, we designed ReFACTor to perform a PCA on a subset of the sites that are differentially methylated across the different cell types rather than on the entire set of CpG methylation sites. Specifically, ReFACTor selects the sites that can be reconstructed with low error using a low-rank approximation of the original methylation matrix. In contrast to other methods in which unsupervised site selection is performed based on the correlation between the site and the phenotype, ReFACTor does not use the phenotype in the selection process, making ReFACTor useful as part of a quality control step in EWAS. We evaluated the ability of ReFACTor to capture cell type composition using simulations and real data. We first simulated mixture of cell types and measured the correlation of the PCs of ReFACTor (ReFACTor components) with the cell proportions. We observed that the correlation between each of the cell types and the linear predictor of the cell type using the first several ReFACTor components was substantially improved compared with the correlation using the first several PCs of a standard PCA. These results were robust to the simulation parameters (see Online Methods and Supplementary Figs. 1-3) . Next, we measured the performance of ReFACTor on real data from the GALA II data set 7 (n = 489). The GALA II cohort contains whole blood methylation data as well as cell count measurements for 78 of the samples, and so we were able to evaluate the correlation between the measured cell type proportions and the inferred ReFACTor components. We compared the results of ReFACTor to PCA and to the available reference-based method 3 (Fig. 1) . Overall, ReFACTor's correlation with the cell type proportions is higher than PCA's, and ReFACTor outperforms the reference-based method with six components-six being the number of cell types it estimates-even though the referencebased method leverages external data not available to ReFACTor. Although cell counts could potentially be used to adjust for tissue in epigenome-wide association studies (eWas), different methylation profiles of distinct cell types may lead to false discoveries. We introduce refactor, a method based on principal component analysis (Pca) and designed for the correction of cell type heterogeneity in eWas. refactor does not require knowledge of cell counts, and it provides improved estimates of cell type composition, resulting in improved power and control for false positives in eWas. corresponding software is available at http://www.cs.tau.ac.il/~heran/ cozygene/software/refactor.html. Recent work applying EWAS suggests an important role for DNA methylation as a mechanism involved in disease. In a standard EWAS of primary tissue, such as whole blood, methylation data represent the epigenetic states of a heterogeneous mixture of cell types. Since the epigenome is highly variable across different cell types, correlations between the phenotype of interest and the cell type composition lead to a large number of false discoveries 1,2 . The standard statistical analysis applied in EWAS uses a univariate test for correlation between the phenotype and each of the probed CpG sites. Thus, false discoveries due to cell type heterogeneity can be addressed by adding the cell proportions as covariates. However, cell type compositions are not typically measured, and therefore a computational method has been proposed for the estimation of cell type composition using a reference data set that includes methylation measurements for sorted cells 3 . Unfortunately, reference data for whole-genome methylation levels from sorted cells are available only for a small subset of different blood cells and not for any other tissues. Furthermore, the existing data sets are small 3, 4 , and the individuals in the reference data are not matched for methylation-altering factors such as age and sex, which may lead to inaccuracies in the cell type estimates.
Similarly to the NNMF solution, ReFACTor is an unsupervised method and it only finds principal components (PCs) that form linear combinations of the cell proportions rather than directly estimates the cell proportion values REF .