data(toyped)
x = linkdat(toyped, model=1)
res = lod(x)
res_theta = lod(x, theta=c(0, 0.1, 0.2, 0.5))
res_max = lod(x, theta="max")
stopifnot(all(0.3 == round(c(res, res_theta['0',], res_max['LOD',]), 1)))
# bigger pedigree with several markers
data(dominant)
y = linkdat(dominant)
y = setModel(y, model=1, penetrances=c(.001, .9, .99))
lod(y, markers=305:310)
lod(y, markers=305:310, theta="max")
# Example with pedigree with loops:
data(twoloops)
z = linkdat(twoloops, model=2) # fully penetrant autosomal recessive model.
z = addMarker(z, 0, alleles=1:2, afreq=c(0.001, 0.999)) # add (empty) diallelic marker
z = modifyMarker(z, marker=1, ids=15:16, genotype=1) # make individuals 15 and 16 homozygous for the rare allele.
res1 = lod(z, loop_breakers=c(8,12))
z = modifyMarker(z, marker=1, ids=c(7,9,11,13), genotype=3, alleles=1:3, afreq=c(0.001, 0.499, 0.5)) # making the marker triallelic and adding some genotypes.
plot(z,1)
res2 = lod(z, loop_breakers=c(8,12))
z = modifyMarker(z, marker=1, alleles=1:4, afreq=c(0.001, 0.499, 0.25, 0.25))
res3 = lod(z, loop_breakers=c(8,12))
stopifnot(all(3 == round(c(res1,res2,res3), 1)))
Run the code above in your browser using DataLab