Fits a model with multiple SNPs simultaneously, accounting for LD between them.
Port of R GenomicSEM's multiSNP().
Arguments
- covstruc
LDSC result (named list with S, V, I, N, m components)
- SNPs
Data frame of SNP summary statistics (with beta, se, var columns per SNP)
- LD
LD correlation matrix between SNPs
- SNPSE
SNP SE override (default FALSE = auto, numeric = override)
- SNPlist
Optional SNP list to subset (character vector)
Examples
if (FALSE) { # \dontrun{
# `covstruc` from `ldsc()`, `SNPs` from `sumstats()` subset to the
# target SNPs, and `LD` from a reference panel (e.g. LDlinkR or PLINK).
result <- multiSNP(
covstruc = covstruc,
SNPs = snp_df, # data.frame with beta, se, var per SNP
LD = ld_matrix, # n_snps x n_snps correlation matrix
SNPSE = 0.0005
)
result$results
} # }