To generate residualized expression for our prediction models, we fitted a linear model with lmFit from limma to normalize expression (see ‘eQTL analysis’) and covariates (see ‘Global ancestry-associated differential expression analysis’; equation (3)). Using this model, we regressed out covariates from normalized expression using the residuals function in R (v.4.0.3).