Skip to contents

This function constructs a genome-wide LD matrix by combining block-level eigen-decomposed LD components stored in a specified directory. Each LD block is reconstructed using eigenvectors (`U`) and eigenvalues (`lambda`) from `SBayesRC::readEig`, and re-ordered to match the SNP order in `GWAS_Locus`.

Usage

build_LD_matrix(GWAS_Locus, ldDir, snpinfo)

Arguments

GWAS_Locus

A data frame containing at least two columns:

Block

Character or integer ID indicating LD block assignment for each SNP.

SNP

SNP identifier, must be unique.

ldDir

A character string specifying the directory path that contains LD block eigen-decomposition files (compatible with `SBayesRC::readEig`).

snpinfo

A data frame with columns:

SNP

SNP identifier.

Block

Block ID corresponding to each SNP.

Used to match and order SNPs correctly within each block.

Value

A symmetric numeric matrix of dimension \(n_{SNP} \times n_{SNP}\), where each block on the diagonal corresponds to an LD submatrix for that block.