## ✔ Setting active project to
## '/Users/nmounier/Documents/SGG/Projects/Packaging/bGWAS'
:arrow_right: ESHG poster is available here.
:information_source: bGWAS
has been updated to version 1.0.3.
This update should solve the compatibility issues that arose with more
recent R versions, but does not affect the analyses results. Note that
you might need to update some packages to be able to continue using
bGWAS
.
:warning: 28/10/2019 : The variance of the prior effects has been
modified. If you used a previous version of the package, please re-run
your analysis using this new version to get more accurate results.
Check the NEWS to learn more about what has been modified!
:warning: If you downloaded the Z-Matrix files before 20/08/2019, they are now obsolete and you will not be able to use them with the newest version of the package. Note: some Prior GWASs have been removed, you can find more details here.
bGWAS is an R-package to perform a Bayesian GWAS (Genome Wide Association Study), using summary statistics from a conventional GWAS as input. The aim of the approach is to increase power by leveraging information from related traits and by comparing the observed Z-scores from the focal phenotype (provided as input) to prior effects. These prior effects are directly estimated from publicly available GWASs (currently, a set of 38 studies, last update 20-08-2019 - hereinafter referred to as “prior GWASs” or “risk factors”). Only prior GWASs having a significant causal effect on the focal phenotype, identified using a multivariable Mendelian Randomization (MR) approach, are used to calculate the prior effects. Causal effects are estimated masking the focal chromosome to ensure independence, and the prior effects are estimated as described in the figure below.
Observed and prior effects are compared using Bayes Factors. Significance is assessed by calculating the probability of observing a value larger than the observed BF (P-value) given the prior distribution. This is done by decomposing the analytical form of the BFs and using an approximation for most BFs to make the computation faster. Prior, posterior and direct effects, alongside BFs and p-values are returned. Note that prior, posterior and direct effects are estimated on the Z-score scale, but are automatically rescaled to beta scale if possible.
The principal functions available are:
bGWAS()
main function that calculates prior effects from prior GWASs,
compares them to observed Z-scores and returns an object of class
bGWAS
list_priorGWASs()
directly returns information about the prior GWASs that can be used
to calculate prior effects
select_priorGWASs()
allows a quick selection of prior GWASs (to include/exclude specific
studies when calculating prior effects)
extract_results_bGWAS()
returns results (prior, posterior and direct estimate /
standard-error + p-value from BF for SNPs) from an object of class
bGWAS
manhattan_plot_bGWAS()
creates a Manhattan Plot from an object of class bGWAS
extract_MRcoeffs_bGWAS()
returns multivariable MR coefficients (1 estimate using all
chromosomes + 22 estimates with 1 chromosome masked) from an object
of class bGWAS
coefficients_plot_bGWAS()
creates a Coefficients Plot (causal effect of each prior GWASs on
the focal phenotype) from an object of class bGWAS
heatmap_bGWAS()
creates a heatmap to represent, for each significant SNP, the
contribution of each prior GWAS to the estimated prior effect from
an object of class bGWAS
All the functions available and more details about their usage can be found in the manual.
You can install the current version of bGWAS
with:
# Directly install the package from github
# install.packages("remotes")
remotes::install_github("n-mounier/bGWAS")
library(bGWAS)
To run the analysis with bGWAS
two inputs are needed:
Can be a regular (space/tab/comma-separated) file or a gzipped file
(.gz) or a data.frame
. Must contain the following columns, which can
have alternative names:
rs
or rsid
, snp
, snpid
, rnpid
Alternate (effect) allele: a1
or alt
, alts
Reference allele: a2
or a0
, ref
Z-statistics: z
or Z
, zscore
b
or beta
, beta1
Standard error: se
or std
If you want the prior/posterior/corrected effects to be rescaled, please make sure to provide effect sizes and standard errors instead of (or in addition to) Z-statistics.
These files should be downloaded separately and stored in ~/ZMatrices
or in the folder specified when launching the analysis. These files
contains the Z-scores for all prior GWASs :
You can download these files using this link or following the instructions below. Please note that your input GWAS will be merged with the Z-Matrix files (using rsid and alleles to align effects), and that the results reported will use the Z-Matrix files chr:pos information (GRCh37 - since UK10K data has been used to imputed the prior GWASs).
wget https://drive.switch.ch/index.php/s/jvSwoIxRgCKUSI8/download -O ZMatrices.tar.gz
tar xzvf ZMatrices.tar.gz
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.