wouterpeyrot / CCGWAS

18 stars 6 forks source link

Running CC-GWAS

The CCGWAS R package provides a tool for case-case association testing of two different disorders based on their respective case-control GWAS results. The CC-GWAS method is described in detail in Peyrot & Price. 2021 Nature Genetics. A tutorial video on how to apply CC-GWAS is avalable here.

Getting Started

Install the CCGWAS R package as follows:

library(data.table)
library(R.utils)
library(devtools)
install_github("wouterpeyrot/CCGWAS")
library(CCGWAS)

If the R packages data.table, R.utils or devtools have not been installed in R, you can install them with the R command: install.packages("...").

Running CC-GWAS

The CCGWAS R package contains one function CCGWAS(). The input arguments of CCGWAS() are:

Output files

The CCGWAS() function provides three output files. The outcome_file.log file provides a logfile of the analyses. This file also reports the CC-GWASOLS weights and the CC-GWASExact weights. The outcome_file.pdf file provides a plot of the genetic distances between cases and controls of both disorders in terms of FST,causal. The outcome_file.results.gz file reports results of the case-case association analyses. SNPs with significant case-case association are labelled as 1 in the CCGWAS_signif column. The other columns are

When setting save.all=TRUE (see above), CC-GWAS additionally outputs a file outcome_file.results.ALL.gz. In addition to the output columns above, this file also contains the following columns:

The file outcome_file.results.ALL.gz may also contain SNPs with OLS_pval<5e-8 that should be removed to protect against type I error (which are per default removed from outcome_file.results.gz). When wanting to work with outcome_file.results.ALL.gz, these SNPs can be removed in R with:

library(data.table)
d <- as.data.frame(fread("outcome_file.results.ALL.gz",header=TRUE))
d <- d[ {d$OLS_pval<5e-8 & d$CCGWAS_signif==0}==FALSE ,] 

Using CC-GWAS results for follow-up analyses

We advise to use the results from the CC-GWASOLS component (OLS_beta, OLS_se, OLS_pval) for clumping and for polygenic risk score analyses. We advise to use the results from the CC-GWASExact component (Exact_beta, Exact_se, Exact_pval) for genetic correlation analyses.

Running the example in the test folder

Download the test.casecontrol.gwas.BIP.10snps.txt.gz, and test.casecontrol.gwas.SCZ.10snps.txt.gz files from the test folder and place in your working directory. Run the CCGWAS() function with:

library(data.table)
library(R.utils)
library(CCGWAS)
CCGWAS( outcome_file = "test.out" , A_name = "SCZ" , B_name = "BIP" , 
        sumstats_fileA1A0 = "./test.casecontrol.gwas.SCZ.10snps.txt.gz" ,
        sumstats_fileB1B0 = "./test.casecontrol.gwas.BIP.10snps.txt.gz" ,
        K_A1A0 = 0.004 , K_A1A0_high = 0.01 , K_A1A0_low = 0.004 ,  
        K_B1B0 = 0.01 , K_B1B0_high = 0.02 , K_B1B0_low = 0.005 , 
        h2l_A1A0 = 0.2 , h2l_B1B0 = 0.20 , rg_A1A0_B1B0 = 0.70 , intercept_A1A0_B1B0 = 0.2425 , m = 1e4 ,  
        N_A1 = 40675 , N_B1 = 20352 , N_A0 = 64643 , N_B0 = 31358 , N_overlap_A0B0 = 24265 )

This provides the results for 10 SNPs from the schizophrenia (SCZ) vs bipolar disorder (BIP) case-case comparison, described in detail in Peyrot & Price. 2021 Nature Genetics.