Skip to content

weng-lab/ldr

Repository files navigation

ldr: Dockerized LD regression

This repository provides a Dockerized version of ldsc, a tool for performing LD Score regression. It is intended to facilitate the production of custom binary annotations for SNPs and computing partitioned heritability as described in Finucane, HK, et al. Partitioning heritability by functional annotation using genome-wide association summary statistics. Nature Genetics, 2015. The core functionality of the tool was implemented by Bulik-Sullivan et. al. and is available at https://github.com/bulik/ldsc.

Running

We encourage running this software as a Docker image, which is publicly available through GitHub packages. To pull the image, first install Docker, then run:

docker pull docker.pkg.github.com/weng-lab/ldr/ldr:latest

Annotating SNPs

To perform custom partitioned heritability analysis, SNPs must first be annotated according to their intersection with custom sets of annotations. This package will generate custom binary annotations in the approriate format. Run

docker run \
    --volume /path/to/inputs:/input \
    --volume /path/to/annotations:/output \
    ghcr.io/weng-lab/ldr/ldr:latest \
    python3 -m ldr.annotations \
        --files /input/annotations1.bed /input/annotations2.bed ... \
        --file-output-prefix annotations \
        --output-directory /output

By default, this will use the HapMap3 SNPs provided in the baseline model described in the LDSC wiki, and it will estimate LD scores for the annotations as described in the final section of this tutorial https://github.com/bulik/ldsc/wiki/LD-Score-Estimation-Tutorial. The output directory produced by this script may be used directly as input to partitioned heritability calculations:

docker run \
    --volume /path/to/annotations:/input \
    ghcr.io/weng-lab/ldr/ldr:latest \
    python3 -m ldr.h2 \
        --ld-scores /input \
        --ld-prefix annotations \
        --summary-statistics summary-stats.txt > partitioned-heritability.txt

This will perform partitioned heritability computations on the summary statistics in summary-stats.txt given the annotations computed above, and will write results to partitioned-heritability.txt outside the Docker image. The summary statistics must be in the format described in the partitioned heritability tutorial.

For developers

Contributions to the code are welcome via pull request. First clone this repo:

git clone git@github.com:/weng-lab/ldr

After making changes, run unit tests with

scripts/test.sh