Skip to contents

This function merges a list of matrices or data frames by a shared identifier column, optionally aligning to a reference panel using allele QC procedures.

Usage

merge_sumstats_matrices(
  matrix_list,
  value_column,
  ref_panel = NULL,
  ld_meta_file = NULL,
  id_column = "variants",
  remove_any_missing = FALSE
)

Arguments

matrix_list

A named or unnamed list of data frames or matrices.

value_column

Character string. The name of the column containing values to extract (e.g., z-scores or betas).

ref_panel

Optional data frame. A reference panel for allele QC (must be compatible with `allele_qc`).

id_column

Character string. The name of the column identifying variant IDs. Default is `"variants"`.

remove_any_missing

Logical. If `TRUE`, rows with any missing values will be removed after merging.

Value

A data frame containing merged values, one column per dataset with suffix `_i`.

Examples

if (FALSE) { # \dontrun{
merged <- merge_matrices(list(df1, df2), value_column = "variants", ref_panel = ref_df)
} # }