# 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)
Run the code above in your browser using DataLab