Converts PLINK genotype data to LD matrices and SNP info files, saves LD matrices as .RDS files and SNP info as .Rvar files

convert_geno_to_LD_matrix(
  region_info,
  genotype_files,
  varinfo_files,
  chrom = 1:22,
  outputdir = getwd(),
  outname = "",
  include_variance = TRUE,
  include_allele_freq = TRUE,
  show_progress_bar = TRUE,
  verbose = FALSE,
  logfile = NULL
)

Arguments

region_info

a data frame of region definitions, with columns: chrom, start, stop, and region_id.

genotype_files

Reference genotype files in PLINK binary genotype data in .pgen or .bed format.

varinfo_files

Reference variant information files in PLINK .pvar or .bim format. The output will use the genome positions in varinfo_files.

chrom

a vector of chromosomes to process genotype data.

outputdir

Output directory.

outname

Output filestem.

include_variance

If TRUE, include variance in .Rvar output

include_allele_freq

If TRUE, include allele frequency in .Rvar output

show_progress_bar

If TRUE, print progress bar.

verbose

If TRUE, print detail messages.

logfile

The log filename. If NULL, will print log info on screen.

Value

a data frame of region_metatable, with region definitions and filenames of LD matrices and variant information.