Learn R Programming

bigsnpr (version 1.5.2)

snp_assocBGEN: Compute quick association statistics from BGEN files

Description

THIS FUNCTION WILL BE MODIFIED IN THE FUTURE.

Usage

snp_assocBGEN(
  bgenfiles,
  list_snp_id,
  y_row,
  ind_row,
  bgi_dir = dirname(bgenfiles),
  ncores = 1
)

Arguments

bgenfiles

Character vector of paths to files with extension ".bgen". The corresponding ".bgen.bgi" index files must exist.

list_snp_id

List (same length as the number of BGEN files) of character vector of SNP IDs to read. These should be in the form "<chr>_<pos>_<a1>_<a2>" (e.g. "1_88169_C_T" or "01_88169_C_T"). This function assumes that these IDs are uniquely identifying variants.

y_row

A vector corresponding to ind_row and representing the trait with which to compute correlations. Missing values in either ind_row or y_row are removed.

ind_row

A vector of the row indices (individuals) that are used. Missing values in either ind_row or y_row are removed. Make sure to use indices corresponding to your training set only.

bgi_dir

Directory of index files. Default is the same as bgenfiles.

ncores

Number of cores used. Default doesn't use parallelism. You may use nb_cores().

Value

A list of vectors of log10(p-values) corresponding to the statistic \(n \times r^2\), where r is the correlation of each variant with y_row.