ReadAlleles {pgenlibr} | R Documentation |
Loads the variant_numth variant, and then fills acbuf with integer allele codes, where each column of the buffer corresponds to a sample. An allele code of 0 corresponds to the REF allele, 1 to the first ALT, 2 to the second ALT, etc. Missing hardcalls are represented by a pair of NA codes.
Description
This function treats the data as diploid. If it's really haploid, you may want to compare the two rows, and then treat samples where the allele codes differ as missing values.
Usage
ReadAlleles(pgen, acbuf, variant_num, phasepresent_buf = NULL)
Arguments
pgen |
Object returned by NewPgen(). |
acbuf |
Buffer returned by AlleleCodeBuf() or IntAlleleCodeBuf(). |
variant_num |
Variant index (1-based). |
phasepresent_buf |
Buffer returned by BoolBuf(). Optional; if provided, elements are set to true when the sample has known phase. Most of these values will be TRUE even when the raw data is unphased, because homozygous genotypes always have known phase. (Missing genotypes are considered to have unknown phase.) |
Value
No return value, called for acbuf-filling side-effect.
[Package pgenlibr version 0.3.7 Index]