sim_founders: Simulate founders

View source: R/sim_founders.R

sim_foundersR Documentation

Simulate founders

Description

Simulates the SNP genotype states for a set of founders. This is a simple wrapper of simFounderSnps that allows for bi-parental populations

Usage

sim_founders(
  genome,
  n.str = c("2", "4", "8"),
  pat.freq,
  ignore.gen.model = FALSE
)

Arguments

genome

An object of class genome.

n.str

The number of founders (either 2, 4, or 8)

pat.freq

A vector of length n.str/2 + 1. Frequency of SNP genotype patterns in the founder, where the first vector element is the frequency of monoallelic genotypes (i.e. fixed), and the second element is the frequency of polymorphic genotypes. In the case of 4 or 8 founders, the second element is the frequency of SNPs unique to 1 founder, and the third element is the frequency of SNPs in 2 founders. In the case of 8 founders, the fourth element is the frequency of SNPs in 3 out of 8 founders, and the fifth element is the frequency of SNPs in 4 out of 8 founders.

Details

See simFounderSnps. SNPs are simulated to be linkage equilibrium.

Value

See simFounderSnps. A list of the same length as map, with each element being a matrix of 0's and 2's.

Examples

# Simulate a genome
n.mar  <- c(505, 505, 505)
len <- c(120, 130, 140)

genome <- sim_genome(len, n.mar)

# Simulate a quantitative trait influenced by 50 QTL
qtl.model <- matrix(NA, 50, 4)
genome <- sim_gen_model(genome = genome, qtl.model = qtl.model, 
                        add.dist = "geometric", max.qtl = 50)

# Simulate the founder genotypes
founder_geno <- sim_founders(genome)


neyhartj/qgsim documentation built on Nov. 11, 2023, 4:08 p.m.