## monte-carlo simulation of number of IBS alleles for FS, PO and UN w.r.t a single case profile
data(freqsNLsgmplus)
#start with a single case profile
x <- sample.profiles(N=1,freqs=freqsNLsgmplus)
# sample siblings
x.fs <- sample.relatives(x,N=10^3,type="FS")
# sample parent/offspring
x.po <- sample.relatives(x,N=10^3,type="PO")
# sample unrelated profiles
x.unr <- sample.profiles(N=10^3,freqs=freqsNLsgmplus)
# make histograms of the number of ibs alleles
hist(ibs.db(x,x.fs)$ibs,xlim=c(0,20),main="FS",xlab="IBS")
hist(ibs.db(x,x.po)$ibs,xlim=c(0,20),main="PO",xlab="IBS")
hist(ibs.db(x,x.unr)$ibs,xlim=c(0,20),main="UN",xlab="IBS")
Run the code above in your browser using DataLab