This repo provides our scripts to plot genetic correlation network (Fig. 3) and cell-type specificity network (Fig. 6) based on bivariate/stratified LD score regression results (Kanai, M. et al., Nat. Genet. 2018).
- R with igraph, dplyr, stringr and Hmisc packages.
- To install these packages, type
install.packages(c("igraph", "tidyverse", "Hmisc"))
in R console.
- To install these packages, type
Genetic correlation network was designed to visualize cross-phenotype relationships (pairwise genetic correlation matrix) across dozens of traits estimated via bivariate LD score regression. Each circle represents a trait and each edge represents a significant genetic correlation (FDR < 0.05). Positive and negative genetic correlations are indicated by color. Thicker edges correspond to more significant FDRs.
Rscript plot_network_rg.R input_example/input_rg.txt input_example/traitlist.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-value
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 color
An example output is shown below. Since layouts are determined by the Fruchterman–Reingold algorithm, they are slightly different at each runtime. To get the final figure, we edited a pdf output using Adobe Illustrator.
Cell-type specificity network was designed to summarize cell-type specific enrichments estimated via stratified LD score regression. Each circle represents a trait, and each square represents a cell type. Arrows denote significant heritability enrichments for the indicated traits (FDR < 0.01). Thicker arrows correspond to more significant FDRs.
Rscript plot_network_ct.R input_example/input_ct.txt input_example/traitlist.txt
This file provides a concatenated list of all cell-type specific enrichments estimated via ldsc software. We ran the analysis using the 220 cell-type specific annotations based on the Roadmap Project (Finucane, H. et al., Nat. Genet. 2015). The required fields are as follows:
trait_category
: Trait categorytrait
: Traitcategory
: Cell-type categorycell_type_clean
: Cell typeCoefficient
: Estimated coefficientCoefficient_p
: P-valueCoefficient_q
: FDR q-value
This file is exactly the same as the aforementioned trait list (for genetic correlation network).
An example output is shown below. Again, layouts are slightly different at each runtime and we edited a pdf output using Adobe Illustrator to get the final figure.
When using these scripts, please cite the following paper.
- Kanai, M., et al. Genetic analysis of quantitative traits in the Japanese population links cell types to complex human diseases. Nat. Genet. (2018) doi:10.1038/s41588-018-0047-6
Masahiro Kanai ([email protected])