Description Usage Arguments Details Value See Also Examples
Sample random profile pairs with given relationship (sibs, parent/offspring, etc.)
1 | sample.pairs(N = 1, type = "FS", freqs, markers = names(freqs))
|
N |
The number of pairs to be sampled (integer). |
type |
A character string giving the type of relative. Should be one of ibdprobs, e.g. "FS" (full sibling) or "PO" (parent/offspring) or "UN" (unrelated). |
freqs |
A list specifying the allelic frequencies. Should contain a vector of allelic frequencies for each locus, named after that locus. |
markers |
A character vector naming the markers of the resulting sample. Default to all markers of the |
The function randomly samples N pairs of DNA profiles according to the specified allelic frequencies. It returns two matrices containing profiles. The i'th profile in the first and the second matrix are sampled as relatives.
A list containing two integer matrices of class profiles
:
x1
An integer matrix with N profiles.
x2
An integer matrix with N profiles.
sample.profiles
, sample.relatives
,ki
,ibs.pairs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.