x = nuclearPed(father = "fa", mother = "mo", children = "child")
# An empty SNP with alleles "A" and "B"
marker(x, alleles = c("A", "B"))
# Creating and attaching to `x`
addMarker(x, alleles = c("A", "B"))
# Alleles/frequencies can be given jointly or separately
stopifnot(identical(
marker(x, afreq = c(A = 0.01, B = 0.99)),
marker(x, alleles = c("A", "B"), afreq = c(0.01, 0.99)),
))
# Genotypes can be assigned individually ...
addMarker(x, fa = "1/1", mo = "1/2")
# ... or using the `geno` vector (all members in order)
addMarker(x, geno = c("1/1", "1/2", NA))
# A marker with an "equal" mutation model
y = addMarker(x, alleles = 1:2, name = "M", mutmod = "equal", rate = 0.01)
mutmod(y, "M")
Run the code above in your browser using DataLab