x = nuclearPed(father = "fa", mother = "mo", children = "ch") |>
addMarker(name = "myMarker", ch = "b/c", afreq = c(a=0.2, b=0.3, c=0.5)) |>
setMutmod(model = "proportional", rate = 0.01)
# Mask
y = maskPed(x, seed = 1729)
# Unmask
z = unmaskPed(y$maskedPed, keys = y$keys)
stopifnot(identical(x, z))
# With stepwise model
x2 = x |>
addMarker(name = "mySTR", ch = "7.2/8.2",
alleles = c("7", "7.2", "8", "8.2")) |>
setMutmod(marker = 2, model = "stepwise", rate = 0.1, rate2 = 1e-6,
range = 0.1)
y2 = maskPed(x2, seed = 1729)
z2 = unmaskPed(y2$maskedPed, keys = y2$keys)
stopifnot(identical(x2, z2))
# Check likelihoods with pedprobr:
# stopifnot(setequal(likelihood(x2), likelihood(y2$maskedPed)))
Run the code above in your browser using DataLab