Description Usage Arguments Value Author(s) See Also Examples
This function populates simulated data of class recombine
with
read counts given a specified coverage and assignment probability.
1 | simulate_coverage(simdata, p.assign, coverage)
|
simdata |
an object of class |
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. |
coverage |
the mean (and variance) of sequencing read coverage to be simlated. |
an object of class simulated.coverage
providing the a list of simulated sequencing reads for
each parental type for each of the four haploid recombinants. There are four lists in the output – one for
each recombinant. Within each list the read counts for parent 0 and parent 1 are given as well as the snp locations
and given (simulated) states.
Tyler D. Hether
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | set.seed(1234567) # For reproducibility
l <- 50 # number of snps to simulate
c <- 3e-05 # recombination rate between snps (Morgan/bp)
snps <- c(1:l)*1e4 # snps are evenly spaced 10kbp apart
p_a <- 0.97 # assignment probability
coverage <- 1 # mean coverage
p <- make_parents(snps) # make the parents
#
# The recombination indeces are:
r_points <- recombine_index(scale=c, snps=snps)
#
# Now recombine the parents:
recomb_sim <- recombine(parents=p, r.index=r_points, mu.rate=1e-05,
f.cross=0.6, f.convert=0.2, length.conversion=15000)
# And finally simulated read coverage for each haploid recombinant
sim_cov <- simulate_coverage(simdata=recomb_sim,
p.assign=p_a, coverage=coverage)
sim_cov
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.