afx | R Documentation |
Function afx
computes the allele frequency for a vector or matrix of X-chromosomal genotype counts or frequencies.
afx(x)
x |
a vector or matrix with X-chromosomal counts or compositions. |
Function afx
calculates the A allele frequency for the given order of X-chromosomal genotype counts (A,B,AA,AB,BB). The genotypes must be supplied this order. Use maf
to calculate the minor allele frequency and more flexible coding.
a vector with allele frequencies
Jan Graffelman (jan.graffelman@upc.edu)
maf
, af
#
# A simulated random X-chromosomal marker
#
X <- as.vector(rmultinom(1,100,c(0.3,0.2,0.1,0.15,0.25)))
X <- X/sum(X)
print(X)
print(afx(X))
#
#
#
rs5968922 <- c(A=392, B=212, AA=275, AB=296, BB=80)
afx(rs5968922)
#
#
#
y <- c(C=337, G=129, CC=277, CG=209, GG=48)
afx(y)
#
# Calculated allele frequencies (p) for a matrix of X-chromosomal genotype counts.
#
X <- HWData(nm=10,n=1000,x.linked=TRUE)
X
p <- afx(X)
p
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.