Converts a vector of kinship coefficients to "degrees of relationship", as
used by some software for relatedness inference (e.g. KING).
Usage
kin2deg(kin, unrelated = Inf)
Value
An integer vector of the same length as kin.
Arguments
kin
A vector of kinship coefficients, i.e., numbers in [0, 1].
unrelated
The conversion of unrelated individuals (kin = 0).
Mathematically this corresponds to degree = Inf, but in some situations
degree = NA or something else might be preferable.
Details
The implementation uses the conversion formula $$deg = round(-log2(kin) -
1).$$
The first degrees correspond to the following approximate kinship ranges:
[0.354, 1]: 0th degree (MZ twins or duplicates)
[0.177, 0.354): 1st degree (parent-offspring, full siblings)