Learn R Programming

DNAprofiles (version 0.3.1)

ki: Computes Kinship Indices (KIs) for pairs of profiles

Description

Computes Kinship Indices (KIs) for pairs of profiles

Usage

ki(x1, x2, hyp.1, hyp.2 = "UN", freqs = get.freqs(x1), markers = intersect(get.markers(x1), get.markers(x2)), theta = 0, ret.per.marker = FALSE)

Arguments

x1
An integer matrix with $N$ profiles.
x2
An integer matrix with $N$ profiles.
hyp.1
A character vector giving the hypothesis in the numerator of the $KI$. Should be one of ibdprobs, e.g. "FS" (full sibling) or "PO" (parent/offspring) or "UN" (unrelated).
hyp.2
A character vector giving the hypothesis in the denominator of the $KI$. Should be one of ibdprobs, e.g. "FS" (full sibling) or "PO" (parent/offspring) or "UN" (unrelated). Defaults to "UN".
freqs
A list specifying the allelic frequencies. Should contain a vector of allelic frequencies for each marker, named after that marker.
markers
Character vector stating the markers to use in the KI computation. Defaults to the intersection of the markers of x1 and x2.
theta
Numeric value specifying the amount of background relatedness.
ret.per.marker
Logical. If TRUE, return a matrix of KIs, where the columns correspond to markers.

See Also

ibs.pairs

Examples

Run this code
data(freqsNLngm)
fr <- freqsNLngm
sibs1 <- sample.profiles(1e3,fr) # sample profiles
sibs2 <- sample.relatives(sibs1,1,type="FS",freqs=fr) #sample 1 sib for each profile
#compute ki for all pairs
ki(sibs1,sibs2,hyp.1="FS",hyp.2="UN")

Run the code above in your browser using DataLab