This function calculates LD scores for the specified chromosome(s) based on genotypic data provided in `Glist`. The LD score quantifies the amount of Linkage Disequilibrium at a given SNP.
ldscore(
Glist = NULL,
chr = NULL,
onebased = TRUE,
nbytes = 4,
cm = NULL,
kb = NULL
)
A list containing computed LD scores for each chromosome in the input.
A list structure with genotypic data stored, including positions (`pos`), map information (`map`), rsids for LD calculation (`rsidsLD`), and LD file locations (`ldfiles`).
A single chromosome or a vector of chromosomes for which LD scores need to be computed. Default is NULL, implying all chromosomes in `Glist` will be used.
Logical, if `TRUE`, the indexing of positions and other genomic information is 1-based. Default is `TRUE`.
The size (in bytes) of each numeric value to read from the binary LD files. Default is 4.
The threshold in centiMorgans for filtering LD values. Default is NULL.
The threshold in kilobases for filtering LD values. Default is NULL. If specified, it will be converted to base pairs internally.
The function computes the LD scores for each SNP by reading LD values from binary files stored in `Glist$ldfiles`. It can filter SNPs based on physical distance (`kb`) or genetic map distance (`cm`). If both `cm` and `kb` are NULL, all LD values are used in computation.