Learn R Programming

bnpsd (version 1.0.4)

rpiaf: Construct individual-specific allele frequency matrix

Description

Here \(m\) is the number of loci, \(n\) the number of individuals, and \(k\) the number of intermediate subpopulations. The \(m \times n\) Individual-specific Allele Frequency (IAF) matrix \(P\) is constructed from the \(m \times k\) intermediate subpopulation allele frequency matrix \(B\) and the \(n \times k\) admixture proportion matrix \(Q\) using $$P = B Q^T.$$

Usage

rpiaf(B, Q)

Arguments

B

The \(m \times k\) intermediate subpopulation allele frequency matrix

Q

The \(n \times k\) admixture proportion matrix

Value

The \(m \times n\) IAF matrix \(P\)

Examples

Run this code
# NOT RUN {
m <- 10 # number of loci
n <- 5 # number of individuals
k <- 2 # number of intermediate subpops
pAnc <- rpanc(m) # random vector of ancestral allele frequencies
F <- c(0.1, 0.3) # FST values for k=2 subpops
B <- rpint(pAnc, F) # matrix of intermediate subpop allele freqs
sigma <- 1 # dispersion parameter of intermediate subpops
Q <- q1d(n, k, sigma) # non-trivial admixture proportions
P <- rpiaf(B,Q)

# }

Run the code above in your browser using DataLab