we used the multitrait-based conditional and joint analysis (mtCOJO) package [34], which uses only meta-GWAS summary statistics to statistically isolate independent genetic associations. Using mtCOJO, we calculated SNP associations with MDD conditional on loneliness (MDD|loneliness), and vice-versa (loneliness|MDD), and calculated polygenic scores from the MDD|loneliness and loneliness|MDD summary statistics using the best fit P thresholds above. All polygenic scores were generated by the default pruning and thresholding parameters in PRSice v2 [32] (Supplementary Methods) and were scaled to have an SD of 1. Risk ratios (odds or hazard) reflect the risk increase per 1-SD increase in the polygenic score.