Learn R Programming

bnpsd (version 1.1.1)

rbnpsd-deprecated: Simulate random allele frequencies and genotypes from the BN-PSD admixture model

Description

Simulate random allele frequencies and genotypes from the BN-PSD admixture model

Usage

rbnpsd(Q, F, m, wantX = TRUE, wantP = TRUE, wantB = TRUE, wantPa = TRUE,
lowMem = FALSE, verbose = FALSE, noFixed = FALSE)

Arguments

Q

The \(n \times k\) matrix of admixture proportions

F

The length-\(k\) vector of intermediate subpopulation \(F_{ST}\) values

m

The number of loci to draw

wantX

If TRUE (default), calculates and includes the random genotype matrix in the return list

wantP

If TRUE (default), includes the random IAF matrix in the return list

wantB

If TRUE (default), includes the random intermediate pop allele freq matrix in the return list

wantPa

If TRUE (default), includes the random ancestral allele freq matrix in the return list

lowMem

If TRUE, uses a low-memory algorithm to raw genotypes without storing or returning the corresponding IAF matrix.

verbose

If TRUE, prints messages for every stage in the algorithm

noFixed

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).

Value

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.

See Also

bnpsd-deprecated