for deconvolution, we rescaled the residuals to the original log2-transformed mean and standard deviation, and replaced negative values with zero. For the deconvolution step, we used the non-negative least squares95 implementation in SciPy (v1.4.1)96. Given that the average proportions of cell subtypes were often very low (that is, <1%; Supplementary Fig. 16), we opted to sum all the subtypes of cells for excitatory neurons, inhibitory neurons and oligodendrocytes (oligodendrocyte precursor cells and oligodendrocytes). We observed a high correlation between the predicted cell proportions and PCs, indicating that cell-proportion differences contribute to a substantial variance in bulk gene expression levels (Supplementary Fig. 36).