Learn R Programming

relSim (version 1.0.0)

breedFst: Breed a population with an approximate level of \(\theta\)(\(F_{ST}\))

Description

This function simulates a population with an approximate level of population substructure. This is achieved by subdividing a population into equal sized subpopulations and allowing them to breed within themselves for $$t = $$$$ \lceil{\frac{\log_e(1-\theta)}{\log\left(1-\frac{1}{2N_s}\right)}}\rceil$$ generations, where \(N_s\) is the number of individuals in each subpopulation. This will produce a population with an estimated coancestry coefficient approximately equal to \(\theta\)

Usage

breedFst(Freqs, theta = 0.01, N = 10000, ns = 10, DNAtools = FALSE)

Value

An object of class 'population' which is a list with the following elements

  • profiles - a vector of profiles where the level of inbreeding is approximately equal to \(\theta\)

  • nProfiles - the total number of individuals in the population

  • nSubpops - the number of sub-populations in the population

  • nLoci - the number of loci each individual is typed at

  • theta - the desired level of substructure in the population. The actual value will be near to this.

  • Freqs - a Freq object representing the ancestral frequencies of the population

Arguments

Freqs

A list with an element, freqs which contains a list of vectors, where each vector is a set of allele frequencies for a locus

theta

A desired level of inbreeding, where \(0 < \theta < 0.5\)

N

Total population size

ns

The number of subpopulations. \(N/n_s\) needs to be greater than 100

DNAtools

If TRUE then the profiles in the return population will be formatted as a data frame with an id column and two columns per locus.

Author

James M. Curran

Examples

Run this code

data(USCaucs)
pop = breedFst(USCaucs)

Run the code above in your browser using DataLab