Learn R Programming

DNAprofiles (version 0.3.1)

ibs.pairwise.pr: Compute the probabilities that two profiles match a number of loci fully/partially

Description

When two profiles are compared, this function computes the expected number of loci that match fully or partially.

Usage

ibs.pairwise.pr(freqs1, freqs2 = freqs1, k = "UN")

Arguments

freqs1
List of allelic frequencies.
freqs2
List of allelic frequencies.
k
IBD-probabilities, passed on to ibdprobs. Defaults to "UN", i.e. unrelated.

Value

Matrix with the expected number of full/partial matches on 0,1,2,... loci for a comparison between two profiles.

Details

When all profiles in the database are compared pairwise, one can count the number of profiles that match fully/partially for each number of loci. Such a procedure is implemented as ibs.pairwise.db. The current function computes the probabilities that a single pair matches fully and partially at each possible number of loci. The two profiles can be assumed to originate from population with different allele frequencies (freqs1 and freqs2), might be related through and might both be inbred.

See Also

as.dbcompare

Examples

Run this code
data(freqsNLsgmplus)

# sample small db and make all pairwise comparisons

N <- 1e3
db <- sample.profiles(N=N,freqs=freqsNLsgmplus)

O <- ibs.pairwise.db(db)
E <- N*(N-1)/2*ibs.pairwise.pr(freqs1 = freqsNLsgmplus,freqs2 = freqsNLsgmplus)

O # observed
E # expected

Run the code above in your browser using DataLab