data(toyped)
x = linkdat(toyped, model=1)
genoDistr(x, id=1)
m1 = rbind(c(1,1),c(1,0),c(0,0),c(0,0))
genoDistr(x, id=3, partialmarker=m1)
m2 = rbind(c(0,0),c(0,0),c("A","B"),c("A","B"))
genoDistr(x, id=1, partialmarker=m2)
# gives Mendelian error (correctly):
m3 = rbind(c(1,1),c(1,1),c(2,2),c(0,0))
genoDistr(x, id=4, partialmarker=m3)
# another example, the genotype distribution of an individual whose half cousin is homozygous for a rare allele.
y = halfCousinPed(degree=1)
y = setModel(y, 1, afreq=c(0.99, 0.01)) #autosomal model, allele frequencies for the marker set to 99% and 1%.
y = setMarkers(y, cbind(c(0,0,0,0,0,0,0,0,'b'), c(0,0,0,0,0,0,0,0,'b')))
plot(y, marker=1)
genoDistr(y, id=8, partialmarker=1)
# X-linked example
data(Xped)
z = linkdat(Xped, model=4) #X-linked recessive model
# create empty marker, and then give individuals 5 and 15 genotype AA:
z = setMarkers(z, matrix(0, ncol=2, nrow=15))
z = modifyMarker(z, id=c(5, 15), alleles=c('A', 'A'))
genoDistr(z, id=13, partialmarker=1) #results: A - 0.8; B - 0.2
genoDistr(z, id=13, partialmarker=1, t=0) #results: A - 0.667; B - 0.333
Run the code above in your browser using DataLab