Zhang Lab@Columbia by Fang Li [2019-08-01]
GWAS locus that colocalized with eQTL is one of the primary and scalable signal for functional follow-up analyses.
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("snpStats")
install("coloc")
Read sample data into R:
You can download the sample files by right clicking the link: GWAS and eQTL datasets.
eqtl <- read.table(file="[path to]/Artery_Coronary_v7_eQTL_PHACTR1.txt", header=T, as.is=T);
head(eqtl)
gwas <- read.table(file="[path to]/CAD_GWAS.txt", header=T, as.is=T);
head(gwas)
Merge gwas and eqtl data sets by only shared “rs _ id”:
input <- merge(eqtl, gwas, by="rs_id", all=FALSE, suffixes=c("_eqtl","gwas")
head(input)
Optinal: provide suffix to differentiate data source from gwas or eqtl.
Run coloc using coloc.abf() fuction:
result <- coloc.abf(dataset1=list(pvalues=input$pval_nominal_gwas, type="cc", S=0.33, N=nrow(gwas)) dataset2=list(pvalues=input$pval_nominal_eqtl, type="quant", N=nrow(eqtl)), MAF=input$maf)
Comments: coloc.abf() function needs two named lists (gwas and eqtl) that contain p-values, the type of study(“cc” for case-control studies, “quant” for quantitative traits) and sample size(N). s= the proportion of samples are cases, when type=”cc”. It also needs the minor allele frequency.
A posterior probability of ≥75% is considered strong evidence of the eQTL-GWAS pair influencing both the expression and GWAS trait at a particular region.
Define file names of the GWAS and eQTL data sets:
gwas_fn="[path to]/CAD_GWAS.txt"
eqtl_fn="[path to]/Artery_Coronary_v7_eQTL_PHACTR1.txt"
marker_col="rs_id"
pval_col="pval_nominal"
Run locuscompare to visualize:
locuscompare(in_fn1=gwas_fn, in_fn2=eqtl_fn, title1="GWAS", title2="eQTL", marker_col1= marker_col, pval_col1=pval_col, marker_col2=marker_col, pval_col2=pval_col))
Results output:
Materials here are licensed as CC BY-NC-SA 4.0 Creative Commons License.