Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Ararder/ldsR
A R implementation of ldsc (https://github.com/bulik/ldsc)
https://github.com/Ararder/ldsR
Last synced: 2 months ago
JSON representation
A R implementation of ldsc (https://github.com/bulik/ldsc)
- Host: GitHub
- URL: https://github.com/Ararder/ldsR
- Owner: Ararder
- License: mit
- Created: 2024-06-28T08:17:13.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-08-14T13:55:15.000Z (6 months ago)
- Last Synced: 2024-08-14T17:58:39.864Z (6 months ago)
- Language: R
- Homepage: http://arvidharder.com/ldsR/
- Size: 43.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-complex-trait-genetics - LDSR - memory summary statistics. (genetic architecture)
- awesome-complex-trait-genetics - LDSR - memory summary statistics. (genetic architecture)
README
# ldsR
The core functions of the [ldsc python package](https://github.com/bulik/ldsc) such as
estimating heritability, intercept, genetic correlations and partitioned heritability
are ubiquitous in the analysis of genetic data.However, the LDSC github is not maintained, and the original python version (2.7) id deprecated.
Here we introduce the core ldsc algorithms rewritten in R and make the most
common reference data available within the R package making the estimation of
genetic correlations, heritability, intercept and partitioned heritabiliy easier than ever.Compare the code to estimate heritability with ldsc using the command line interface with ldsR:
``` bash
# NOTE that these links are no longer valid
wget https://data.broadinstitute.org/alkesgroup/LDSCORE/eur_w_ld_chr.tar.bz2
wget https://data.broadinstitute.org/alkesgroup/LDSCORE/w_hm3.snplist.bz2
tar -jxvf eur_w_ld_chr.tar.bz2
unzip -o pgc.cross.scz.zip
bunzip2 w_hm3.snplist.bz2munge_sumstats.py \
--sumstats pgc.cross.SCZ17.2013-05.txt \
--N 17115 \
--out scz \
--merge-alleles w_hm3.snplistldsc.py \
--h2 scz.sumstats.gz \
--ref-ld-chr eur_w_ld_chr/ \
--w-ld-chr eur_w_ld_chr/ \
--out scz
```In ldsR, the ldscore data contained in the eur_w_ld_chr folder comes with the R package, and the core functions take only a few seconds to run on a modern computer.
``` r
library(ldsR)
sumstats <- readr::read_tsv("my_sumstats.tsv") |>
munge()
h2_res <- ldsc_h2(sumstats)# estimate rg with itself
rg_est = ldsc_rg(sumstats, sumstats)
```## Installation
You can install the development version of ldsR from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("Ararder/ldsR")
```