Description Usage Arguments Details Value Author(s) See Also Examples
This function simulates recombination between two parent chromosomes generated from class
parent.genomes
.
1 2 | recombine(parents, r.index, mu.rate = 0, f.cross = 0.5, f.convert = 0,
length.conversion = 20)
|
parents |
an object of class |
r.index |
a vector of length |
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). |
This function simulates crossover events (with or without gene conversions)
and non-crossover events given the parental snps and location of recombination events.
First, parental chromosomes are duplicated into 2 pairs of sister chromatids. During this step
mutations occur at rate mu.rate
that switch parental alleles. Second, recombination is
simulated by systematically going down the length of the chromosome. At recombination points, idenitfied in r.index
,
two non-sister chromatids are picked at random. Third, a CO or NCO is simulated; this is done
at a frequency of f.cross or 1-f.cross, respectively. If a CO occurs, the genotypes of the 3'
end of the non-sister chromatids are simply switched. If a NCO occurs, no such switch takes place.
Note that is is impossible to detect NCO events without an associated gene conversion tract.
Following every CO or NCO event gene conversion is simulated at a rate of f.convert. During a
gene conversion, one of the two unpicked chromatids' genotypes are switched. The length of the
gene conversion tract is sampled from a poission distribution with mean (variance) of length.conversion.
Note that the gene conversion tract will stop at the end of the chromosme if necessary.
an object of class recombine
that contains the following data:
parents input data
r.index input data
m.rate input data
f.cross input data
f.convert input data
length.conversion input data
chromatids.mutated_snps a list giving the genotypes of 4 chromatids (two pairs of sister chromatids) following mutation
chromatids.recombined a list giving the genotypes of 4 chromatids following recombination
Tyler D. Hether
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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 <- 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)
recomb_sim
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.