View source: R/profileSimIBD.R
profileSimIBD | R Documentation |
This function simulates genotypes for a set of markers conditional on a
specific underlying IBD pattern (typically produced with ibdsim()
).
profileSimIBD(
x,
ibdpattern,
ids = NULL,
markers = NULL,
seed = NULL,
verbose = TRUE
)
x |
A |
ibdpattern |
A |
ids |
A vector of ID labels. If NULL, extracted from |
markers |
A vector with names or indices of markers attached to |
seed |
An integer seed for the random number generator. |
verbose |
A logical, by default TRUE. |
It should be noted that the only random part of this function is the sampling of founder alleles for each marker. Given those, all other genotypes in the pedigree are determined by the underlying IBD pattern.
A copy of x
where marker genotypes have been simulated conditional
on ibdpattern
.
ibdsim()
, forrel::profileSim()
.
# Brother-sister pedigree
ped = nuclearPed(2, sex = 1:2)
# Alleles
als = letters[1:10]
### Autosomal simulation
x = ped |>
addMarker(alleles = als, chrom = 1, posMb = 20) |>
addMarker(alleles = als, chrom = 1, posMb = 50) |>
addMarker(alleles = als, chrom = 1, posMb = 70)
# Simulate the underlying IBD pattern in the pedigree
sim = ibdsim(x, map = uniformMap(M = 1, chrom = 1), seed = 123)
# Simulate genotypes for the sibs conditional on the given IBD pattern
profileSimIBD(x, sim, ids = 3:4, seed = 123)
# With a different seed
profileSimIBD(x, sim, ids = 3:4, seed = 124)
### X chromosomal simulation
y = ped |>
addMarker(alleles = als, chrom = "X", posMb = 1) |>
addMarker(alleles = als, chrom = "X", posMb = 50) |>
addMarker(alleles = als, chrom = "X", posMb = 100)
simy = ibdsim(y, map = loadMap("decode19", chrom = 23), seed = 11)
profileSimIBD(y, simy, seed = 12)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.