Read {pgenlibr}R Documentation

Loads the variant_numth variant, and then fills buf with numeric dosages in [0, 2] indicating the dosages of the first ALT (or user-specified) allele for each sample, with missing values represented by NA.

Description

This function treats the data as diploid; divide by 2 to obtain haploid dosages.

Usage

Read(pgen, buf, variant_num, allele_num = 2L)

Arguments

pgen

Object returned by NewPgen().

buf

Buffer returned by Buf().

variant_num

Variant index (1-based).

allele_num

Allele index; 1 corresponds to REF, 2 to the first ALT allele, 3 to the second ALT allele if it exists, etc. Optional, defaults 2.

Value

No return value, called for buf-filling side-effect.


[Package pgenlibr version 0.3.7 Index]