Description Usage Arguments Details Value See Also Examples
View source: R/profileSimIBD.R
This function simulates genotypes for a set of markers, conditional on a specific underlying IBD pattern.
1 | profileSimIBD(x, ibdpattern, ids = NULL, markers = NULL, seed = NULL)
|
x |
A |
ibdpattern |
A |
ids |
A vector of ID labels. If NULL, all members of |
markers |
A vector with names or indices of markers attached to |
seed |
An integer seed for the random number generator. |
It should be noted that the only random part of this function is the selection of founder alleles for each marker. Given those, all other genotypes in the pedigree are determined by the underlying IBD pattern.
An object similar to x
. but with simulated genotypes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # A pedigree with two siblings
x = nuclearPed(2)
# Attach 3 linked markers on chromosome 1
pos = c(20, 50, 70) # marker positions in megabases
mlist = lapply(pos, function(i)
marker(x, alleles = letters[1:10], chrom = 1, posMb = i))
x = setMarkers(x, mlist)
# Simulate the underlying IBD pattern in the pedigree
s = ibdsim(x, 1, map = uniformMap(M = 1, chrom = 1), seed = 123)[[1]]
# Simulate genotypes for the sibs conditional on the given IBD pattern
profileSimIBD(x, s, ids = 3:4, seed = 123)
# With a different seed
profileSimIBD(x, s, ids = 3:4, seed = 124)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.