seqGet2bGeno: Get packed genotypes

View source: R/Methods.R

seqGet2bGenoR Documentation

Get packed genotypes

Description

Gets a RAW matrix of genotypes in a packed 2-bit format.

Usage

seqGet2bGeno(gdsfile, samp_by_var=TRUE, ext_nbyte=0L, verbose=FALSE)

Arguments

gdsfile

a SeqVarGDSClass object

samp_by_var

if TRUE, return a sample-by-variant matrix; otherwise, return a variant-by-sample matrix

ext_nbyte

additional ext_nbyte row(s) with missing genotypes

verbose

if TRUE, show progress information

Details

If samp_by_var=TRUE, the function returns a sample-by-variant RAW matrix (nrow = ceiling(# of samples / 4)); otherwise, it returns a variant-by-sample RAW matrix (nrow = ceiling(# of variants / 4)). The RAW matrix consists of a 2-bit array, with 0, 1 and 2 for dosage, and 3 for missing genotype.

Value

Return a RAW matrix.

Author(s)

Xiuwen Zheng

See Also

seqGetData

Examples

# open a GDS file
f <- seqOpen(seqExampleFileName("gds"))

str(seqGet2bGeno(f))

str(seqGet2bGeno(f, samp_by_var=FALSE))

# close the GDS file
seqClose(f)

zhengxwen/SeqArray documentation built on Nov. 19, 2024, 1:04 p.m.