Skip to contents

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.

Usage

# S4 method for class 'LdData,ANY,ANY,ANY'
x[i, j, ..., drop = TRUE]

Arguments

x

An LdData.

i, j, ...

Subscripts; any use is an error.

drop

Ignored.

Value

Nothing: this method always signals an error.

Functions

  • x = LdData[i = ANY, j = ANY, drop = ANY]: Refused. Subsetting would narrow the variants while correlation – variant-by-variant, and snpIdx, 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

correlation

A correlation matrix, a list of per-block matrices (block-diagonal LD), or NULL if genotypes are available and R should be computed on demand.

genotypeHandle

Where 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.

snpIdx

Integer 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).

blockMetadata

A GRanges of blocks or a data.frame with block boundary information.

nRef

Integer, reference panel sample size.

mixtureWeights

NULL when genotypeHandle is a single GenotypeHandle; a numeric vector of mixing proportions (one per panel, summing to 1) when genotypeHandle is a list of GenotypeHandles. Used by getCorrelation() to compute a weighted-average mixture LD matrix; required whenever genotypeHandle is a list and getCorrelation() will be called.