Description Usage Arguments Details Value See Also Examples
Counts IBS alleles between profile pairs
1  ibs.pairs(x1, x2)

x1 
N profiles 
x2 
N profiles 
A profile consists of two alleles at each locus. When two profiles are compared at a locus, there can be 0, 1 or 2 alleles IBS (identical by state). The function compares two databases of profiles (x1
and x2
) and counts the number of IBS alleles between profile pairs. The function expects x1
and x2
to be of equal size.
Data frame with three columns, containing for each profile pair:
ibs
: the number of alleles IBS, ranges from 0 to 2*nloci
full.matches
: the number of loci for which 2 alleles are IBS, ranges from 0 to nloci
partial.matches
: the number of loci for which 1 allele is IBS, ranges from 0 to nloci
ibs.db
for comparing one profile against a db
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  ## Compare the number of IBS alleles of simulated parent/offspring pairs
## with simulated unrelated pairs
data(freqsNLsgmplus)
#sample PO pairs and UN pairs
po.pairs < sample.pairs(N=10^4,"PO",freqsNLsgmplus)
unr.pairs < sample.pairs(N=10^4,"UN",freqsNLsgmplus)
#count the IBS alleles
po.pairs.ibs < ibs.pairs(x1=po.pairs$x1,x2=po.pairs$x2)
unr.pairs.ibs < ibs.pairs(x1=unr.pairs$x1,x2=unr.pairs$x2)
#plot together in a histogram
hist(po.pairs.ibs$ibs,breaks=0:20,xlim=c(0,20),
col="#FF0000FF",main="PO pairs vs. UN pairs",xlab="IBS")
hist(unr.pairs.ibs$ibs,breaks=0:20,col="#0000FFBB",add=TRUE)
legend("topright",legend=c("PO","UN"),fill=c("red","blue"))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.