S4 container for LD information. Stores either a pre-computed
correlation matrix or a GenotypeHandle (or list of handles for
mixture panels) for lazy genotype/correlation access.
An LdData is a GRanges over the variants it
covers – carrying A1, A2, variant_id and optionally allele_freq,
variance and n_nomiss as metadata columns – so length(),
seqnames() and start() answer directly, as they do for
LdScore and LdEigen. The correlation may
be NULL, in which case those ranges are the object's only record of which
variants it describes.
Functions
x = LdData[i = ANY, j = ANY, drop = ANY]: Refused. Subsetting would narrow the variants whilecorrelation– variant-by-variant, andsnpIdx, which indexes the reference panel – stayed as they were, leaving an LD matrix describing variants the object no longer has. Build the LdData over the variant set you want instead.
Slots
correlationA correlation matrix, a list of per-block matrices (block-diagonal LD), or NULL if genotypes are available and R should be computed on demand.
genotypeHandleWhere genotypes are read from: a genotype handle, a list of them (for mixture panels), a matrix of dosages already extracted and filtered, or NULL when only pre-computed R is available. Pass a genotype panel (see
readGenotypes) to the constructor and it is unwrapped to its handle.snpIdxInteger vector of 1-based SNP indices into the handle's
snpInfo. NULL when correlation is pre-computed, or when the source is a matrix (which is already the subset).blockMetadataA
GRangesof blocks or adata.framewith block boundary information.nRefInteger, reference panel sample size.
mixtureWeightsNULL when
genotypeHandleis a singleGenotypeHandle; a numeric vector of mixing proportions (one per panel, summing to 1) whengenotypeHandleis a list ofGenotypeHandles. Used bygetCorrelation()to compute a weighted-average mixture LD matrix; required whenevergenotypeHandleis a list andgetCorrelation()will be called.