Last updated: 2026-04-29

Checks: 6 1

Knit directory: QBS-statsgen/

This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20231230) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version f627c66. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    data/e2/
    Ignored:    output/

Untracked files:
    Untracked:  .DS_Store
    Untracked:  analysis/.DS_Store
    Untracked:  analysis/figure/

Unstaged changes:
    Modified:   analysis/e2-finemapping.Rmd
    Modified:   analysis/e2-ldsc.Rmd

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/e2-ldsc.Rmd) and HTML (docs/e2-ldsc.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd f627c66 Siming 2026-04-27 Update exercise 2 content, add 2a-2c links to index
html f627c66 Siming 2026-04-27 Update exercise 2 content, add 2a-2c links to index
html e274b8f ly979 2025-04-27 Build site.
Rmd 6d0432d ly979 2025-04-27 Update

Before the Class

Install LDSC

There are two options for installing LDSC. If you haven’t installed Anaconda, please check how to install anaconda first.

Option 1: Original LDSC (Python 2)

The original LDSC (https://github.com/bulik/ldsc) requires Python 2, which reached end-of-life in January 2020. It can still be installed via conda using the environment file provided in the repository. Use this option if you are working on a cluster (e.g., Dartmouth Discovery) where a compatible environment is already available.

mkdir ~/tools && cd ~/tools
git clone https://github.com/bulik/ldsc.git
cd ldsc
conda env create --file environment.yml
conda activate ldsc

The environment.yml file is included in the repo root. If conda has trouble resolving packages from bioconda alone, add defaults and conda-forge to the channels before running conda env create:

name: ldsc
channels:
- defaults
- conda-forge
- bioconda
dependencies:
- python=2.7
- bitarray=0.8
- nose=1.3
- pybedtools=0.7
- pip
- pip:
  - scipy==0.18
  - pandas==0.20
  - numpy==1.16

Data Preparation

Blood cells play essential roles in human health, underpinning physiological processes such as immunity, oxygen transport, and clotting, which when perturbed cause a significant global health burden. This study integrates data from UK Biobank and a large-scale international collaborative effort, including data for 563,085 European ancestry participants, and discover 5,106 new genetic variants independently associated with 29 blood cell phenotypes covering a range of variation impacting hematopoiesis. For this exercise, we will focus on just one blood cell phenotype, monocyte count, which can be downloaded from GWAS Catalog for N=408,112 UK individuals. But we have prepared a cleaned GWAS summary statistics https://rcweb.dartmouth.edu/Szhao/QBS148-statsgen/e2/.

Download sample summary statistics

# sumstats
e2/ldsc/Mono_count_hg38_sumstats.txt.gz
# CHR, BP, SNP, ALT, REF, BETA (or OR), SE, N, P

Download reference files

All files can be also downloaded from LDSC reference data but we have provided necessary reference files for our exercises via download from here: https://rcweb.dartmouth.edu/Szhao/QBS148-statsgen/e2/ldsc/.

# Files you should have downloaded 

# baselineLD_v2.2 files 
# pre-computed LD scores based on 126 baseline annotations 
e2/ldsc/baselineLD.22 

# pre-computed weights 
e2/ldsc/weights.hm3_noMHC.22 

# plink files for 1000G European ancestry 
e2/ldsc/1000G.EUR.hg38.22 

# snp list
e2/ldsc/hm3_no_MHC.list.txt  

# annotation file 
e2/ldsc/ATAC_annot_hg38.bed

Introduction

LDSC is one of the most commonly used command line tool to estimate inflation, heritability, genetic correlation and cell/tissue type specificity from GWAS summary statistics.

LD: Linkage disequilibrium

Linkage disequilibrium (LD) : non-random association of alleles at different loci in a given population. (Wiki)

LD score

LD score \(l_j\) for a SNP \(j\) is defined as the sum of \(r^2\) for the SNP and other SNPs in a region.

\[ l_j= \Sigma_k{r^2_{j,k}} \]

LD score regression

Key idea: A variant will have higher test statistics if it is in LD with causal variant, and the elevation is proportional to the correlation ( \(r^2\) ) with the causal variant.

\[ E[\chi^2|l_j] = {{Nh^2l_j}\over{M}} + Na + 1 \]

  • \(N\): sample size.
  • \(M\) : number of SNPs.
  • \(h^2\) : observed-scale heritability
  • \(a\) : the effect of confounding factors, including cryptic relatedness and population stratification.

For more details of LD score regression, please refer to : - Bulik-Sullivan, Brendan K., et al. “LD Score regression distinguishes confounding from polygenicity in genome-wide association studies.” Nature genetics 47.3 (2015): 291-295.

Munge sumstats

Before the analysis, we need to format and clean the raw sumstats.

!!! note rsID is used here. If the sumstats only contained id like CHR:POS:REF:ALT, annotate it first (not an issue here).

python ~/tools/ldsc/munge_sumstats.py \
    --sumstats e2/ldsc/Mono_count_hg38_sumstats.txt.gz \
    --a1 ALT \
    --a2 REF \
    --chunksize 500000 \
    --out Mono_count_hg38
*********************************************************************
* LD Score Regression (LDSC)
* Version 1.0.1
* (C) 2014-2019 Brendan Bulik-Sullivan and Hilary Finucane
* Broad Institute of MIT and Harvard / MIT Department of Mathematics
* GNU General Public License v3
*********************************************************************
Call: 
./munge_sumstats.py \
--out /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/Mono_count_hg38 \
--chunksize 500000 \
--a1 ALT \
--a2 REF \
--sumstats /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/Mono_count_hg38_sumstats.txt.gz 

Interpreting column names as follows:
N:  Sample size
P:  p-Value
BETA:   [linear/logistic] regression coefficient (0 --> no effect; above 0 --> A1 is trait/risk increasing)
SNP:    Variant ID (e.g., rs number)
ALT:    Allele 1, interpreted as ref allele for signed sumstat.
REF:    Allele 2, interpreted as non-ref allele for signed sumstat.

Reading sumstats from /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/Mono_count_hg38_sumstats.txt.gz into memory 500000 SNPs at a time.
........................................................................... done
Read 37156235 SNPs from --sumstats file.
Removed 1037263 SNPs with missing values.
Removed 0 SNPs with INFO <= 0.9.
Removed 0 SNPs with MAF <= 0.01.
Removed 0 SNPs with out-of-bounds p-values.
Removed 5484727 variants that were not SNPs or were strand-ambiguous.
30634245 SNPs remain.
Removed 0 SNPs with duplicated rs numbers (30634245 SNPs remain).
Removed 0 SNPs with N < 272074.666667 (30634245 SNPs remain).
Median value of BETA was -4.57111e-05, which seems sensible.
Writing summary statistics for 30634245 SNPs (30634245 with nonmissing beta) to /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/Mono_count_hg38.sumstats.gz.

Metadata:
Mean chi^2 = 1.591
Lambda GC = 1.147
Max chi^2 = 1401.484
98665 Genome-wide significant SNPs (some may have been removed by filtering).

Conversion finished at Sun Apr 27 14:17:10 2025
Total time elapsed: 5.0m:52.37s

After munging, you will get a munged and formatted files:

/Mono_count_hg38.sumstats.gz

And we will use this file to run LD score regression.

LD score regression

Univariate LD score regression is utilized to estimate heritability and confounding factors (cryptic relatedness and population stratification) of a certain trait.

  • Reference : Bulik-Sullivan, Brendan K., et al. “LD Score regression distinguishes confounding from polygenicity in genome-wide association studies.” Nature genetics 47.3 (2015): 291-295.

One can use pre-computed LD scores from 1000 Genomes for matching population (EUR, EAS, etc.) including baseline models curated by the Price group hosted on LDSC reference data server. We’ll be using baselineLD_v2.2 for our LDSC run.

* baseline-LD model v2.2: our last and recommended version of the baseline-LD model (97 annotations)
                          includes 86 annotations from the baseline model v2.1 and 11 new annotations from Hujoel et al. 2019 AJHG
              (5 new binary annotations and corresponding flanking annotations + 1 continuous count annotation)
              4 human promoter annotation from Villar et al. 2015 Cell (promoter, promoter of ExAC genes, and 2 corresponding flanking annotations)
              3 human enhancer annotation from Villar et al. 2015 Cell (enhancer and corresponding flanking annotation + enhancer-enhancer conservation count)
              2 human promoter sequence age annotation from Marnetto et al. 2018 AJHG (including 1 flanking annotation)
              2 human enhancer sequence age annotation from Marnetto et al. 2018 AJHG (including 1 flanking annotation)

Using the munged sumstats and pre-computed LD scores and weights, we can run LDSC for one chromosome:

Run for one chromosome

We can perform LDSC for one chromosome at a time (e.g. chr 22)

python ~/tools/ldsc/ldsc.py \
  --h2  Mono_count_hg38.sumstats.gz \
  --ref-ld e2/ldsc/baselineLD.22 \
  --w-ld e2/ldsc/weights.hm3_noMHC.22 \
  --out Mono_count_hg38.chr22

The weights refer to per-SNP LD‐scores computed on your reference panel restricted to the HapMap-3 SNP set (the “hm3” SNPs), with the MHC region excluded (“noMHC”), and with whatever LD window you chose (default is 1 cM). Those LD‐scores are then used as regression weights.

Let’s check the results:

*********************************************************************
* LD Score Regression (LDSC)
* Version 1.0.1
* (C) 2014-2019 Brendan Bulik-Sullivan and Hilary Finucane
* Broad Institute of MIT and Harvard / MIT Department of Mathematics
* GNU General Public License v3
*********************************************************************
Call: 
./ldsc.py \
--h2 /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/Mono_count_hg38.sumstats.gz \
--out /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/Mono_count_hg38.chr22 \
--w-ld /dartfs-hpc/rc/home/b/f005d5b/Zhao-labshare/liyang/enrichment/LDSCORE/weights/weights.hm3_noMHC.22 \
--ref-ld /dartfs-hpc/rc/home/b/f005d5b/Zhao-labshare/liyang/enrichment/LDSCORE/baselineLD_v2.2/baselineLD.22 

Beginning analysis at Sun Apr 27 15:25:06 2025
Reading summary statistics from /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/Mono_count_hg38.sumstats.gz ...
Read summary statistics for 30634245 SNPs.
Reading reference panel LD Score from /dartfs-hpc/rc/home/b/f005d5b/Zhao-labshare/liyang/enrichment/LDSCORE/baselineLD_v2.2/baselineLD.22 ... (ldscore_fromlist)
Read reference panel LD Scores for 17450 SNPs.
Removing partitioned LD Scores with zero variance.
Reading regression weight LD Score from /dartfs-hpc/rc/home/b/f005d5b/Zhao-labshare/liyang/enrichment/LDSCORE/weights/weights.hm3_noMHC.22 ... (ldscore_fromlist)
Read regression weight LD Scores for 17450 SNPs.
After merging with reference panel LD, 17437 SNPs remain.
After merging with regression SNP LD, 17437 SNPs remain.
WARNING: number of SNPs less than 200k; this is almost always bad.
Removed 0 SNPs with chi^2 > 408.112 (17437 SNPs remain)
Total Observed scale h2: 0.0074 (0.0019)
Categories: baseL2_0 Coding_UCSCL2_0 Coding_UCSC.flanking.500L2_0 Conserved_LindbladTohL2_0 Conserved_LindbladToh.flanking.500L2_0 CTCF_HoffmanL2_0 CTCF_Hoffman.flanking.500L2_0 DGF_ENCODEL2_0 DGF_ENCODE.flanking.500L2_0 DHS_peaks_TrynkaL2_0 DHS_TrynkaL2_0 DHS_Trynka.flanking.500L2_0 Enhancer_AnderssonL2_0 Enhancer_Andersson.flanking.500L2_0 Enhancer_HoffmanL2_0 Enhancer_Hoffman.flanking.500L2_0 FetalDHS_TrynkaL2_0 FetalDHS_Trynka.flanking.500L2_0 H3K27ac_HniszL2_0 H3K27ac_Hnisz.flanking.500L2_0 H3K27ac_PGC2L2_0 H3K27ac_PGC2.flanking.500L2_0 H3K4me1_peaks_TrynkaL2_0 H3K4me1_TrynkaL2_0 H3K4me1_Trynka.flanking.500L2_0 H3K4me3_peaks_TrynkaL2_0 H3K4me3_TrynkaL2_0 H3K4me3_Trynka.flanking.500L2_0 H3K9ac_peaks_TrynkaL2_0 H3K9ac_TrynkaL2_0 H3K9ac_Trynka.flanking.500L2_0 Intron_UCSCL2_0 Intron_UCSC.flanking.500L2_0 PromoterFlanking_HoffmanL2_0 PromoterFlanking_Hoffman.flanking.500L2_0 Promoter_UCSCL2_0 Promoter_UCSC.flanking.500L2_0 Repressed_HoffmanL2_0 Repressed_Hoffman.flanking.500L2_0 SuperEnhancer_HniszL2_0 SuperEnhancer_Hnisz.flanking.500L2_0 TFBS_ENCODEL2_0 TFBS_ENCODE.flanking.500L2_0 Transcr_HoffmanL2_0 Transcr_Hoffman.flanking.500L2_0 TSS_HoffmanL2_0 TSS_Hoffman.flanking.500L2_0 UTR_3_UCSCL2_0 UTR_3_UCSC.flanking.500L2_0 UTR_5_UCSCL2_0 UTR_5_UCSC.flanking.500L2_0 WeakEnhancer_HoffmanL2_0 WeakEnhancer_Hoffman.flanking.500L2_0 GERP.NSL2_0 GERP.RSsup4L2_0 MAFbin1L2_0 MAFbin2L2_0 MAFbin3L2_0 MAFbin4L2_0 MAFbin5L2_0 MAFbin6L2_0 MAFbin7L2_0 MAFbin8L2_0 MAFbin9L2_0 MAFbin10L2_0 MAF_Adj_Predicted_Allele_AgeL2_0 MAF_Adj_LLD_AFRL2_0 Recomb_Rate_10kbL2_0 Nucleotide_Diversity_10kbL2_0 Backgrd_Selection_StatL2_0 CpG_Content_50kbL2_0 MAF_Adj_ASMCL2_0 GTEx_eQTL_MaxCPPL2_0 BLUEPRINT_H3K27acQTL_MaxCPPL2_0 BLUEPRINT_H3K4me1QTL_MaxCPPL2_0 BLUEPRINT_DNA_methylation_MaxCPPL2_0 synonymousL2_0 non_synonymousL2_0 Conserved_Vertebrate_phastCons46wayL2_0 Conserved_Vertebrate_phastCons46way.flanking.500L2_0 Conserved_Mammal_phastCons46wayL2_0 Conserved_Mammal_phastCons46way.flanking.500L2_0 Conserved_Primate_phastCons46wayL2_0 Conserved_Primate_phastCons46way.flanking.500L2_0 BivFlnkL2_0 BivFlnk.flanking.500L2_0 Human_Promoter_VillarL2_0 Human_Promoter_Villar.flanking.500L2_0 Human_Enhancer_VillarL2_0 Human_Enhancer_Villar.flanking.500L2_0 Ancient_Sequence_Age_Human_PromoterL2_0 Ancient_Sequence_Age_Human_Promoter.flanking.500L2_0 Ancient_Sequence_Age_Human_EnhancerL2_0 Ancient_Sequence_Age_Human_Enhancer.flanking.500L2_0 Human_Enhancer_Villar_Species_Enhancer_CountL2_0 Human_Promoter_Villar_ExACL2_0 Human_Promoter_Villar_ExAC.flanking.500L2_0
Observed scale h2: 2.3974e-02  4.5131e-03 -5.5606e-05 -2.2826e-03  4.3944e-04 -2.4931e-04  3.2541e-03  5.9221e-03 -3.8110e-03  1.6628e-04 -3.8133e-03  1.0240e-03  9.3928e-04 -6.8965e-04  3.0272e-04  5.5674e-04  3.1090e-03  2.4635e-03  3.6320e-03  3.2961e-04 -2.1033e-03  7.6185e-05  1.2154e-03 -3.8101e-03 -3.6738e-03  1.9967e-03  2.1406e-03 -1.4914e-03 -1.5075e-03 -4.0611e-04 -2.6045e-04  7.4537e-04 -1.6216e-04  8.5635e-05  1.0074e-03  2.3104e-04 -4.9636e-05 -2.9521e-03  1.8174e-03 -1.2250e-03 -5.1034e-04 -5.5351e-03 -8.2694e-03  2.0374e-04 -1.4253e-03 -1.1512e-03  9.7744e-04  6.5009e-04  9.8201e-05 -1.2468e-03  9.3430e-04  2.2808e-03 -2.3039e-03 -4.2799e-03 -1.1273e-04 -5.0694e-05  1.0628e-03  2.4237e-04 -1.3074e-03  7.2920e-04  1.3082e-03  1.0360e-05  4.3775e-04 -1.0853e-03 -3.2140e-04  1.2783e-04  9.5206e-04  2.0225e-03 -4.0272e-03 -8.3118e-04 -6.6843e-03 -1.9421e-04  4.5839e-04  5.2473e-04  1.9968e-03  1.6979e-03  4.7946e-04 -2.1537e-04 -3.0996e-05 -6.1190e-03  2.4738e-03  2.9620e-03 -8.7066e-04
   8.8192e-04 -6.1731e-04 -1.0501e-03  1.5639e-04  1.4610e-03 -1.7990e-03  3.1350e-05  7.8625e-04 -9.1874e-04  1.9155e-04  7.6375e-04  3.4841e-04 -2.3691e-04 -8.0796e-05
Observed scale h2 SE: 0.0259 0.0041 0.004  0.0023 0.0035 0.0011 0.0021 0.0068 0.0049 0.0088 0.0061 0.0056 0.0006 0.0009 0.0017 0.0014 0.0023 0.0028 0.0031 0.0006 0.0051 0.0022 0.0056 0.0063 0.0032 0.002  0.0035 0.0017 0.0022 0.0043 0.003  0.0017 0.0011 0.0008 0.0017 0.0014 0.0008 0.0044 0.0014 0.0016 0.0005 0.0055 0.003  0.0033 0.0016 0.0013 0.0013 0.0015 0.0009 0.0006 0.002  0.002  0.0024 0.0052 0.0004 0.0003 0.0008 0.0004 0.0009 0.001  0.0013 0.0005 0.0014 0.0012 0.0007 0.0002 0.0014 0.0015 0.0039 0.001  0.007  0.0002 0.0009 0.0024 0.001  0.0019 0.0012 0.0007 0.001  0.0051 0.0015 0.0052 0.0008 0.0025 0.0011 0.0013 0.0012 0.0006 0.0022 0.0012 0.0007 0.0011 0.0006 0.0008 0.0006 0.0003 0.0002
Proportion of SNPs: 4.8594e-02  1.2732e-03  4.1663e-03  1.0537e-03  1.5100e-02  1.8394e-03  3.7972e-03  8.9005e-03  2.3029e-02  6.4463e-03  9.4145e-03  1.8136e-02  3.1155e-04  1.0643e-03  2.8878e-03  3.5455e-03  5.2464e-03  1.2270e-02  2.8400e-02  1.5642e-03  1.9219e-02  4.4010e-03  1.2054e-02  2.8173e-02  8.6506e-03  2.9489e-03  9.5277e-03  8.0169e-03  3.9715e-03  1.2132e-02  9.1604e-03  2.1833e-02  9.3699e-04  5.4096e-04  1.7660e-03  4.4092e-03  9.9566e-04  1.4485e-02  1.0286e-02  1.4725e-02  2.8984e-04  1.0025e-02  1.2651e-02  2.0353e-02  1.3734e-02  1.7156e-03  1.6540e-03  1.1523e-03  1.8546e-03  5.2863e-04  2.0166e-03  1.8493e-03  5.5093e-03  6.6082e-02  1.7836e-04  5.2054e-03  4.9191e-03  4.6720e-03  4.7260e-03  4.5600e-03  4.9032e-03  4.7788e-03  5.1784e-03  4.6492e-03  5.0018e-03 -2.4069e-03 -2.0458e-02  1.2715e-01  2.4493e-01  8.4006e-03  8.2962e-04  4.3334e-03  8.7959e-04  1.4072e-03  9.5722e-04  2.1305e-03  2.6285e-04  2.2882e-04  1.4774e-03  1.7741e-02  7.9442e-04  1.4650e-02  6.5595e-04
   7.1574e-03  1.2697e-03  2.0353e-03  1.5085e-03  3.7022e-04  2.5915e-03  9.1176e-04  3.7667e-04  4.9812e-04  3.1507e-04  6.7238e-04  4.6104e-03  2.0946e-04  4.8698e-05
Proportion of h2g: 3.2510e+00  6.1201e-01 -7.5407e-03 -3.0954e-01  5.9592e-02 -3.3809e-02  4.4128e-01  8.0309e-01 -5.1680e-01  2.2549e-02 -5.1712e-01  1.3886e-01  1.2737e-01 -9.3523e-02  4.1051e-02  7.5498e-02  4.2160e-01  3.3407e-01  4.9253e-01  4.4698e-02 -2.8523e-01  1.0331e-02  1.6482e-01 -5.1668e-01 -4.9820e-01  2.7077e-01  2.9028e-01 -2.0225e-01 -2.0443e-01 -5.5072e-02 -3.5319e-02  1.0108e-01 -2.1990e-02  1.1613e-02  1.3661e-01  3.1331e-02 -6.7310e-03 -4.0033e-01  2.4646e-01 -1.6612e-01 -6.9206e-02 -7.5060e-01 -1.1214e+00  2.7629e-02 -1.9328e-01 -1.5611e-01  1.3255e-01  8.8158e-02  1.3317e-02 -1.6908e-01  1.2670e-01  3.0930e-01 -3.1243e-01 -5.8038e-01 -1.5287e-02 -6.8745e-03  1.4413e-01  3.2868e-02 -1.7730e-01  9.8886e-02  1.7740e-01  1.4049e-03  5.9363e-02 -1.4718e-01 -4.3585e-02  1.7335e-02  1.2911e-01  2.7427e-01 -5.4613e-01 -1.1271e-01 -9.0644e-01 -2.6337e-02  6.2162e-02  7.1158e-02  2.7078e-01  2.3025e-01  6.5019e-02 -2.9206e-02 -4.2033e-03 -8.2979e-01  3.3546e-01  4.0167e-01 -1.1807e-01
   1.1960e-01 -8.3713e-02 -1.4240e-01  2.1207e-02  1.9812e-01 -2.4396e-01  4.2513e-03  1.0662e-01 -1.2459e-01  2.5976e-02  1.0357e-01  4.7247e-02 -3.2127e-02 -1.0957e-02
Enrichment: 6.6902e+01  4.8070e+02 -1.8099e+00 -2.9375e+02  3.9464e+00 -1.8381e+01  1.1621e+02  9.0229e+01 -2.2442e+01  3.4979e+00 -5.4928e+01  7.6564e+00  4.0884e+02 -8.7872e+01  1.4215e+01  2.1294e+01  8.0359e+01  2.7227e+01  1.7343e+01  2.8575e+01 -1.4841e+01  2.3475e+00  1.3673e+01 -1.8340e+01 -5.7591e+01  9.1823e+01  3.0467e+01 -2.5228e+01 -5.1475e+01 -4.5395e+00 -3.8556e+00  4.6296e+00 -2.3469e+01  2.1467e+01  7.7355e+01  7.1059e+00 -6.7603e+00 -2.7638e+01  2.3960e+01 -1.1281e+01 -2.3877e+02 -7.4875e+01 -8.8642e+01  1.3575e+00 -1.4073e+01 -9.0997e+01  8.0140e+01  7.6505e+01  7.1804e+00 -3.1985e+02  6.2829e+01  1.6725e+02 -5.6710e+01 -8.7828e+00 -8.5707e+01 -1.3207e+00  2.9300e+01  7.0350e+00 -3.7516e+01  2.1686e+01  3.6181e+01  2.9398e-01  1.1464e+01 -3.1658e+01 -8.7138e+00 -7.2024e+00 -6.3108e+00  2.1570e+00 -2.2297e+00 -1.3417e+01 -1.0926e+03 -6.0776e+00  7.0671e+01  5.0569e+01  2.8288e+02  1.0807e+02  2.4736e+02 -1.2764e+02 -2.8451e+00 -4.6774e+01  4.2228e+02  2.7418e+01 -1.8000e+02
   1.6709e+01 -6.5933e+01 -6.9964e+01  1.4059e+01  5.3515e+02 -9.4138e+01  4.6627e+00  2.8306e+02 -2.5012e+02  8.2447e+01  1.5404e+02  1.0248e+01 -1.5338e+02 -2.2499e+02
Coefficients: 2.8946e-07  2.0798e-06 -7.8308e-09 -1.2709e-06  1.7074e-08 -7.9526e-08  5.0279e-07  3.9038e-07 -9.7095e-08  1.5134e-08 -2.3765e-07  3.3126e-08  1.7689e-06 -3.8018e-07  6.1503e-08  9.2129e-08  3.4768e-07  1.1780e-07  7.5035e-08  1.2363e-07 -6.4212e-08  1.0157e-08  5.9158e-08 -7.9348e-08 -2.4917e-07  3.9728e-07  1.3182e-07 -1.0915e-07 -2.2271e-07 -1.9641e-08 -1.6682e-08  2.0030e-08 -1.0154e-07  9.2880e-08  3.3468e-07  3.0744e-08 -2.9249e-08 -1.1958e-07  1.0366e-07 -4.8810e-08 -1.0331e-06 -3.2395e-07 -3.8352e-07  5.8731e-09 -6.0888e-08 -3.9370e-07  3.4673e-07  3.3100e-07  3.1067e-08 -1.3839e-06  2.7184e-07  7.2362e-07 -2.4536e-07 -3.8000e-08 -3.7082e-07 -5.7139e-09  1.2677e-07  3.0437e-08 -1.6231e-07  9.3824e-08  1.5654e-07  1.2719e-09  4.9598e-08 -1.3697e-07 -3.7701e-08 -3.1162e-08 -2.7304e-08  9.3326e-09 -9.6470e-09 -5.8051e-08 -4.7272e-06 -2.6295e-08  3.0576e-07  2.1879e-07  1.2239e-06  4.6759e-07  1.0702e-06 -5.5224e-07 -1.2310e-08 -2.0237e-07  1.8270e-06  1.1863e-07 -7.7876e-07
   7.2295e-08 -2.8527e-07 -3.0270e-07  6.0827e-08  2.3154e-06 -4.0729e-07  2.0174e-08  1.2247e-06 -1.0821e-06  3.5671e-07  6.6645e-07  4.4338e-08 -6.6362e-07 -9.7345e-07
Coefficient SE: 3.1314e-07 1.9059e-06 5.6386e-07 1.2978e-06 1.3604e-07 3.3538e-07 3.2618e-07 4.5008e-07 1.2401e-07 8.0293e-07 3.8093e-07 1.8199e-07 1.2022e-06 4.7978e-07 3.4815e-07 2.2465e-07 2.6174e-07 1.3203e-07 6.3125e-08 2.3156e-07 1.5590e-07 2.8896e-07 2.7458e-07 1.3180e-07 2.1958e-07 3.8973e-07 2.1430e-07 1.2211e-07 3.2138e-07 2.0911e-07 1.9394e-07 4.5778e-08 6.7385e-07 8.1711e-07 5.5679e-07 1.9200e-07 4.5145e-07 1.7837e-07 7.9486e-08 6.4079e-08 1.0431e-06 3.2113e-07 1.3752e-07 9.5198e-08 6.7388e-08 4.4678e-07 4.6008e-07 7.7900e-07 2.8510e-07 7.1489e-07 5.7381e-07 6.2061e-07 2.5161e-07 4.6520e-08 1.1781e-06 3.4961e-08 9.1180e-08 5.3256e-08 1.0680e-07 1.2835e-07 1.5258e-07 6.5312e-08 1.5744e-07 1.5190e-07 8.5515e-08 5.4254e-08 4.0868e-08 7.0686e-09 9.3323e-09 6.9068e-08 4.9810e-06 2.8995e-08 6.1603e-07 9.8073e-07 5.8236e-07 5.3404e-07 2.7672e-06 1.7716e-06 3.9642e-07 1.6909e-07 1.0984e-06 2.0667e-07 7.0015e-07 2.0354e-07 5.0867e-07 3.8861e-07 4.7946e-07 1.0213e-06 5.0798e-07 8.0170e-07
  1.1134e-06 1.2369e-06 1.0628e-06 6.7835e-07 8.2085e-08 7.1871e-07 1.8288e-06
Lambda GC: 2.0007
Mean Chi^2: 3.8892
Intercept: 1.1651 (0.1597)
Ratio: 0.0572 (0.0553)
Analysis finished at Sun Apr 27 15:53:21 2025
Total time elapsed: 28.0m:15.27s

We can see that from the log:

  • Observed scale h2 = 0.0074 (0.0019)
  • lambda GC = 2.0007
  • intercept = 1.1651 (0.1597)
  • Ratio = 0.0572 (0.0553)

Run for all chromosomes

In your own time, you can use code below for running LDSC for genome-wide (all chromosomes) data if you download all the reference files in LDSC reference data

python ~/tools/ldsc/ldsc.py \
  --h2  Mono_count_hg38.sumstats.gz \
  --ref-ld-chr baselineLD_v2.2/baselineLD. \
  --w-ld-chr weights.hm3_noMHC. \
  --out Mono_count_hg38

Results provided below:

cat /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/Mono_count_hg38.log 
*********************************************************************
* LD Score Regression (LDSC)
* Version 1.0.1
* (C) 2014-2019 Brendan Bulik-Sullivan and Hilary Finucane
* Broad Institute of MIT and Harvard / MIT Department of Mathematics
* GNU General Public License v3
*********************************************************************
Call: 
./ldsc.py \
--h2 /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/Mono_count_hg38.sumstats.gz \
--ref-ld-chr /dartfs-hpc/rc/home/b/f005d5b/Zhao-labshare/liyang/enrichment/LDSCORE/baselineLD_v2.2/baselineLD. \
--out /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/Mono_count_hg38 \
--w-ld-chr /dartfs-hpc/rc/home/b/f005d5b/Zhao-labshare/liyang/enrichment/LDSCORE/weights/weights.hm3_noMHC. 

Beginning analysis at Sun Apr 27 14:20:50 2025
Reading summary statistics from /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/Mono_count_hg38.sumstats.gz ...
Read summary statistics for 30634245 SNPs.
Reading reference panel LD Score from /dartfs-hpc/rc/home/b/f005d5b/Zhao-labshare/liyang/enrichment/LDSCORE/baselineLD_v2.2/baselineLD.[1-22] ... (ldscore_fromlist)
Read reference panel LD Scores for 1189841 SNPs.
Removing partitioned LD Scores with zero variance.
Reading regression weight LD Score from /dartfs-hpc/rc/home/b/f005d5b/Zhao-labshare/liyang/enrichment/LDSCORE/weights/weights.hm3_noMHC.[1-22] ... (ldscore_fromlist)
Read regression weight LD Scores for 1186879 SNPs.
After merging with reference panel LD, 1188589 SNPs remain.
After merging with regression SNP LD, 1185627 SNPs remain.
Removed 445 SNPs with chi^2 > 408.112 (1185182 SNPs remain)
Total Observed scale h2: 0.2574 (0.0159)
Categories: baseL2_0 Coding_UCSCL2_0 Coding_UCSC.flanking.500L2_0 Conserved_LindbladTohL2_0 Conserved_LindbladToh.flanking.500L2_0 CTCF_HoffmanL2_0 CTCF_Hoffman.flanking.500L2_0 DGF_ENCODEL2_0 DGF_ENCODE.flanking.500L2_0 DHS_peaks_TrynkaL2_0 DHS_TrynkaL2_0 DHS_Trynka.flanking.500L2_0 Enhancer_AnderssonL2_0 Enhancer_Andersson.flanking.500L2_0 Enhancer_HoffmanL2_0 Enhancer_Hoffman.flanking.500L2_0 FetalDHS_TrynkaL2_0 FetalDHS_Trynka.flanking.500L2_0 H3K27ac_HniszL2_0 H3K27ac_Hnisz.flanking.500L2_0 H3K27ac_PGC2L2_0 H3K27ac_PGC2.flanking.500L2_0 H3K4me1_peaks_TrynkaL2_0 H3K4me1_TrynkaL2_0 H3K4me1_Trynka.flanking.500L2_0 H3K4me3_peaks_TrynkaL2_0 H3K4me3_TrynkaL2_0 H3K4me3_Trynka.flanking.500L2_0 H3K9ac_peaks_TrynkaL2_0 H3K9ac_TrynkaL2_0 H3K9ac_Trynka.flanking.500L2_0 Intron_UCSCL2_0 Intron_UCSC.flanking.500L2_0 PromoterFlanking_HoffmanL2_0 PromoterFlanking_Hoffman.flanking.500L2_0 Promoter_UCSCL2_0 Promoter_UCSC.flanking.500L2_0 Repressed_HoffmanL2_0 Repressed_Hoffman.flanking.500L2_0 SuperEnhancer_HniszL2_0 SuperEnhancer_Hnisz.flanking.500L2_0 TFBS_ENCODEL2_0 TFBS_ENCODE.flanking.500L2_0 Transcr_HoffmanL2_0 Transcr_Hoffman.flanking.500L2_0 TSS_HoffmanL2_0 TSS_Hoffman.flanking.500L2_0 UTR_3_UCSCL2_0 UTR_3_UCSC.flanking.500L2_0 UTR_5_UCSCL2_0 UTR_5_UCSC.flanking.500L2_0 WeakEnhancer_HoffmanL2_0 WeakEnhancer_Hoffman.flanking.500L2_0 GERP.NSL2_0 GERP.RSsup4L2_0 MAFbin1L2_0 MAFbin2L2_0 MAFbin3L2_0 MAFbin4L2_0 MAFbin5L2_0 MAFbin6L2_0 MAFbin7L2_0 MAFbin8L2_0 MAFbin9L2_0 MAFbin10L2_0 MAF_Adj_Predicted_Allele_AgeL2_0 MAF_Adj_LLD_AFRL2_0 Recomb_Rate_10kbL2_0 Nucleotide_Diversity_10kbL2_0 Backgrd_Selection_StatL2_0 CpG_Content_50kbL2_0 MAF_Adj_ASMCL2_0 GTEx_eQTL_MaxCPPL2_0 BLUEPRINT_H3K27acQTL_MaxCPPL2_0 BLUEPRINT_H3K4me1QTL_MaxCPPL2_0 BLUEPRINT_DNA_methylation_MaxCPPL2_0 synonymousL2_0 non_synonymousL2_0 Conserved_Vertebrate_phastCons46wayL2_0 Conserved_Vertebrate_phastCons46way.flanking.500L2_0 Conserved_Mammal_phastCons46wayL2_0 Conserved_Mammal_phastCons46way.flanking.500L2_0 Conserved_Primate_phastCons46wayL2_0 Conserved_Primate_phastCons46way.flanking.500L2_0 BivFlnkL2_0 BivFlnk.flanking.500L2_0 Human_Promoter_VillarL2_0 Human_Promoter_Villar.flanking.500L2_0 Human_Enhancer_VillarL2_0 Human_Enhancer_Villar.flanking.500L2_0 Ancient_Sequence_Age_Human_PromoterL2_0 Ancient_Sequence_Age_Human_Promoter.flanking.500L2_0 Ancient_Sequence_Age_Human_EnhancerL2_0 Ancient_Sequence_Age_Human_Enhancer.flanking.500L2_0 Human_Enhancer_Villar_Species_Enhancer_CountL2_0 Human_Promoter_Villar_ExACL2_0 Human_Promoter_Villar_ExAC.flanking.500L2_0
Observed scale h2: 1.2797e-01  2.7773e-02 -4.5203e-03  3.6582e-02 -1.1295e-01 -7.9712e-03  4.0467e-04  5.0313e-03  1.6805e-02  5.4963e-03 -3.0202e-02  4.1043e-02  1.7402e-02  2.3112e-02 -2.0062e-02  5.4607e-02  2.1640e-02  4.2660e-02  1.9745e-02  6.9722e-03  4.1841e-02 -3.7542e-02 -3.7763e-02  8.5987e-02 -7.1524e-02  1.5626e-02  2.1396e-02 -8.6625e-03 -2.2761e-02 -3.1777e-02 -6.5946e-02 -9.1766e-03  5.9464e-03 -6.5991e-03 -2.6980e-02 -6.6862e-03 -2.4428e-03 -6.6549e-03  5.7737e-03  1.7267e-02 -4.1922e-03  8.7301e-02 -8.3156e-02 -1.8393e-02 -8.6403e-04  1.8212e-02 -4.7901e-03 -1.0534e-02 -5.8838e-06 -5.5889e-03  1.2673e-02 -1.5369e-02 -2.1395e-04 -2.2530e-01  6.4378e-04  5.5866e-03  6.3506e-03  1.0380e-02  8.2919e-03  1.8632e-02  1.6436e-02  1.7150e-02  1.7590e-02  7.9529e-03  1.2978e-02  2.8151e-07 -1.6489e-04 -2.8042e-02 -3.4050e-02  1.9956e-02 -6.6887e-02  1.8827e-06  2.4813e-02  5.8495e-02  2.5090e-02  3.2445e-02 -1.0034e-02 -2.7002e-03  2.2781e-04 -6.8322e-02 -1.7847e-02  2.1216e-01  7.1977e-03
   3.7290e-02  3.0551e-03  3.1332e-03 -9.5377e-03  7.2993e-03  3.6585e-04  6.3576e-03  1.2736e-02  5.2156e-03  1.2111e-02  8.0392e-03  7.0568e-03  7.9565e-03  1.3130e-03
Observed scale h2 SE: 1.6769e-01 1.3693e-02 1.2285e-02 1.6832e-02 4.1713e-02 1.1168e-02 1.6097e-02 4.3713e-02 4.2247e-02 3.8371e-02 5.5436e-02 4.4683e-02 7.4833e-03 1.2995e-02 1.7321e-02 2.7353e-02 2.7082e-02 3.3057e-02 2.6461e-02 1.1570e-02 3.8123e-02 1.6488e-02 4.5700e-02 6.2294e-02 2.3300e-02 2.4450e-02 2.5333e-02 2.1681e-02 2.5690e-02 3.9189e-02 2.6003e-02 9.4607e-03 1.0077e-02 6.1109e-03 1.1053e-02 1.1445e-02 9.4437e-03 6.1840e-02 3.0815e-02 1.4164e-02 4.0188e-03 3.9225e-02 3.4118e-02 3.9022e-02 3.4066e-02 2.0707e-02 1.2090e-02 7.7295e-03 5.2599e-03 4.0415e-03 9.6524e-03 1.3876e-02 2.5145e-02 6.6393e-02 8.0902e-03 4.2482e-03 4.3181e-03 5.1451e-03 5.0400e-03 5.5095e-03 5.6896e-03 6.0757e-03 6.9226e-03 7.2741e-03 6.3133e-03 1.4275e-06 5.3955e-05 1.4163e-02 4.6421e-02 2.0611e-02 4.6419e-02 5.5217e-06 8.7500e-03 1.3957e-02 1.3440e-02 2.3490e-02 5.1224e-03 4.0364e-03 1.9056e-02 7.9643e-02 2.3587e-02 8.0702e-02 1.0563e-02 2.7718e-02 1.1881e-02 1.0482e-02 1.0751e-02 6.8098e-03 2.3108e-02 1.0183e-02
  5.2923e-03 6.8479e-03 5.7325e-03 8.7389e-03 7.0778e-03 3.3428e-03 2.0192e-03
Proportion of SNPs: 5.5430e-02  7.9001e-04  2.7360e-03  1.3681e-03  1.6940e-02  1.3193e-03  2.6024e-03  7.5032e-03  2.2331e-02  6.0963e-03  9.1889e-03  1.8297e-02  2.3906e-04  8.1514e-04  2.3241e-03  2.6538e-03  4.6392e-03  1.1060e-02  2.1562e-02  1.7415e-03  1.4881e-02  3.6927e-03  9.3623e-03  2.3475e-02  1.0101e-02  2.2924e-03  7.3640e-03  6.7696e-03  2.1167e-03  6.9457e-03  5.7909e-03  2.1482e-02  5.1743e-04  4.5872e-04  1.3794e-03  2.5654e-03  5.8631e-04  2.5500e-02  1.4325e-02  9.2676e-03  1.7575e-04  7.2588e-03  1.1644e-02  1.9136e-02  2.3100e-02  9.8684e-04  9.1591e-04  6.1864e-04  8.4575e-04  3.0205e-04  1.1831e-03  1.1589e-03  3.7590e-03  9.6777e-02  4.5202e-04  5.6756e-03  5.5372e-03  5.5223e-03  5.5822e-03  5.4494e-03  5.5220e-03  5.5275e-03  5.5546e-03  5.6029e-03  5.4568e-03 -2.5006e-06  1.5822e-04  8.6025e-02  2.5543e-01  9.8533e-03  5.5704e-04 -1.4787e-05  5.7274e-04  9.1686e-04  7.4113e-04  1.7585e-03  1.7292e-04  1.5036e-04  1.6311e-03  2.0929e-02  1.1887e-03  1.7619e-02  1.0686e-03
   8.6813e-03  7.5048e-04  9.7641e-04  8.4348e-04  1.9886e-04  1.8419e-03  5.4310e-04  2.3125e-04  2.9498e-04  2.8480e-04  5.0048e-04  3.6760e-03  1.3839e-04  3.1977e-05
Proportion of h2g: 4.9726e-01  1.0791e-01 -1.7564e-02  1.4215e-01 -4.3890e-01 -3.0973e-02  1.5724e-03  1.9550e-02  6.5299e-02  2.1357e-02 -1.1736e-01  1.5948e-01  6.7617e-02  8.9804e-02 -7.7952e-02  2.1218e-01  8.4086e-02  1.6576e-01  7.6720e-02  2.7091e-02  1.6258e-01 -1.4587e-01 -1.4673e-01  3.3411e-01 -2.7791e-01  6.0718e-02  8.3136e-02 -3.3659e-02 -8.8440e-02 -1.2347e-01 -2.5624e-01 -3.5657e-02  2.3105e-02 -2.5642e-02 -1.0484e-01 -2.5980e-02 -9.4917e-03 -2.5859e-02  2.2434e-02  6.7095e-02 -1.6289e-02  3.3922e-01 -3.2311e-01 -7.1467e-02 -3.3573e-03  7.0767e-02 -1.8613e-02 -4.0929e-02 -2.2862e-05 -2.1716e-02  4.9242e-02 -5.9718e-02 -8.3131e-04 -8.7544e-01  2.5015e-03  2.1707e-02  2.4676e-02  4.0332e-02  3.2219e-02  7.2399e-02  6.3863e-02  6.6637e-02  6.8349e-02  3.0902e-02  5.0429e-02  1.0938e-06 -6.4072e-04 -1.0896e-01 -1.3231e-01  7.7543e-02 -2.5990e-01  7.3156e-06  9.6415e-02  2.2729e-01  9.7491e-02  1.2607e-01 -3.8986e-02 -1.0492e-02  8.8520e-04 -2.6547e-01 -6.9347e-02  8.2436e-01  2.7968e-02
   1.4489e-01  1.1871e-02  1.2174e-02 -3.7060e-02  2.8362e-02  1.4216e-03  2.4703e-02  4.9488e-02  2.0266e-02  4.7060e-02  3.1237e-02  2.7420e-02  3.0916e-02  5.1018e-03
Enrichment: 8.9709e+00  1.3660e+02 -6.4195e+00  1.0390e+02 -2.5909e+01 -2.3477e+01  6.0420e-01  2.6055e+00  2.9241e+00  3.5032e+00 -1.2771e+01  8.7160e+00  2.8284e+02  1.1017e+02 -3.3541e+01  7.9953e+01  1.8125e+01  1.4987e+01  3.5581e+00  1.5557e+01  1.0925e+01 -3.9503e+01 -1.5673e+01  1.4233e+01 -2.7512e+01  2.6487e+01  1.1290e+01 -4.9721e+00 -4.1782e+01 -1.7777e+01 -4.4249e+01 -1.6599e+00  4.4654e+01 -5.5898e+01 -7.5998e+01 -1.0127e+01 -1.6189e+01 -1.0140e+00  1.5661e+00  7.2397e+00 -9.2683e+01  4.6732e+01 -2.7748e+01 -3.7347e+00 -1.4534e-01  7.1710e+01 -2.0321e+01 -6.6161e+01 -2.7032e-02 -7.1896e+01  4.1620e+01 -5.1529e+01 -2.2115e-01 -9.0459e+00  5.5339e+00  3.8247e+00  4.4564e+00  7.3035e+00  5.7718e+00  1.3286e+01  1.1565e+01  1.2056e+01  1.2305e+01  5.5154e+00  9.2416e+00 -4.3742e-01 -4.0495e+00 -1.2666e+00 -5.1799e-01  7.8698e+00 -4.6657e+02 -4.9473e-01  1.6834e+02  2.4790e+02  1.3154e+02  7.1692e+01 -2.2546e+02 -6.9776e+01  5.4269e-01 -1.2684e+01 -5.8336e+01  4.6789e+01  2.6171e+01
   1.6691e+01  1.5818e+01  1.2468e+01 -4.3937e+01  1.4262e+02  7.7180e-01  4.5486e+01  2.1400e+02  6.8703e+01  1.6524e+02  6.2414e+01  7.4593e+00  2.2340e+02  1.5954e+02
Coefficients: 2.1486e-08  3.2716e-07 -1.5375e-08  2.4885e-07 -6.2054e-08 -5.6229e-08  1.4471e-09  6.2405e-09  7.0036e-09  8.3905e-09 -3.0589e-08  2.0876e-08  6.7743e-07  2.6387e-07 -8.0334e-08  1.9150e-07  4.3411e-08  3.5896e-08  8.5220e-09  3.7259e-08  2.6168e-08 -9.4614e-08 -3.7538e-08  3.4089e-08 -6.5895e-08  6.3439e-08  2.7040e-08 -1.1909e-08 -1.0007e-07 -4.2578e-08 -1.0598e-07 -3.9755e-09  1.0695e-07 -1.3388e-07 -1.8202e-07 -2.4255e-08 -3.8774e-08 -2.4287e-09  3.7510e-09  1.7340e-08 -2.2198e-07  1.1193e-07 -6.6460e-08 -8.9450e-09 -3.4810e-10  1.7175e-07 -4.8672e-08 -1.5846e-07 -6.4744e-11 -1.7220e-07  9.9685e-08 -1.2342e-07 -5.2968e-10 -2.1666e-08  1.3254e-08  9.1605e-09  1.0674e-08  1.7493e-08  1.3824e-08  3.1820e-08  2.7700e-08  2.8874e-08  2.9472e-08  1.3210e-08  2.2134e-08 -1.0477e-09 -9.6990e-09 -3.0336e-09 -1.2406e-09  1.8849e-08 -1.1175e-06 -1.1849e-09  4.0319e-07  5.9374e-07  3.1506e-07  1.7171e-07 -5.3999e-07 -1.6712e-07  1.2998e-09 -3.0380e-08 -1.3972e-07  1.1207e-07  6.2683e-08
   3.9975e-08  3.7885e-08  2.9863e-08 -1.0523e-07  3.4160e-07  1.8485e-09  1.0894e-07  5.1256e-07  1.6455e-07  3.9577e-07  1.4949e-07  1.7866e-08  5.3507e-07  3.8213e-07
Coefficient SE: 2.8155e-08 1.6131e-07 4.1786e-08 1.1450e-07 2.2916e-08 7.8783e-08 5.7565e-08 5.4219e-08 1.7607e-08 5.8576e-08 5.6146e-08 2.2727e-08 2.9131e-07 1.4837e-07 6.9358e-08 9.5920e-08 5.4327e-08 2.7815e-08 1.1421e-08 6.1831e-08 2.3842e-08 4.1554e-08 4.5427e-08 2.4696e-08 2.1466e-08 9.9258e-08 3.2016e-08 2.9805e-08 1.1295e-07 5.2508e-08 4.1789e-08 4.0986e-09 1.8124e-07 1.2398e-07 7.4571e-08 4.1517e-08 1.4990e-07 2.2569e-08 2.0020e-08 1.4223e-08 2.1281e-07 5.0290e-08 2.7267e-08 1.8978e-08 1.3724e-08 1.9527e-07 1.2284e-07 1.1628e-07 5.7879e-08 1.2452e-07 7.5927e-08 1.1143e-07 6.2253e-08 6.3846e-09 1.6656e-07 6.9659e-09 7.2575e-09 8.6709e-09 8.4026e-09 9.4091e-09 9.5890e-09 1.0229e-08 1.1599e-08 1.2082e-08 1.0767e-08 5.3128e-09 3.1736e-09 1.5322e-09 1.6913e-09 1.9467e-08 7.7551e-07 3.4752e-09 1.4218e-07 1.4167e-07 1.6876e-07 1.2431e-07 2.7568e-07 2.4983e-07 1.0872e-07 3.5414e-08 1.8466e-07 4.2628e-08 9.1987e-08 2.9714e-08 1.4733e-07 9.9908e-08 1.1862e-07 3.1869e-07 1.1676e-07 1.7450e-07
  2.1299e-07 2.1605e-07 1.8732e-07 1.6250e-07 1.7919e-08 2.2480e-07 5.8766e-07
Lambda GC: 1.6946
Mean Chi^2: 2.9077
Intercept: 1.2096 (0.0343)
Ratio: 0.1099 (0.018)
Analysis finished at Sun Apr 27 14:49:14 2025
Total time elapsed: 28.0m:24.26s

We can see that from the log:

  • Observed scale h2 = 0.2574 (0.0159)
  • lambda GC = 1.6946
  • intercept = 1.2096 (0.0343)
  • Ratio = 0.1099 (0.018)

According to LDSC documents, Ratio measures the proportion of the inflation in the mean chi^2 that the LD Score regression intercept ascribes to causes other than polygenic heritability. The value of ratio should be close to zero, though in practice values of 10-20% are not uncommon.

\[ Ratio = {{intercept-1}\over{mean(\chi^2)-1}} \]

Distribution of h2 and intercept across traits in UKB

The Neale Lab estimated SNP heritability using LDSC across more than 4,000 primary GWAS in UKB. You can check the distributions of SNP heritability and intercept estimates using the following link to get the idea of what you can expect from LD score regression:

https://nealelab.github.io/UKBB_ldsc/viz_h2.html

Partitioned LD regression (S-LDSC)

Partitioned LD regression is utilized to evaluate the contribution of each functional group to the total SNP heriatbility.

\[ E[\chi^2] = N \sum\limits_C \tau_C l(j,C) + Na + 1 \]

  • \(C\) : functional categories

  • \(l(j,C)\) : LD score for SNP j with respect to C.

  • \(\tau_C\) : per-SNP contribution of category C to heritability

  • Reference: Finucane, Hilary K., et al. “Partitioning heritability by functional annotation using genome-wide association summary statistics.” Nature genetics 47.11 (2015): 1228-1235.

1. Create annotation file (.annot.gz)

## Step 1: Creating an annot file
chrom=22
ANNOT=ATAC
echo "Make ldsc-friendly annotation files for ${ANNOT}.bed"
python ~/tools/ldsc/make_annot.py \
--bed-file e2/ldsc/ATAC_annot_hg38.bed \
--bimfile /dartfs/rc/lab/S/Szhao/liyang/enrichment/LDSCORE/plink_files/1000G.EUR.hg38.$chrom.bim \
--annot-file ${ANNOT}.${chrom}.annot.gz

2. Compute LD scores with the annotation (.annot.gz) file

## Step 2: Computing LD scores with an annot file
echo "Computing LD scores with the annot file ${ANNOT}.${chrom}.annot.gz"
python ~/tools/ldsc/ldsc.py \
--l2 \
--bfile e2/ldsc/1000G.EUR.hg38.${chrom} \
--print-snps e2/ldsc/hm3_no_MHC.list.txt  \
--ld-wind-cm 1 \
--annot ${ANNOT}.${chrom}.annot.gz \
--thin-annot \
--out ${ANNOT}.${chrom}

3. Run S-LDSC

python ~/tools/ldsc/ldsc.py \
  --h2 Mono_count_hg38.sumstats.gz \
  --ref-ld ${ANNOT}.${chrom},e2/ldsc/baselineLD.${chrom} \
  --frqfile e2/ldsc/1000G.EUR.hg38.${chrom} \
  --w-ld e2/ldsc/weights.hm3_noMHC.${chrom} \
  --overlap-annot \
  --print-coefficients \
  --out Mono_count_hg38.chr${chrom}
*********************************************************************
* LD Score Regression (LDSC)
* Version 1.0.1
* (C) 2014-2019 Brendan Bulik-Sullivan and Hilary Finucane
* Broad Institute of MIT and Harvard / MIT Department of Mathematics
* GNU General Public License v3
*********************************************************************
Call: 
./ldsc.py \
--h2 /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/Mono_count_hg38.sumstats.gz \
--out /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/Mono_count_hg38.chr22 \
--overlap-annot  \
--frqfile /dartfs/rc/lab/S/Szhao/liyang/enrichment/LDSCORE/plink_files/1000G.EUR.hg38.22 \
--w-ld /dartfs/rc/lab/S/Szhao/liyang/enrichment/LDSCORE/weights/weights.hm3_noMHC.22 \
--print-coefficients  \
--ref-ld /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/ATAC.22,/dartfs-hpc/rc/home/b/f005d5b/Zhao-labshare/liyang/enrichment/LDSCORE/baselineLD_v2.2/baselineLD.22 

Beginning analysis at Sun Apr 27 15:58:25 2025
Reading summary statistics from /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/Mono_count_hg38.sumstats.gz ...
Read summary statistics for 30634245 SNPs.
Reading reference panel LD Score from /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/ATAC.22,/dartfs-hpc/rc/home/b/f005d5b/Zhao-labshare/liyang/enrichment/LDSCORE/baselineLD_v2.2/baselineLD.22 ... (ldscore_fromlist)
Read reference panel LD Scores for 17450 SNPs.
Removing partitioned LD Scores with zero variance.
Reading regression weight LD Score from /dartfs/rc/lab/S/Szhao/liyang/enrichment/LDSCORE/weights/weights.hm3_noMHC.22 ... (ldscore_fromlist)
Read regression weight LD Scores for 17450 SNPs.
After merging with reference panel LD, 17437 SNPs remain.
After merging with regression SNP LD, 17437 SNPs remain.
WARNING: number of SNPs less than 200k; this is almost always bad.
Removed 0 SNPs with chi^2 > 408.112 (17437 SNPs remain)
Total Observed scale h2: 0.0073 (0.0019)
Categories: L2_0 baseL2_1 Coding_UCSCL2_1 Coding_UCSC.flanking.500L2_1 Conserved_LindbladTohL2_1 Conserved_LindbladToh.flanking.500L2_1 CTCF_HoffmanL2_1 CTCF_Hoffman.flanking.500L2_1 DGF_ENCODEL2_1 DGF_ENCODE.flanking.500L2_1 DHS_peaks_TrynkaL2_1 DHS_TrynkaL2_1 DHS_Trynka.flanking.500L2_1 Enhancer_AnderssonL2_1 Enhancer_Andersson.flanking.500L2_1 Enhancer_HoffmanL2_1 Enhancer_Hoffman.flanking.500L2_1 FetalDHS_TrynkaL2_1 FetalDHS_Trynka.flanking.500L2_1 H3K27ac_HniszL2_1 H3K27ac_Hnisz.flanking.500L2_1 H3K27ac_PGC2L2_1 H3K27ac_PGC2.flanking.500L2_1 H3K4me1_peaks_TrynkaL2_1 H3K4me1_TrynkaL2_1 H3K4me1_Trynka.flanking.500L2_1 H3K4me3_peaks_TrynkaL2_1 H3K4me3_TrynkaL2_1 H3K4me3_Trynka.flanking.500L2_1 H3K9ac_peaks_TrynkaL2_1 H3K9ac_TrynkaL2_1 H3K9ac_Trynka.flanking.500L2_1 Intron_UCSCL2_1 Intron_UCSC.flanking.500L2_1 PromoterFlanking_HoffmanL2_1 PromoterFlanking_Hoffman.flanking.500L2_1 Promoter_UCSCL2_1 Promoter_UCSC.flanking.500L2_1 Repressed_HoffmanL2_1 Repressed_Hoffman.flanking.500L2_1 SuperEnhancer_HniszL2_1 SuperEnhancer_Hnisz.flanking.500L2_1 TFBS_ENCODEL2_1 TFBS_ENCODE.flanking.500L2_1 Transcr_HoffmanL2_1 Transcr_Hoffman.flanking.500L2_1 TSS_HoffmanL2_1 TSS_Hoffman.flanking.500L2_1 UTR_3_UCSCL2_1 UTR_3_UCSC.flanking.500L2_1 UTR_5_UCSCL2_1 UTR_5_UCSC.flanking.500L2_1 WeakEnhancer_HoffmanL2_1 WeakEnhancer_Hoffman.flanking.500L2_1 GERP.NSL2_1 GERP.RSsup4L2_1 MAFbin1L2_1 MAFbin2L2_1 MAFbin3L2_1 MAFbin4L2_1 MAFbin5L2_1 MAFbin6L2_1 MAFbin7L2_1 MAFbin8L2_1 MAFbin9L2_1 MAFbin10L2_1 MAF_Adj_Predicted_Allele_AgeL2_1 MAF_Adj_LLD_AFRL2_1 Recomb_Rate_10kbL2_1 Nucleotide_Diversity_10kbL2_1 Backgrd_Selection_StatL2_1 CpG_Content_50kbL2_1 MAF_Adj_ASMCL2_1 GTEx_eQTL_MaxCPPL2_1 BLUEPRINT_H3K27acQTL_MaxCPPL2_1 BLUEPRINT_H3K4me1QTL_MaxCPPL2_1 BLUEPRINT_DNA_methylation_MaxCPPL2_1 synonymousL2_1 non_synonymousL2_1 Conserved_Vertebrate_phastCons46wayL2_1 Conserved_Vertebrate_phastCons46way.flanking.500L2_1 Conserved_Mammal_phastCons46wayL2_1 Conserved_Mammal_phastCons46way.flanking.500L2_1 Conserved_Primate_phastCons46wayL2_1 Conserved_Primate_phastCons46way.flanking.500L2_1 BivFlnkL2_1 BivFlnk.flanking.500L2_1 Human_Promoter_VillarL2_1 Human_Promoter_Villar.flanking.500L2_1 Human_Enhancer_VillarL2_1 Human_Enhancer_Villar.flanking.500L2_1 Ancient_Sequence_Age_Human_PromoterL2_1 Ancient_Sequence_Age_Human_Promoter.flanking.500L2_1 Ancient_Sequence_Age_Human_EnhancerL2_1 Ancient_Sequence_Age_Human_Enhancer.flanking.500L2_1 Human_Enhancer_Villar_Species_Enhancer_CountL2_1 Human_Promoter_Villar_ExACL2_1 Human_Promoter_Villar_ExAC.flanking.500L2_1
Lambda GC: 2.0007
Mean Chi^2: 3.8892
Intercept: 1.1812 (0.1568)
Ratio: 0.0627 (0.0543)
Reading annot matrix from /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/ATAC.22,/dartfs-hpc/rc/home/b/f005d5b/Zhao-labshare/liyang/enrichment/LDSCORE/baselineLD_v2.2/baselineLD.22 ... (annot)
Results printed to /dartfs/rc/lab/S/Szhao/liyang/QBS-statsgen/data/Mono_count_hg38.chr22.results
Analysis finished at Sun Apr 27 16:24:12 2025
Total time elapsed: 25.0m:46.46s

The heritability estimate and intercept are reported in the .log file. You can extract key results in R:

log_lines <- readLines("output/Mono_count_hg38.chr22.log")
cat(grep("Total Observed scale h2|Intercept|Ratio|Lambda GC|Mean Chi", log_lines, value=TRUE), sep="\n")

Example output from chr22:

Total Observed scale h2: 0.0074 (0.0019)
Lambda GC: 2.0007
Mean Chi^2: 3.8892
Intercept: 1.1651 (0.1597)
Ratio: 0.0572 (0.0553)

The low ratio (0.057) indicates most inflation is due to polygenicity rather than confounding.

Extending LDSC

PolyFUN is a software that runs LDSC (python3) and performs functionally informed fine-mapping.

Reference

  • Bulik-Sullivan, Brendan K., et al. “LD Score regression distinguishes confounding from polygenicity in genome-wide association studies.” Nature genetics 47.3 (2015): 291-295.
  • Bulik-Sullivan, Brendan, et al. “An atlas of genetic correlations across human diseases and traits.” Nature genetics 47.11 (2015): 1236-1241.
  • Finucane, Hilary K., et al. “Partitioning heritability by functional annotation using genome-wide association summary statistics.” Nature genetics 47.11 (2015): 1228-1235.
  • Finucane, Hilary K., et al. “Heritability enrichment of specifically expressed genes identifies disease-relevant tissues and cell types.” Nature genetics 50.4 (2018): 621-629.
  • Kanai, Masahiro, et al. “Genetic analysis of quantitative traits in the Japanese population links cell types to complex human diseases.” Nature genetics 50.3 (2018): 390-400.

sessionInfo()
R version 4.3.2 (2023-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.6.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] data.table_1.18.2.1

loaded via a namespace (and not attached):
 [1] vctrs_0.7.2     cli_3.6.5       knitr_1.51      rlang_1.1.7    
 [5] xfun_0.52       stringi_1.8.7   otel_0.2.0      promises_1.5.0 
 [9] jsonlite_2.0.0  glue_1.8.0      workflowr_1.7.1 rprojroot_2.0.4
[13] git2r_0.36.2    htmltools_0.5.9 httpuv_1.6.15   sass_0.4.10    
[17] rmarkdown_2.30  tibble_3.3.1    evaluate_1.0.5  jquerylib_0.1.4
[21] fastmap_1.2.0   yaml_2.3.12     lifecycle_1.0.5 whisker_0.4.1  
[25] stringr_1.6.0   compiler_4.3.2  fs_1.6.6        pkgconfig_2.0.3
[29] Rcpp_1.1.1      later_1.4.8     digest_0.6.39   R6_2.6.1       
[33] pillar_1.11.1   magrittr_2.0.4  bslib_0.10.0    tools_4.3.2    
[37] cachem_1.1.0