Simulate random allele frequencies and genotypes from the BN-PSD admixture model
rbnpsd(Q, F, m, wantX = TRUE, wantP = TRUE, wantB = TRUE, wantPa = TRUE,
lowMem = FALSE, verbose = FALSE, noFixed = FALSE)
The \(n \times k\) matrix of admixture proportions
The length-\(k\) vector of intermediate subpopulation \(F_{ST}\) values
The number of loci to draw
If TRUE (default), calculates and includes the random genotype matrix in the return list
If TRUE (default), includes the random IAF matrix in the return list
If TRUE (default), includes the random intermediate pop allele freq matrix in the return list
If TRUE (default), includes the random ancestral allele freq matrix in the return list
If TRUE, uses a low-memory algorithm to raw genotypes without storing or returning the corresponding IAF matrix.
If TRUE, prints messages for every stage in the algorithm
If TRUE, returned matrix will not include any fixed loci (loci that happened to be fixed are drawn again, starting from the ancestral allele frequency, and checked iteratively until no fixed loci remain, so that the final number of loci is exactly \(m\) as specified).
A named list that includes the following random matrices: X=genotypes, P=IAFs, B=intermediate pop allele freqs, Pa=vector of ancestral allele frequencies. Items may be omitted depending on the values of wantX, wantP, wantB, or wantPa above.