This repo provides our script to reproduce genetic correlation corrplot
(Fig. 2) based on bivariate LD score regression results (Kanai, M. et al., Nat. Genet. 2018).
install.packages("dplyr")
devtools::install_github("mkanai/corrplot")
We modified corrplot to visualize pairwise genetic correlations estimated via bivariate LD score regression. Larger squares correspond to more significant FDRs (corrplot(method = 'psquare', p.mat = p.mat, ...)
). Significant correlations (FDR < 0.05) are indicated by asterisks (corrplot(sig = 'pch', sig.level = 0.05, pch = '*')
).
Rscript plot_corrplot_rg.R input_example/input_rg.txt input_example/traitlist.txt
input_rg.txt
)This file provides a list of all pairwise genetic correlations estimated via ldsc software. The script expects all rows are unique (i.e., one row per each pair of traits). The required fields are as follows:
p1_category
: Trait category of trait 1p1
: Trait 1p2_category
: Trait category of trait 2p2
: Trait 2rg
: Genetic correlationp
: P-valueq
: FDR q-valuetraitlist.txt
)This file provides a list of traits and their categories. It defines a color of each category in a figure. The required fields are as follows:
CATEGORY
: Trait categoryTRAIT
: Trait nameCOLOR
: Category colorAn example output is shown below. To get the published figure, we edited a pdf output using Adobe Illustrator.
The original corrplot
package:
The example data and published figure:
Masahiro Kanai ([email protected])
http://mkanai.github.io/