af: Allele frequencies

Description Usage Arguments Details Value Examples

View source: R/af.R

Description

Compute matrix of individual-specific allele frequencies

Usage

1
af(X, LF, safety = FALSE)

Arguments

X

a matrix of SNP genotypes, i.e. an integer matrix of 0's, 1's, and 2's. Sparse matrices of class Matrix are not supported (yet).

LF

Matrix of logistic factors, with intercept. Pass in the return value from lfa!

safety

optional boolean to bypass checks on the genotype matrices, which require a non-trivial amount of computation.

Details

Computes the matrix of individual-specific allele frequencies, which has the same dimensions of the genotype matrix. Be warned that this function could use a ton of memory, as the return value is all doubles. It could be wise to pass only a selection of the SNPs in your genotype matrix to get an idea for memory usage. Use gc to check memory usage!

Value

Matrix of individual-specific allele frequencies.

Examples

1
2
LF = lfa(hgdp_subset, 4)
allele_freqs = af(hgdp_subset, LF)

lfa documentation built on Nov. 8, 2020, 7:30 p.m.

Related to af in lfa...