Learn R Programming

qgg (version 1.1.6)

getSparseLD: Extract Sparse Linkage Disequilibrium (LD) Information

Description

Retrieves and formats linkage disequilibrium (LD) data from binary files based on a specified chromosome and LD threshold. It provides options for returning the data in sparse or dense format.

Usage

getSparseLD(
  Glist = NULL,
  chr = NULL,
  r2 = 0,
  onebased = FALSE,
  rsids = NULL,
  format = "sparse"
)

Value

If `format` is "sparse", a list with two components: `indices` and `values`. Each component is a list of length equal to the number of rsids in the specified chromosome. If `format` is "dense", a matrix with rows and columns named after the rsids is returned.

Arguments

Glist

A list containing details such as the LD file path, msize, rsids for LD.

chr

A numeric value representing the chromosome for which LD data is to be extracted.

r2

A numeric value specifying the LD threshold for extraction. Default is 0.

onebased

A logical value indicating whether indices are one-based (default) or zero-based.

rsids

A vector of rsids for which the LD data needs to be extracted in dense format. Default is NULL.

format

A character string specifying the format of the result, either "sparse" (default) or "dense".