af_snp: Allele frequencies for SNP

View source: R/af_snp.R

af_snpR Documentation

Allele frequencies for SNP

Description

Computes individual-specific allele frequencies for a single SNP.

Usage

af_snp(snp, LF, max_iter = 100, tol = 1e-10)

Arguments

snp

vector of 0's, 1's, and 2's

LF

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

max_iter

Maximum number of iterations for logistic regression

tol

Numerical tolerance for convergence of logistic regression

Value

vector of allele frequencies

See Also

af()

Examples

LF <- lfa(hgdp_subset, 4)
# pick one SNP only
snp <- hgdp_subset[ 1, ]
# allele frequency vector for that SNO only
allele_freqs_snp <- af_snp(snp, LF)

StoreyLab/lfa documentation built on March 7, 2024, 9:59 p.m.