Removal of unwanted variation (RUV) has also been proposed as a method for stabilizing differential expression (DE) results. Despite this, it remains a challenge to run multiple RNA-seq algorithms to identify significant differences common to multiple algorithms, whilst also integrating and assessing the impact of RUV into all algorithms. consensusDE was developed to automate the process of identifying significant DE by combining the results from multiple algorithms with minimal user input and with the option to automatically integrate RUV. consensusDE only requires a table describing the sample groups, a directory containing BAM files or preprocessed count tables and an optional transcript database for annotation. It supports merging of technical replicates, paired analyses and outputs a compendium of plots to guide the user in subsequent analyses. Herein, we assess the ability of RUV to improve DE stability when combined with multiple algorithms and between algorithms, through application to real and simulated data. We find that, although RUV increased fold change stability between algorithms, it demonstrated improved FDR in a setting of low replication for the intersect, the effect was algorithm specific and diminished with increased replication, reinforcing increased replication for recovery of true DE genes. We finish by offering some rules and considerations for the application of RUV in a consensus-based setting. consensusDE is freely available, implemented in R and available as a Bioconductor package, under the GPL-3 license, along with a comprehensive vignette describing functionality:  Differential gene expression (DE) analysis aims to identify transcripts or features that are expressed differently between conditions. For the detection of significant DE genes, a number of Bioconductor/R  packagesCurrently, there is no gold standard approach for the analysis of RNA-seq data. Whilst there remains no gold standard it is important that attention is restricted to the best performing methods, to minimise negative results that are the consequence of technical limitations. Benchmark analyses of existing algorithms for detection of DE are important for the community to assess performance of different methods and existing analyses  have popRemoval of unwanted sources of variation (as implemented in RUVseq), is another approach that has recently been proposed to improve DE accuracy . RUV aimImplementing any consensus-based approach is challenging and requires combining individual algorithms that typically require different input parameters, use different method names, and generate different outputs, thus requiring the user to learn specific steps required for each package. Furthermore, correction methods, such as RUV , requireIntegration of results from different RNA-seq algorithms would ideally allow users to easily (1) import data, (2) run RNA-seq analysis across multiple algorithms, (3) require minimal parameter input, (4) offer flexible but simple options for removal of unwanted variation , (5) present results together in a simple table for further analysis and finally (6) provide metrics for users to determine stability of DE calls from multiple methods. Herein, we describe consensusDE, an R/Bioconductor package, which enables the above, integrating DE results from edgeR , limma/vBioinformatics analyses were performed in R version 3.5.1  using Bip-values. Normalisation methods are set to the default methods for each algorithm in multi_de_pairs . We implement RUVr, which we refer simply to RUV throughout, as described in the RUVSeq BioConductor vignette , with k set to 1. RUVr removes sources of unwanted variation, by first fitting a generalised linear model (GLM) to count data and obtaining model residuals that are then incorporated into subsequent DE models. All code and parameters used in analyses are available at, https://github.com/awaardenberg/consensusDE_material and a comprehensive vignette describing functionality: http://bioconductor.org/packages/consensusDE/.consensusDE version 1.3.4 (BioConductor Development version) was used for all analyses. Versions of RNA-seq algorithms follow, edgeR version 3.22.5, voom (limma) version 3.36.5, DESeq2 version 1.20.0 and RUVSeq version 1.16.1. For DESeq2, cooksCutoff is disabled for comparable reporting and ranking of all We apply consensusDE to both real and simulated data. Real data consisted of RNA-seq data comparing treatments to controls from human airway smooth muscle cells  while foR2 was reported, this was the resultant goodness of fit of a linear model comparing logFC.For assessment of RNA-seq algorithm agreement or performance we use a number of statistics. Agreement of logFC was assessed by Bland-Altman analysis  of the dA and B to the total size or union of sets A and B. Here, the size of set A was considered the intersecting set of all methods  and B considered either the set size of each method individually  or the union of all methods (where reported as the union). Concordance (or agreement) of significant DE genes called by RNA-seq algorithms was assessed using the Jaccard Similarity coefficient (JC), , represeWhere truth was known (in the case of simulation), positive predictive value (PPV) or precision as the proportion of true positive (TP) versus false positives (FP) , sensitiWe begin by (1) describing consensusDE functionality, followed by (2) comparison to existing software and the application to (3) real and (4) simulated data for assessing performance, with and without RUV integration.buildSummarized and multi_de_pairs functions respectively. consensusDE follows two simple steps for performing DE analysis with multiple RNA-seq algorithms (1) building a summarized experiment object and (2) performing DE analysis (including plotting) using the Generates a summarized experiment that contains all experimental data provided in the sample table and the read counts mapped to transcript coordinates. To build a summarized experiment object consensusDE simply requires a sample table describing the location of BAM files or pre-computed counts from the popular HTSEQ , sample Automatically performs DE analysis on all possible pairs of “groups” defined in a provided sample table using all available DE methods  and outputs a summary table  that merges the results of all methods into one table. Options are provided for annotations, including an option to annotate from gtf files, and users are provided the option to remove unwanted sources of variation by RUVr . RUVr, ip-value, “p_intersect” representing the intersect p-value and “rank_sum”, being the sum of the rankings for significance of DE reported by each method. In the case of Average Expression and Log Fold Change (logFC), these represent the mean value across all methods. Standard deviation of the logFC is reported for assessment of variation of fold change between methods. Individual p-values (corrected for multiple hypothesis testing by default), and additional information including annotated gene symbol, gene name, kegg pathway and chromosomal coordinates are also reported when annotation is optionally selected. Thus, the merged table provides a simple summary of all methods and statistics in one location.The final table of interest is described as the “merged” table  and the size of the point weighted by fold change standard deviation, allowing assessment of deviation of fold change by different methods. In addition to providing plots before and after normalisation, if RUV is employed, plots before and after RUV correction are generated thus allowing users to assess the impact of normalisation and/or RUV. Each plotting function is accessible through the ‘diag_plots’ function in consensusDE and described in a vignette that accompanies consensusDE: http://bioconductor.org/packages/consensusDE/.Ten diagnostic plots are generated and optionally saved as pdf files; (1) mapped reads for a summary of transcript reads per sample, (2) Relative Log Expression (RLE) for quality control (QC) inspection, (3) Principle Component Analysis (PCA), (4) RUV residuals, (5) Hierarchical clustering, (6) Density distributions, (7) Boxplot, (8) Mean/Average (MA) Plot, (9) Volcano plots and 10) For summarization of software and their features, we exclusively focus on methods that report multiple RNA-seq algorithm results in p-value methods  performed poorly and the weighted combination of p-values (PANDORA and Whitlock) was sensitive to the selection of weights, requiring proper simulation for definition of weights. Although the weighted combination of p-values improved overall performance in some cases, it did not improve false discovery rate (FDR) using simulated data  or Area Under Curve (AUC) of real data in comparison to the intersection method . For assessment of RUV to stabilize fold change variation between multiple algorithms, we perform Bland-Altman analysis to assess bias and limits of agreement, being the mean agreement and 95% confidence intervals of logFC differences between pairs of methods, respectively. Goodness of fit of log fold-change (reported as R2) and standard deviation (SD) of log fold-change in the intersecting and non-intersecting DE results are also evaluated for each algorithm. consensusDE was ran without RUV and then with RUV to incorporate the same RUV residuals into each algorithm for comparison of results. For application to real RNA-seq data, we utilize data from human “airway” smooth muscle cells comparing glucocorticoid treatment to untreated controls (RUV has been reported to stabilize fold-change and reporting of DE . To assecontrols . This dap ≤ 0.05), of which 1,728 were in common (p ≤ 0.05), with the common set increasing by 31%  and voom, and edgeR (0.9799 vs. 0.9882) and voom, but did not increase between DESeq2 and edgeR (0.9998 vs. 0.9999) (We next assessed agreement (or stability of fold change) between algorithms using Bland-Altman analyses, linear regression and standard deviation of fold change. Bias, being the mean shift of the differences between logFC values for each pair of algorithms and the limit of agreement (LOA), being the range of values where 95% of data laid were compared before and after RUV correction. Mean bias, with or without RUV was small (ranging from ∼0.003–0.013) and consistently decreased with RUV correction . If RUV  0.9999) . RUV als 0.9999) . OverallOverall, these results found that RUV (1) increased the number of reported DE genes, whilst (2) increasing the overlap of intersecting sets and (3) improving fold change agreement between methods. Thus, RUV appeared to improve the overall concordance of different methods, bringing their intersecting values closer to the union of all sets. This was consistent with a reduction of variability of fold change between algorithms, especially between voom and DEseq2 as well as edgeR. However, the smallest set of DE genes was also derived from voom and voom had the highest level of agreement to the overall intersect. Thus, it is important to note that consensus and improvement of consensus with RUV, was largely driven by voom and the additional agreement of DEseq2 and edgeR with voom after RUV application. As it is difficult to address what this means, especially JC, in the context of false discovery rate or overall performance, we next simulate data with known numbers of DE genes and assess the utility of applying RUV in a consensus-based manner across multiple RNA-seq algorithms for improving stability of the intersecting set.R2 and fold change SD. Simulated data with 3 replicates (without RUV and adjusted p ≤ 0.05) identified 304.0 DE genes for voom (JC = 0.999), 449.6 for edgeR (JC = 0.675), 438.1 for DEseq2 (JC = 0.693), of which 303.6 were in common. In contrast to real data RUV did not improve JC values, identifying 281.9 DE genes for voom (JC = 0.996), 462.2 for edgeR (JC = 0.608) and 415.5 for DEseq2 (JC = 0.676), of which 280.8 were in common (For simulated data (described in Methods) we set an expected number of DE genes to 500 (or 5%), from a total of 10,000 genes with equal up/down regulation between two groups. We simulate DE with 3 and 5 replicates , representing commonly performed experimental designs, and report the average of 10 simulations. As per the real “airway” dataset, we begin by assessing the JC of each method, with and without RUV correction, followed by Bland-Altman analysis of bias, LOA, n common . Althougn common . For 5 rR2 for 3 and 5 replicates also improved between DESeq2 and voom, as well as edgeR and voom, but did not increase between DESeq2 and edgeR , RUV increased the mean absolute fold-change bias in all comparisons . Howevernd edgeR .The greatest gains in fold change stability for voom were found in the 3-replicate setting, doubling the improvement observed with RUV applied in a 5-replicate setting. Absolute mean fold change SD of simulated results also improved with RUV correction, 0.0086 (vs 0.011 or a reduction of 0.024) for voom, 0.0147 (vs 0.0154 or a reduction of 0.007) for edgeR, and 0.0133 (vs 0.0141 or a reduction of 0.008) for DEseq2 (adjusted p ≤ 0.05). With the exception of edgeR, the non-intersecting set of each method and the overall intersect also improved with 5 replicates, which was 0.0534  for voom, 0.0242  for EdgeR and 0.0232  for DEseq2 and intersection  . RUV alsAs we defined a truth set (known DE genes) we assess the performance of consensusDE with and without RUV correction for each method, as well as the union and intersect. We utilise (1) False Discovery Rate (FDR)  and (2) Here, we establish that RUV improved FDR for the intersect for 3 replicates, approaching the same FDR as 5 replicates without application of RUV, but did not further improve FDR with 5 replicates. The improvement of FDR related to a reduction of fold-change variation and limit of agreement of different algorithms, which was greater in a setting of 3 replicates versus 5 replicates. However, the same was not true for all algorithms individually, suggesting that the greatest gain in FDR results from the combination of different algorithms. Observing the lowest FDR for the intersect amongst different algorithms and the highest for the union could be considered consistent with a model where increased stringency through inclusion of multiple forms of evidence improves FDR. Indeed, this would be consistent with previous benchmarking studies . Howeverp-values. However, our results do indicate the utility and ease of consensusDE for performing analysis with multiple RNA-seq algorithms and integration with RUV, whilst offering some rules for considering results. Future work will aim to incorporate additional algorithms and combination methods.We present consensusDE, a freely available R/Bioconductor package, that allows for simple and automated DE analysis to be performed using multiple methods, readily allowing the user to observe variability of DE due to method selection. Application of consensusDE to real and simulated data highlights the following rules, some of which are already established in the RNA-seq community and others that require further consideration when analysing RNA-seq data. (1) the intersect of multiple methods has lowest FDR , (2) RUV improves the intersect FDR  with smaller number of replicates but this effect diminishes with increased replication, (3) RUV does not improve FDR for all individual RNA-seq algorithms, (4) RUV does not improve sensitivity, (5) the union appears to strike a balance for recovery of true positives, through minimising loss of false negatives when using multiple methods, and finally (6) increased replicate numbers, without RUV, has the best recovery of DE genes when considering FDR and sensitivity together—reinforcing increased replication for recovery of true DE genes. We do note however that this is not an exhaustive testing of all possible scenarios. For instance, it remains to be explored if these rules apply with increased modelling of noise, RUV correction methodology (here we apply RUVr), number of hidden variables or if these rules generalize to other methods for combining RNA-seq algorithms, such as weighting of 10.7717/peerj.8206/supp-1Table S1Click here for additional data file.10.7717/peerj.8206/supp-2Table S2Click here for additional data file.


