Learn R Programming

forrel (version 1.0.0)

kinshipLR: Likelihood ratios for kinship testing

Description

This function computes likelihood ratios (LRs) for a given a list of pedigrees with attached markers. The user must indicate which of the pedigrees is the 'reference', which will be used in the denominator in each LR.

Usage

kinshipLR(x, ref, markers)

Arguments

x

A list of pedigree alternatives. Each alternative should be either a single ped object or a list of such.

ref

A single integer, indicating the index (in the list x) of the reference alternative. This is used in the denominator of each LR.

markers

A vector of integers, indexing which markers should be included. If NULL (the default) all markers are used.

Value

A LRresultobject, which is essentially a list with entries

  • LRtotal : Total likelihood ratios

  • LRperMarker : Likelihood ratios for each marker

  • likelihoodsPerMarker : Likelihoods for each marker

  • time user system and elapsed time

See Also

LRpower(), pedtools::transferMarkers()

Examples

Run this code
# NOT RUN {
# Simulate 5 markers for a pair of full sibs
set.seed(123)
sibs = nuclearPed(children = c("A", "B"))
sibs = simpleSim(sibs, N = 5, alleles = 1:4, ids = c("A", "B"))

# Create two alternative hypotheses and transfer the simulated genotypes to them
halfsibs = relabel(halfSibPed(), old = 4:5, new = c("A", "B"))
halfsibs = transferMarkers(sibs, halfsibs)

unrel = list(singleton("A"), singleton("B"))
unrel = transferMarkers(sibs, unrel)

# Compute LR with 'unrelated' as reference
res = kinshipLR(list(sibs, halfsibs, unrel), ref = 3)
res

# Detailed results
res$LRperMarker
res$likelihoodsPerMarker
# }

Run the code above in your browser using DataLab