sim_tetrad: Simulate recombination across a given number of meiosis...

Description Usage Arguments Value Author(s) See Also Examples

Description

This is a wrapper function of many other functions that simulates a given number of tetrads each with four haploid spores that are recombinants between two parents.

Usage

1
2
sim_tetrad(n.tetrads, scale, snps, p.assign, mu.rate, f.cross, f.convert,
  length.conversion, coverage, chr.name = "I")

Arguments

n.tetrads

An integer specifying the number of tetrads to simulate.

p.assign

a numeric between 0 and 1 (inclusive) that gives the probability of correct sequencing assignment. A value of 1 means that no sequencing error or ancestral polymorphism is to be simulated.

mu.rate

a numeric between 0 and 1 (inclusive) specifying the per snp mutation rate.

f.cross

a numeric between 0 and 1 (inclusive) giving the frequency of recombination events that result in crossing over. This is same as 1 minus the frequency of non-crossovers.

f.convert

a numeric between 0 and 1 (inclusive) that gives the frequency of gene conversion during recombination.

length.conversion

an integer specifying the mean (and variance) of a given gene conversion tract (in bps).

chr.name

a numeric or character value specifying the chromosome name (default to "I")

scale

either vector of length 1 specifying the genome-wide recombination rate (Morgans/bp) or a vector of length snps-1 specifying the recombination rate between all snps. In either case rates must be positive.

snps

a vector gving the locations of snps along a chromosome

r.index

a vector of length snps-1 specifying whether a recombination is to be simulated (1) or not (0) in between two adjacent snps.

Value

A data.frame of class tetrad. Each row contains the following information:

Author(s)

Tyler D. Hether

See Also

recombine, make_parents, simulate_coverage, recombine_index, id_hotspots

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Simulating 100 recombination events
set.seed(1234567)        # For reproducibility
n_tetrads <- 100         # number of tetrads (meiosis events)
l <- 50                  # number of snps to simulate
c <- 3e-05               # recombination rate between snps (Morgan/bp)
snps <- c(1:l)*2e4       # snps are evenly spaced 20kbp apart
p_a <- 0.97              # assignment probability
coverage <- 1            # mean coverage
# Now simulate
sim100 <- sim_tetrad(n.tetrads=n_tetrads, scale=c, snps=snps,
	p.assign=p_a, mu.rate=0, f.cross=0.8, f.convert=0.3,
	length.conversion=2e3, coverage=coverage)
sim100

tylerhether/fbgenotyper documentation built on May 3, 2019, 1:53 p.m.