Description Usage Arguments Value Author(s) See Also Examples
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.
1 2 | sim_tetrad(n.tetrads, scale, snps, p.assign, mu.rate, f.cross, f.convert,
length.conversion, coverage, chr.name = "I")
|
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") |
|
either vector of length 1 specifying the genome-wide recombination rate (Morgans/bp)
or a vector of length |
|
a vector gving the locations of snps along a chromosome |
r.index |
a vector of length |
A data.frame of class tetrad
. Each row contains the following information:
Tetrad The tetrad ID
Spore The spore ID (1:4)
Chr The chromosome name
Snp The snp location (in bps)
p0 The number of reads that mapped to parent 0
p1 The number of reads that mapped to parent 1
states_given The simulated states (0 or 1)
Tyler D. Hether
recombine
, make_parents
,
simulate_coverage
, recombine_index
, id_hotspots
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.