-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.Rmd
59 lines (43 loc) · 2.12 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
output: github_document
csl: https://raw.githubusercontent.com/citation-style-language/styles/6152ccea8b7d7a472910d36524d1bf3557a83bfc/dependent/nature-genetics.csl
bibliography: references.bib
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# ldscr
<!-- badges: start -->
[![R-CMD-check](https://github.com/mglev1n/ldscr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/mglev1n/ldscr/actions/workflows/R-CMD-check.yaml) [![test-coverage](https://github.com/mglev1n/ldscr/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/mglev1n/ldscr/actions/workflows/test-coverage.yaml)
<!-- badges: end -->
The goal of ldscr is to provide functionality to estimate genetic heritability and cross-trait genetic correlations from GWAS summary statistics using LD score regression within R. Details of LD score regression for estimation of heritabliity and genetic correlations have been previously published.[@Bulik-Sullivan2015; @Bulik-Sullivan2015a] This package adapts code and functionality originally implemented in [GenomicSEM](https://github.com/GenomicSEM/GenomicSEM).[@Grotzinger2019]
## Installation
You can install the development version of ldscr from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("mglev1n/ldscr")
```
## Usage
`ldsc_h2()` can be used to estimate heritability. Sample GWAS data is provided in `sumstats_munged_example()`. Users can utilize built-in LD reference data, or provide their own.
```{r ldsc_h2_example, eval=FALSE}
library(ldscr)
df <- sumstats_munged_example(example = "BMI")
h2_res <- ldsc_h2(munged_sumstats = df, ancestry = "EUR")
```
`ldsc_rg()` can be used to estimate cross-trait genetic correlations between two or more traits.
```{r ldsc_rg_example, eval=FALSE}
rg_res <- ldsc_rg(
munged_sumstats = list(
"APOB" = sumstats_munged_example(example = "APOB"),
"LDL" = sumstats_munged_example(example = "LDL")
),
ancestry = "EUR"
)
```
## References