An LdMatrix carries one LD correlation matrix together
with the variants it describes, and can stand wherever pecotmr takes an
LD reference (the ldReference of a summary-statistics collection,
raiss, the heritability builders). It is a
GRanges over those variants, in the order of the matrix's rows,
with metadata columns SNP (the variant id), A1 (the allele
whose dosage the correlations are signed by), A2 and, optionally,
AF (the frequency of A1).
The other kind of LD reference is a genotype panel (see
readGenotypes), which pecotmr reads from disk on demand. A
matrix carries no genotypes, so the steps that need them are not
available with one: the panel missingness filter, and RAiSS's
singular-value route (RAiSS falls back to the matrix itself). Steps that
need the panel's sample size or allele frequencies – MAF / MAC panel
filters, DENTIST, ldsc's unbiased \(r^2\), HDL – use nSamples
and AF when they are supplied and refuse otherwise.
Validity checks the matrix's shape and labels, that its diagonal is 1,
that its entries lie in \([-1, 1]\), and its symmetry on an evenly
spaced subset of entries. It does not check positive semi-definiteness,
which costs an eigendecomposition; run checkLd for that.
Slots
correlationThe correlation matrix, its dimnames the variant ids.
nSamplesInteger, the number of independent samples the LD is worth, or
NAwhen unknown. For one panel this is its sample size. For a mixture it is \(1 / \sum_k w_k^2 / n_k\), the size of a single panel whose LD would be as noisy.mixtureWeightsThe weights a mixture's components were combined with; empty for a single panel's LD.