Skip to contents

Load and Process Linkage Disequilibrium (LD) Matrix

Usage

load_LD_matrix(LD_meta_file_path, region, extract_coordinates = NULL)

Arguments

LD_meta_file_path

path of LD_metadata, LD_metadata is a data frame specifying LD blocks with columns "chrom", "start", "end", and "path". "start" and "end" denote the positions of LD blocks. "path" is the path of each LD block, optionally including bim file paths.

region

A data frame specifying region of interest with columns "chrom", "start", and "end".

extract_coordinates

Optional data frame with columns "chrom" and "pos" for specific coordinates extraction.

Value

A list of processed LD matrices and associated variant data frames for region of interest. Each element of the list contains:

combined_LD_variants

A data frame merging selected variants within each LD block in bim file format with columns "chrom", "variants", "GD", "pos", "A1", and "A2".

combined_LD_matrix

The LD matrix for each region, with row and column names matching variant identifiers.

block_indices

A data frame tracking the indices of variants in the combined matrix by LD block, with columns "block_id", "start_idx", "end_idx", "chrom", "block_start", "block_end" to facilitate further partitioning if needed.