To remove the potential effect of immune variation, we added HLA variation (equation (4)) or glial cell proportion (astrocytes, microglia, macrophages, oligodendrocytes, OPCs and T cells equation (5)) to our differential expression model as covariates. Previously, we found that only the oligodendrocytes in the DLPFC showed a significant association (Spearman P < 0.05; Supplementary Fig. 36) with genetic ancestry (see ‘QC and identification of relevant confounders’). Given the potential correlation between HLA variation and global genetic ancestry, we first examined the association of HLA variation with global genetic ancestry. For this, we first generated HLA variation principal components by applying PCA on the 2,850 HLA imputed alleles. We found a limited correlation between the ten principal components and global genetic ancestry (Spearman P < 0.05; Supplementary Fig. 41).4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{array}{l}E\left(Y\,\right)={\beta }_{0}+{\beta }_{1}{\mathrm{ancestry}}+{\beta }_{2}{\mathrm{sex}}+{\beta }_{3}{\mathrm{age}}+{\beta }_{4}{{\mathrm{mito}}\,{\mathrm{rate}}}+{\beta }_{5}{{\mathrm{rRNA}}\,{\mathrm{rate}}}\\\qquad +{\beta }_{6}{{\mathrm{total}}\,{\mathrm{assigned}}\,{\mathrm{genes}}}+{\beta }_{7}{{\mathrm{overall}}\,{\mathrm{mapping}}\,{\mathrm{rate}}}\\\qquad+\mathop{\sum }\limits_{i=1}^{k}{\gamma }_{i}{qS}{V}_{i}+\mathop{\sum }\limits_{j=1}^{5}{\sigma }_{j}{\mathrm{HLA}}_{j}\end{array}$$\end{document}EY=β0+β1ancestry+β2sex+β3age+β4mitorate+β5rRNArate+β6totalassignedgenes+β7overallmappingrate+∑i=1kγiqSVi+∑j=15σjHLAj5\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{array}{l}E\left(Y\,\right)={\beta }_{0}+{\beta }_{1}{\mathrm{ancestry}}+{\beta }_{2}{\mathrm{sex}}+{\beta }_{3}{\mathrm{age}}+{\beta }_{4}{{\mathrm{mito}}\,{\mathrm{rate}}}+{\beta }_{5}{{\mathrm{rRNA}}\,{\mathrm{rate}}}\\\qquad\quad+{\beta }_{6}{{\mathrm{total}}\,{\mathrm{assigned}}\,{\mathrm{genes}}}+{\beta }_{7}{{\mathrm{overall}}\,{\mathrm{mapping}}\,{\mathrm{rate}}}+\mathop{\sum }\limits_{i=1}^{k}{\gamma }_{i}{qS}{V}_{i}\\\qquad\quad+{\beta }_{8}{\mathrm{astrocyte}}+{\beta }_{9}{\mathrm{macrophage}}+{\beta }_{10}{\mathrm{microglia}}+{\beta }_{11}{{\mathrm{T}}\,{\mathrm{cell}}}\\\qquad\quad+{\beta }_{12}{\mathrm{oligodendrocyte}}+{\beta }_{13}{\mathrm{OPC}}\end{array}$$\end{document}EY=β0+β1ancestry+β2sex+β3age+β4mitorate+β5rRNArate+β6totalassignedgenes+β7overallmappingrate+∑i=1kγiqSVi+β8astrocyte+β9macrophage+β10microglia+β11Tcell+β12oligodendrocyte+β13OPC