Build Blockwise Linkage Disequilibrium (LD) Matrix
build_LD_matrix.RdThis 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`.
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.