This repository contains the scripts I used for the CAS (r)eQTL project.
Preprint: https://www.biorxiv.org/content/10.1101/683086v1
Peer reviewed article: https://www.nature.com/articles/s41467-020-17477-x
Huang, Q.Q., Tang, H.H.F., Teo, S.M., Ritchie, S.C., Nath, A.P. et al. Neonatal genetics of gene expression reveal the origins of autoimmune and allergic disease risk. Nat Commun 11, 3761 (2020)
Generate input files for Matrix eQTL.
Perform eQTL mapping using Matrix eQTL.
Perform eigenMT to estimate the number of independent SNPs/tests in the 2-Mb window for each gene.
Correct for multiple testing (local correction: eigenMT; global correction: BH FDR) and get the list of significant cis-eQTLs.
For eGenes that were significant in both resting and stimulated cells (monocytes or T cells), calculate the LD correlation between the two top eSNPs from these two conditions. (This is actually for response eQTL mapping)
Two stage conditional analysis.
For each significant eQTL SNP, calculate the LD correlation with the top eSNP of the corresponding gene.
Perform interaction tests on top eSNPs and run permutations.
Apply BH-FDR on permutation adjusted P-values to correct for multiple testing and get significant reQTLs.
Gather some more information on the reQTLs for supplemental table 7 and 8.
Perform genome-wide eQTL mapping using Matrix eQTL (output and write tests with P-value ≤1e-5).
Multiple testing using three ways: genome-wide FDR, gene-level FDR, gene-level Bonferroni.
Get all mediation trios (eQTL–cis-eGene–trans-eGene) and perform mediation analysis.
Apply BH FDR controlling procedure to correct for multiple testing.
Calculate the LD correlation between each trans-eQTL SNP and the corresponding top SNP, and gather information for supplemental table 10.
Find loci where GWAS and eQTL signals have overlap, and prepare input data for coloc.
Perform colocalisation analysis using the R package coloc.
Get genetic instrumental variables and perform MR analysis using the R package TwoSampleMR.
Extract MR test statistics.
Perform the MR analysis again using Scott’s codes. The genetic IVs were harmonised and selected by the TwoSampleMR package.
Select significant causal associations and generate a supplementary table.
I used this script from Scott Ritchie (https://github.com/sritchie73) to perform MR analysis and generate dose responsive curves.