Skip to contents

Auto-detects PLINK2 (.pgen/.pvar[.zst]/.psam) or PLINK1 (.bed/.bim/.fam) format and loads genotype data accordingly. Returns a numeric dosage matrix.

Usage

load_genotype_region(
  genotype,
  region = NULL,
  keep_indel = TRUE,
  keep_variants_path = NULL
)

Arguments

genotype

Path to the genotype data file (without extension).

region

The target region in the format "chr:start-end".

keep_indel

Whether to keep indel SNPs.

keep_variants_path

Path to a file listing variants to keep.

Value

A numeric dosage matrix (rows=samples, cols=variants).