Extracts specific rows (based on ids or row numbers) and columns (based on rsids or column numbers) from a genotype matrix stored on disk. The extraction is based on provided arguments such as chromosome number, ids, rsids, etc. Genotypes can be optionally scaled and imputed.
Usage
getG(
Glist = NULL,
chr = NULL,
bedfiles = NULL,
bimfiles = NULL,
famfiles = NULL,
ids = NULL,
rsids = NULL,
rws = NULL,
cls = NULL,
impute = TRUE,
scale = FALSE
)
Arguments
- Glist
A list structure containing information about genotypes stored on disk.
- chr
An integer representing the chromosome for which the genotype matrix is to be extracted. It is required.
- bedfiles
A vector of filenames for the PLINK bed-file.
- bimfiles
A vector of filenames for the PLINK bim-file.
- famfiles
A vector of filenames for the PLINK fam-file.
- ids
A vector of individual IDs for whom the genotype data needs to be extracted.
- rsids
A vector of SNP identifiers for which the genotype data needs to be extracted.
- rws
A vector of row numbers to be extracted from the genotype matrix.
- cls
A vector of column numbers to be extracted from the genotype matrix.
- impute
A logical or integer. If TRUE, missing genotypes are replaced with their expected values (2 times the allele frequency). If set to an integer, missing values are replaced by that integer.
- scale
A logical. If TRUE, the genotype markers are scaled to have a mean of zero and variance of one.