Skip to contents

Converts the R-serialized (.rda) HDL reference panels to a plain-text directory format that the gsem Rust CLI can read. This is a one-time conversion step needed before running genomicsem hdl.

Usage

convert_hdl_panels(ld.path, out.path, verbose = TRUE)

Arguments

ld.path

Path to the HDL reference panel directory containing UKB_snp_counter_*.rda, UKB_snp_list_*.rda, and per-piece chr*.rda and chr*.bim files.

out.path

Path to the output directory for text-format files. Created if it does not exist.

verbose

Print progress messages (default TRUE).

Value

Invisibly returns the output directory path.

Details

The output directory will contain:

pieces.tsv

Tab-delimited index: chr, piece, n_snps

chr{N}.{P}.snps.tsv

Per-piece SNP data: SNP, A1, A2, LDsc

These files are read by genomicsem hdl --ld-path <out.path>.

Examples

if (FALSE) { # \dontrun{
# Download HDL reference panels (see HDL documentation)
# Then convert once:
convert_hdl_panels(
  ld.path = "path/to/UKB_LD_reference",
  out.path = "path/to/hdl_text_panels"
)

# Now use with gsem CLI:
# genomicsem hdl --traits t1.gz t2.gz --ld-path hdl_text_panels/ -o hdl.json
} # }