Description Usage Arguments Value Author(s) See Also Examples
This is a wrapper function of many other functions that simulates a given number of
haploids each recombinant between two parents. As the name implies, information of the all four
products are lost since spores are random. See sim_tetrad
if all four haploid recombinants
are desired.
1 2 | sim_en_masse(n.spores, scale, snps, p.assign, mu.rate, f.cross, f.convert,
length.conversion, coverage, chr.name = "I")
|
n.spores |
An integer specifying the number of spores 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 en.masse
. Each row contains the following information:
which contains three elements:
Spore The spore ID (1:length(n.spores))
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 5 haploid recombinants
set.seed(1234567) # For reproducibility
n_spores <- 5 # number of tetrads (meiosis events)
l <- 75 # number of snps to simulate
c <- 3.5e-05 # recombination rate between snps (Morgan/bp)
snps <- c(1:l)*1.3e4 # snps are evenly spaced 20kbp apart
p_a <- 0.95 # assignment probability
coverage <- 2.1 # mean coverage
# Now simulate
sim5 <- sim_en_masse(n.spores=n_spores, scale=c, snps=snps,
p.assign=p_a, mu.rate=0, f.cross=0.8, f.convert=0.3,
length.conversion=2e3, coverage=coverage)
sim5
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.