The nature and extent of immune cell infiltration into solid tumours are key determinants of therapeutic response. Here, using a DNA methylation-based approach to tumour cell fraction deconvolution, we report the integrated analysis of tumour composition and genomics across a wide spectrum of solid cancers. Initially studying head and neck squamous cell carcinoma, we identify two distinct tumour subgroups: ‘immune hot’ and ‘immune cold’, which display differing prognosis, mutation burden, cytokine signalling, cytolytic activity and oncogenic driver events. We demonstrate the existence of such tumour subgroups pan-cancer, link clonal-neoantigen burden to cytotoxic T-lymphocyte infiltration, and show that transcriptional signatures of hot tumours are selectively engaged in immunotherapy responders. We also find that treatment-naive hot tumours are markedly enriched for known immune-resistance genomic alterations, potentially explaining the heterogeneity of immunotherapy response and prognosis seen within this group. Finally, we define a catalogue of mediators of active antitumour immunity, deriving candidate biomarkers and potential targets for precision immunotherapy. Determining the extent of immune cell infiltration into solid tumours is essential for adequate therapeutic response. Here the authors develop a DNA methylation-based approach for tumour cell fraction deconvolution and analyse tumour composition and genomics across a wide spectrum of solid cancers. The recent clinical success of immunotherapy in subpopulations of patients with previously intractable malignancies has also highlighted the importance of understanding the tumour microenvironment in order to identify those patients who will derive the most benefit from targeted therapies2. Although responses to immune checkpoint blockade (ICB), e.g. antibodies against PD-1 (programmed cell death protein 1), PD-L1 (programmed death-ligand 1) and CTLA-4 (cytotoxic T-lymphocyte-associated protein 4), are seen across many solid tumours, the proportion of patients that benefit varies widely by cancer type and we currently lack biomarkers with which to reliably predict immunotherapy response3. Emerging evidence from clinical trials indicates higher response rates in those cancer types that typically display greater lymphocyte infiltration  and that the tumour neoantigen repertoire (a function of somatic mutation load) is a key determinant7. These observations point to a model in which, within any given cancer type, there are immune hot and immune cold tumours. Immune hot tumours display greater cytotoxic T-lymphocyte (CTL) infiltration, and reactivation of these tumour-resident CTLs by checkpoint inhibition can result in dramatic tumour regression. Conversely, immune cold tumours display minimal CTL infiltrates and typically fail to respond to checkpoint modulation. If one could accurately identify likely responders for patient stratification and devise strategies by which to convert cold tumours to hot tumours, these would be major steps forward in realising the full clinical potential of cancer immunotherapy.The tumour microenvironment plays key roles in shaping tumour evolution and in determining treatment responses; prominent intratumoural lymphocyte infiltration is a favourable prognostic marker in multiple tumour types, while a high stromal content of extracellular matrix-producing cancer-associated fibroblasts (CAF), is associated with poor outcomes15. For example, accurate deconvolution of complex cellular mixtures, including tumours, has recently been achieved by the application of support vector regression modelling (CIBERSORT) to gene expression microarray data16. Notably, DNA methylation data are also suitable for deconvolution of tissue mixtures, although studies so far have focussed primarily on simple tissues such as blood, where cell type differences are a major confounder in Epigenome Wide Association Studies10.Although flow cytometry of disaggregated tumour biopsies is commonly used for investigating cellular composition, this is often unfeasible for several reasons: difficulty in obtaining fresh tumour tissue; lack of defined markers for poorly characterised cell types (e.g. CAFs); and high cost of labour, reagents and equipment required for such analyses. Cellular disaggregation of collagen-rich tumours is also problematic, where cells are embedded in a dense extracellular matrix. To overcome these difficulties, multiple reference-free or reference-based methods have recently been developed to permit the in-silico deconvolution of complex cellular mixtures or to estimate tumour purityPTEN and amplifications in MYC and EGFR. We show that responses to PD1-blockade are associated with a transcriptional signature for hot tumours post-treatment, while the cold signature, and specifically a gene expression module we previously linked to increased aerobic glycolysis downstream of EGFR in head and neck squamous cell carcinoma (HNSCC)17, is enriched in non-responders. Importantly however, defining whether a tumour is hot or cold is not sufficient to accurately predict response to ICB, and by interrogating matched genomic data, we show that treatment-naive hot tumours frequently display genomic alterations known to confer immunotherapy resistance.Here, we present CIBERSORT-based deconvolution to genome-wide DNA methylation data from whole tumour tissue (hereafter referred to as ‘MethylCIBERSORT’). We provide accurate estimates of tumour purity and cellular composition, and identify immune hot and cold tumours across a broad spectrum of cancer types profiled by The Cancer Genome Atlas Project (TCGA). Using matched genomic and transcriptomic data, we identify multiple copy number alterations enriched in cold tumours, including deletions in R = 0.986, p < 2.2e−16, Fig. 14. This revealed that MethylCIBERSORT estimates demonstrate higher correlations, both at the cell-type and the sample level . We then evaluated the ability of our feature selection heuristic to accurately deconvolute mixtures of leukocytes using publicly available methylation data from mixtures of peripheral blood mononuclear cells (PBMCs) with composition verified by flow-cytometry (gold standard). This showed an extremely high correlation between the estimated and gold-standard fractions  estimates derived using MethylCIBERSORT with estimates derived from ABSOLUTE21 (which jointly estimates purity and ploidy using mutation and copy number data) relative to other previously published methods of estimating purity (LUMP22 and ESTIMATE23) with data aggregated in ref. 22, MethylCIBERSORT displayed the highest correlation (R = 0.82) and better concordance with ABSOLUTE than other methods , particularly in those cancers driven by human papillomavirus (HPV)ods Fig. . Analysiods Fig. , resultiWe also compared the mRNA expression of a panel of cellular lineage markers with MethylCIBERSORT estimates and found significant associations for multiple cell types  but more specifically attributed this to increased numbers of B (CD19+) and cytotoxic T (CD8+) lymphocytes  HNSCCR = −0.41) and Tregs (R = −0.38). CD56+ natural killer (NK) cell abundance is also inversely correlated with CTLs (R = −0.45). Of note, CTLs are inversely correlated with fibroblast abundance (R = −0.12) and to validate this latter finding, we analysed data from two large studies in which these parameters had been quantified in HNSCC28. In a pooled analysis of these data, TIL content and SMA expression (a CAF marker) are inversely correlated  cohort .Next, we extended our analysis to HPV-negative (HPV−) HNSCC, a heterogeneous, anatomically-diverse group of tumours in which prognosis is typically much poorer than in HPV+ disease. Again, using TCGA data (available for 398 HPV− HNSCCs) we observed interesting relationships between multiple cell types, with 24/36 pairs of cell types showing significant correlations 29. Most infiltrating cell fractions display significant correlations with cytolytic activity, with CD8+ cells showing the maximum positive correlation , and increased ratios of CTLs to Tregs ; a metric that is prognostic in multiple settings32.Given the complex nature of associations between different cell types, we performed consensus PAM clustering on the estimated cellular fractions to define subgroups by infiltration patterns. We derived two clusters  that show markedly different distributions of multiple cell types, most notably CTLs, Tregs, CD4+ effector T-lymphocytes, CD19+ B-lymphocytes and NK cells, all of which are implicated in antitumour immunity Fig. . Consistp < 2e−16), CD14+ , and CD56+  cell abundance as positive predictors and fibroblast abundance as a negative predictor .Together, our analyses suggest a tilting of the balance towards CTL activity in the microenvironment of tumours from the hot cluster. Integrated analysis of the impact of different cell populations on cytolytic activity using linear modelling identified CD8+ , CD79A and CD19 (B-lymphocyte markers), are all upregulated in the hot tumours, as are multiple chemokines and their receptors , immune checkpoint gene transcripts , and as expected, the cytolytic markers PRF1 and GZMA. In extended analyses of all genes at FDR < 0.01 (Supplementary Data B2M (FC = 1.39), PD-1 ligand CD274 (FC = 1.62) and ACTA2, which encodes SMA (FC = 0.68), are also differentially expressed between the two clusters, the latter validating fibroblast estimates from MethylCIBERSORT  between the hot and cold clusters at a fold-change of greater than 2  associated with immune cluster using negative binomial regression. This identified enrichment of CASP8, PIK3CA, CREBBP, EP300 and HLA-A mutations in hot HNSCCs, while TP53 and KDM6A mutations are enriched in cold HNSCCs , an upstream activator of pro-apoptotic signalling through Caspase 8 is also upregulated in the immune hot tumours, further highlighting the importance of this pathway  and a smaller increase in overall mutational burden . Moreover, in 15 tumours from the hot cluster versus five in the cold cluster, CASP8 mutations themselves encoded at least one neoantigenic peptide 39 and recorded very high correlations, indicating our method is applicable also to the archival material , and predicted immune cluster membership for the validation set of 7596 samples representing 21 further tumour types from TCGA Fig. . As expe29) of observed neoantigens to total nonsilent mutations per tumour and adapted this approach to derive the estimated number of neoepitopes lost through immune editing while controlling for tumour type. Accordingly, we found significant enrichment for editing in hot tumours compared to cold tumours . Additionally, upon integration with T-cell receptor (TCR) repertoire data from Li et al.40, we found more diversity  in the immune hot tumours , suggesting that broader immune responses may underlie the greater depletion of neoantigens in this group.To further determine if the immune infiltrate was active in these tumours, we assayed immunoediting by testing for reductions from the expected ratio , along with costimulatory and coinhibitory receptors, suggesting these tumours were marked by a state of lymphocyte activation and counter-responses thereto. We next scored proinflammatory  and suppressive (Th2) CD4+ cell populations using RNA-seq reference profiles from purified cells to derive relative estimates using CIBERSORT14. Consistent with our inferences from pathway analysis, we found enrichment for Th1 cells in hot, and Th2 and Th17 cells in cold tumours  versus T-helper 2 (Th2) lymphocyte responses , and identified substantially higher fractions of M1 relative to M2 macrophages in hot tumours  treatment44. Analysis of these transcriptional patterns indicated differential expression between responders and non-responders  and more predicted neoantigens than immune cold tumours . We found that the abundance of both CTLs and Tregs is correlated with clonal neoantigen load pan-cancer, while the relationship is much weaker when subclonal neoantigens are considered. CD4+/FOXP3− effector lymphocytes display a striking inverse correlation with clonal neoantigens  as well as a skew in the neoantigen burden towards clonal neoantigens after adjusting for tumour type . These findings provide evidence for a direct link between Class I MHC clonal neoantigen burden and patterns of TIL abundance and may help to explain the observations of McGranahan and colleagues, that high clonal neoantigen burden predicts favourable response to immune checkpoint modulation using Pembrolizumab5.Consistent with our observations in HNSCC, and with estimates from gene expression-based deconvolutionurs Fig. . Given tens Fig. . Consist46 and recorded 56 hits at FDR < 0.05  in a list of genes demonstrated to confer resistance to CD8 T-cell-mediated killing in a recent CRISPR-Cas9 screen47. The functionally-verified immune-resistance genes that were disproportionally mutated in hot tumours included those involved in antigen presentation (B2M and HLA-A), apoptosis (CASP8) and interferon signalling (JAK1). ARID2, which encodes a component of the SWI/SNF chromatin remodelling complex also implicated in modulating sensitivity to T-cell-mediated killing downstream of JAK-STAT signalling, was also disproportionately mutated in hot tumours49. Mutant KRAS, recently implicated in generating a fibrotic tumour microenvironment by activating paracrine signalling with CAFs in pancreatic cancer50, is enriched in cold tumours. Taken together, these findings support a model wherein mutations in certain genes render tumours hot as a consequence (and therefore susceptible to checkpoint blockade), or may enable tumours to survive in a hot tumour microenvironment, potentially also bestowing resistance to checkpoint blockade. We sought to test this model by linking our candidate immune-resistance mutations to lack of ICB response in pre-treatment hot tumours and although we observed a trend, , the number of treated tumours with sequence data available is currently too low (54 hot tumours across four studies) to gain a definitive answer.Next, we examined if the genomic features associated with immune cluster were also reproducible across cancer types, performing adjusted binomial regressions to estimate cluster association after controlling for tumour type for genes previously implicated as pan-cancer drivers based on signatures of positive selectionEGFR) (7p11.2) and MYC (8q24.3) and deletions at 10q23.31, encompassing the PTEN tumour suppressor gene in cold tumours and JAK2 (9p24.1) amplifications in hot tumours. Some of these candidates already have known associations with immune evasion; MYC has been linked to an immune evasion phenotype that is amenable to targeting through gene–body demethylation51 and PTEN deletion has recently been linked to the failure of immunotherapy and decreased cytotoxic T-lymphocyte infiltration in patients and in a mouse model of melanoma53. Among the genomic alterations we identify 28 we found that samples classified as EGFR high and moderate were significantly more likely to be TIL low than EGFR low cancers after accounting for anatomic site and HPV status . The positive correlation between EGFR levels (which are themselves correlated with EGFR phosphorylation (activation), Supplementary Figure p = 0.06, t-test, p = 0.02 when excluding stable disease) and is inversely associated with expression of the hot transcriptional signature (Rho = −0.44) that is associated with ICB response  or perform low resolution deconvolution (ESTIMATE)7 and in identifying the role of mutations in genes like CASP8 in immune evasion29, the deeper level of deconvolution made feasible using DNA methylation data allows the roles of distinct cellular subsets and their interdependencies to be dissected. Here, by applying the method to HNSCC, which is marked by a great degree of clinical heterogeneity, we identified lymphocyte-rich and stromal-rich prognostic subgroups consistent with those discovered previously using a variety of independent methods57 and derived insights into the microenvironmental alterations that might be relevant for prognosis. In the process, we showed that our scheme for classifying cancers correlates with well-established immune metrics such as cytolytic activity, neoantigen/mutational load and CTL:Treg ratios. We demonstrated that tumours similar to the HNSCC immune-hot subgroup exist in varying fractions across the vast majority of cancer types. The congruence of our classification with the aforementioned metrics is maintained throughout and translates to broader TCR responses which presumably drive the greater depletion of neoantigens seen in the hot tumours. Combining the accuracy and ability to determine absolute cell fractions of MethylCIBERSORT with the high resolution afforded by CIBERSORT enabled detection of a skew towards antitumour T-helper and macrophage phenotypes in hot tumours, reinforcing our hypothesis that this cluster is enriched for active antitumour immune responses. Consistent with this, we also showed in the limited post-treatment cohorts with gene expression data, that melanomas responding to ICB (particularly anti-CTLA4) display a gene expression signature derived from our hot cluster. Our ICB response analysis also indicates that hot/cold classification based on cellular composition is a superior predictor of response than total mutation or predicted Class I neoantigen loads (both previously proposed ICB response biomarkers), however none of these metrics displayed sufficient accuracy to be of clinical use. Given the complex interplay between tumour genomics, epigenomics and anti-tumour immune responses, it is likely that prediction algorithms incorporating multiple biomarkers such as these, in addition to checkpoint protein expression and spatial information on immune infiltrates (e.g. Immunoscore58) will be required for patient stratification.While approaches using RNA-sequencing or other transcriptional profiling, such as the construction of an index of cytolytic activity, have been useful in predicting immunotherapy responsePTEN deletion, MYC amplification and EGFR amplification are associated with immune depletion. All three events have been associated with increased glycolysis, which we have previously linked to immune evasion17. Our finding that PTEN deletion is associated with poor CTL infiltration in this pan-cancer cohort adds substantial support and mechanistic rationale for its proposed role as a determinant of response to ICB. Taken together with the identification of EGFR and MYC amplification in cold tumours, our analysis suggests that pharmacological inhibition of EGFR/mTORC1/MYC-driven glycolysis could be an effective means by which to ‘warm-up’ these tumours and potentially enhance responses to ICB. The finding that hot tumours frequently harbour functionally-validated immune-resistance mutations offers a potential explanation for the heterogeneity in ICB response even amongst hot tumours . Secondly, the relative paucity of these mutations in cold tumours (presumably due to the absence of a selection pressure for them) suggests that if we could induce lymphocyte infiltration (e.g. by targeting glycolysis or CAFs59), we may improve the effectiveness of checkpoint blockade across a broader range of patients.Genomic analysis identified significant enrichment for events that confer resistance to T-cell-mediated destruction in hot tumours as well as potential sensitisers. Our copy number analysis revealed that 5. In particular, we show that clonal neoantigens are associated with infiltration of CTLs and Tregs, while Th2 cells and CAFs are enriched in tumours with lower clonal neoantigen loads. Why these relationships between neoantigen loads and T-lymphocytes are apparent only when one considers clonal neoantigens is an intriguing question. It could be that since many subclonal neoantigens are expressed by a small minority of cells within the tumour, these evade effective presentation to the immune system. Indeed, in a previous study by several of the authors, it was possible to isolate T-lymphocytes reactive against clonal but not subclonal neoantigens from lung cancer patients5. Our data suggest that this is due to a relative paucity of CTLs in tumours with low clonal neoantigen loads and that this is true across a wide range of cancer types.Finally, our analysis of neoantigen clonality and immune infiltration patterns adds mechanistic insight to the value of clonal neoantigen burden in predicting response to ICBIn summary, the development of a stand-alone method to estimate both tumour purity and stromal composition from DNA methylation data has provided a number of insights that shed light on potential biomarkers for immunotherapy response and the way in which tumour genomes influence, and are shaped by, the immune microenvironment. Beyond analyses of publicly available data such as those we present here, the applicability of the method to both fresh and archival samples should readily allow researchers to explore questions related to the tumour microenvironment and potential therapeutic response across a diverse range of experimental settings.FlowSorted.Blood.450k Bioconductor package60. CD4+ cells were removed from the Blood.450k dataset and CD4+ T-cells from the Zhang dataset61 (data kindly provided by Dr. Alicia Oshlack) were further divided into FOXP3+ (Tregs) (4) or FOXP3− (6) groups. Fibroblast profiles (4) were from the Gene Expression Omnibus (GSE74877). Neutrophils are the most abundant subset of granulocytes and these samples were therefore aggregated into a single category for further analysis. To generate a DNA methylation signature for cancer cells, we used 450k methylation profiles we previously obtained from a series of six HNSCC cell lines: UM-SCC47; 93VU147T; UPCI:SCC090; PCI-30; UPCI:SCC036 and UPCI:SCC003  and additionally those from Iorio et al. (GSE68379)37. The files were parsed into R using the minfi63 Bioconductor package and were normalised using single sample Noob as implemented in minfi. To derive signature features, a custom limma-based wrapper function was used to fit a series of linear models for all pairwise comparisons between candidate cell types. Features from this set of analyses were then restricted to MVPs that showed a median beta-value difference of 0.25 at an FDR of 0.01 for that fit or less, with a maximum of 100 MVPs per pairwise comparison. Finally, for use with CIBERSORT, data were transformed from beta values (bound between 0 and 1) to percentages (0–100). Type-wise means were estimated for each probe and cell type and the matrix exported for upload to CIBERSORT.Raw data were obtained in the form of IDAT files from the following sources (the number of samples from which each profile was derived is shown in parentheses): granulocytes (12), CD8+ (cytotoxic T-lymphocytes) (6), CD19+ (B-lymphocytes) (6), CD56+ (NK cells) (6), CD14+ (monocyte lineage) (6), eosinophils (6) were from the LM22 (expression-based CIBERSORT) to datasets consisting of PBMC samples and Follicular Lymphoma biopsies originally evaluated in CIBERSORT14. Wilcoxon’s Rank Sum Tests were used to test for differences in correlations with flow-cytometry for cell types and samples, and absolute errors between flow-cytometry and deconvolution estimate. For the expression-based CIBERSORT estimates, we performed comparisons against both calibrated (i.e. enforcing a sum-to-one constraint as reflected in the flow cytometry) and uncalibrated (straight estimates of cell fractions from CIBERSORT) estimates.We applied the feature selection pipeline to the matrix of stromal cells that we assembled and then tested performance against 450k profiles of PBMC mixtures with flow-cytometry gold standards. We also applied 64 in the minfi63 package and BMIQ65, with 10,000 reference probes for Expectation Maximisation fitting. HPV status was determined using VirusSeq66 based on detection of viral gene transcripts.Data for 464 methylation profiled TCGA HNSCC samples were downloaded in the form of raw IDAT files for the 450k array from the TCGA data. Data were normalised using functional normalisationhttps://cibersort.stanford.edu. The data were not quantile normalised due to the potential for global methylation shifts in cancers, and CIBERSORT was run using 1000 permutations. Output files were downloaded as tab-delimited text files and custom parsers were used to import results into R for downstream analysis. FFPE methylation profiles for 42 HNSCC were obtained from Gene Expression Omnibus (Accession GSE38266) using the GEOquery R package, and beta values were BMIQ normalised and analysed using CIBERSORT as described for the TCGA cohort. Wilcoxon’s Rank Sum Tests were used to test for differences in total TIL abundance and TIL subsets.Beta values for deconvolution associated features, and the signature matrix derived in the previous step, were uploaded to CIBERSORT at 22 using Spearman’s Rank Correlation. Correlations were between ABSOLUTE and other methods of estimating purity/immune cell fraction in this subset of tumours; LUMP, ESTIMATE23 and H&E staining assessment of tumour purity (data available in ref. 22). Residuals were computed by subtracting the method estimate from the ABSOLUTE value. Distributions were compared using Wilcoxon’s Rank Sum Test. Spearman’s Rank Correlation was used to estimate correlations between expression of marker transcripts and MethylCIBERSORT estimates for multiple cellular populations. Where applicable, multiple testing correction was performed using the Benjamini–Hochberg approach.In the absence of flow-cytometry-based estimates for the different cell types in the analysed tumours, the estimated fraction of cancer cells from MethylCIBERSORT was compared to sequencing-data based estimates from ABSOLUTE available for 466 HNSCCs from previously published workEstimates of immune cell fractions in HPV− HNSCC (HPV-transcript negative) were examined for correlations with other infiltrating cell types using Spearman’s Rank Correlation with BH correction for multiple testing. Clustering was carried out using the clusterCons package with 100 iterations using a Manhattan distance metric. The most robust number of clusters was then selected.Differences in the distribution of infiltrating cell types by immune cluster were summarised using mean fold changes and tested using Wilcoxon’s Rank Sum Test with BH-correction for multiple testing.GZMA and PRF1 expression as defined previously29. To estimate the contributions of cell population abundances to this, a linear model was fit against log2(CYT) with the different populations as predictors. Wilcoxon’s Rank Sum Tests were used to test differences in CYT and CD8:Treg ratios between the immune clusters.DEGs were identified using limma-trend and were defined at a threshold of a 2-fold change and BHFDR < 0.01. Pathway analysis was carried out using Ingenuity Pathway Analysis, with findings restricted to experimentally confirmed direct interactions in human cells/tissues. Cytolytic activity (CYT) was calculated as the geometric mean of Multivariate Cox Regression was used to estimate the prognostic utility of clusters derived using infiltration patterns with age and stage as covariates. The survival effect of estimated purity was regressed with the same covariates using a Cox regression with coefficients defined per percent increase in purity.33 in TCGA HNSCC cohort from the Broad Institute’s GDAC. GISTIC Copy number estimates thresholded by genes were also obtained from this source. MAF files were obtained from the TCGA data portal. MutSigCV drivers were filtered at a q value threshold of 0.01 and mutations in this set were tested for differences in frequencies of occurrence using a Chi-squared test for differences in proportion. Multiple testing correction was carried out using the Benjamini–Hochberg method. Tables of predicted neoantigens were downloaded from The Cancer Immunome Atlas (http://tcia.at).We obtained a list of driver genes inferred by MutSigCVGSE6837937 (Table 22.Signature features were derived from 450k profiles using the aforementioned heuristic (delta-Beta and FDR cutoffs) with a maximum of 100 features per cell type for a wide range of tumour types, using cell lines allocated to the corresponding tissue in 37 Table  and the syn2812961) and a custom function was used to extract signature probes and generate methylation percentage matrices for deconvolution with CIBERSORT CIBERSORT was run using the graphical user interface [https://cibersort.stanford.edu]. Correlation and residuals analysis were carried out as described above with MethylCIBERSORT purity estimates versus ABSOLUTE, and between previously published methods and ABSOLUTE. Wilcoxon’s Rank Sum Test with Benjamini–Hochberg correction for multiple testing were used to compare distributions, with these estimates sourced from ref. 22.The cell line data were functionally normalised with the infiltrating cell types described earlier before signature extraction was carried out. 450k data for the aforementioned tumour types were loaded from a pan-cancer freeze derived from SAGE synapse for TCGA pan-cancer . Driver mutations were defined based on pan-cancer MutSig analyses previously published33 and logistic regression GLMs were used to estimate coefficients for mutation frequencies for immune cluster with tumour type as a covariate. Significant genes were defined at BHFDR < 0.05. Survival analyses were performed using data downloaded from Synapse (syn7343873) using Cox proportional hazards regression with stage and cancer type as covariates. Substages were aggregated into stages and only Stages I–IV were considered. Neoantigen abundance and clonality data were downloaded from The Cancer Immunome Atlas45.MAF files for mutations were again downloaded from SAGE synapse for all tumours from the MC3 calling effort  and modelled similarly to mutation data.Negative binomial modelling was used to model all count data, cytolytic activity was modelled using linear models and binomial GLMs were used to model proportions. Details of covariates, hypotheses and response variables are presented inline. For copy number analyses, SNP6 data were downloaded from the GDC data portal and processed using GISTIC 2.068; PRJNA25821669; PRJEB546870. Kallisto71 was used to quantify gene expression with a reference transcriptome consisting of Gencode Grch37 assembly of protein coding and lincRNA transcripts. Data were then modelled using limma trend and the top 50 markers by t-statistics were selected for each cell subset from one versus all comparisons after thresholding with a 2-fold change and FDR < 0.05. These cell types were used to generate a reference profile and CIBERSORT was run to deconvolute samples. For M1/M2 macrophage analyses we used LM22 from the CIBERSORT server as the reference. In both cases, Wilcoxon’s Rank Sum Test was used to estimate differences in distributions.RNA-seq data were downloaded from the European Nucleotide Archive for the following datasets: PRJEB1184442 and Roh et al.43, respectively for patients treated using sequential anti-CTLA4 and anti-PD1 checkpoint blockade.Nanostring data for a panel of immune genes and exome sequencing data were obtained from Chen et al.Clustering and machine learning were carried out using the subset of genes intersecting with the Hot-vs-Cold pancancer signature. .632 bootstrapping was used for hyperparameter tuning and ROC estimation. Negative binomial regression was used to model neoantigen, mutation and subclone numbers, and logistic regression to estimate predictive performance of count data on response.72. RNAseq data for aCTLA4 pretreatment biopsies were kindly provided by Eliezer Van Allen and genomic data were from the associated publication7. Data for post-treatment Nivolumab treated melanomas were obtained from ref. 44.The number of subclones present in each tumour from the Roh cohort, derived from the EXPANDS algorithm, were obtained from the associated publication28 for comparison of EGFR protein levels versus TIL levels, previously defined in refs. 28. ssGSEA scores were used to summarise the activity of the glycolytic gene signature (described in ref. 17) and standard statistical procedures were used to assess interrelationships.RPPA data were downloaded for TCGA cancers from the TCGA portal. IHC data were derived from refs. https://groups.google.com/d/forum/methyldeconvolution.Knit R-markdowns of the code used for analysis have been deposited on Zenodo at https://doi.org/10.5281/zenodo.1304766. The MethylCIBERSORT R-package and the signatures we generated are on Zenodo at https://doi.org/10.5281/zenodo.1298968. A Google Group for users of the package can be found here: GSE35069; GSE74877; GSE38270; GSE68379), the European Nucleotide Archive , SAGE Synapse , The Cancer Genome Atlas Project or from the authors upon reasonable request.The data analysed in this study are available either from the Gene Expression Omnibus (accession numbers: Supplementary InformationPeer Review FileDescription of Additional Supplementary FilesSupplementary Data 1Supplementary Data 2Supplementary Data 3Supplementary Data 4Supplementary Data 5Supplementary Data 6Supplementary Data 7Supplementary Data 8