expectedLR: Expected likelihood ratio

Description Usage Arguments Value Examples

View source: R/expectedLR.R

Description

This function computes the expected LR for a single marker, in a kinship test comparing two hypothesised relationships between a set of individuals. The true relationship may differ from both hypotheses. Some individuals may already be genotyped, while others are available for typing. The implementation uses oneMarkerDistribution() to find the joint genotype distribution for the available individuals, conditional on the known data, in each pedigree.

Usage

1
expectedLR(numeratorPed, denominatorPed, truePed = numeratorPed, ids, marker)

Arguments

numeratorPed

A ped object.

denominatorPed

A ped object.

truePed

A ped object.

ids

A vector of ID labels corresponding to untyped pedigree members. (These must be members of all three input pedigrees).

marker

either a marker object compatible with numeratorPed, or the name or index of a marker attached to numeratorPed.

Value

A positive number.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#---------
# Curious example showing that ELR may decrease
# by typing additional reference individuals
#---------

# Numerator ped
numPed = nuclearPed(father = "fa", mother = "mo", child = "ch")

# Denominator ped: fa, mo, ch are unrelated. Ugly hack!
denomPed = nuclearPed(father = "fa", mother = "mo", nch = 1)
denomPed = addChildren(denomPed, father = "ch", mother = "mo", nch = 1)

# Scenario 1: Only mother is typed; genotype 1/2
p = 0.9
m1 = marker(numPed, mo = 1:2, afreq = c("1" = p, "2" = 1-p))
expectedLR(numPed, denomPed, ids = "ch", marker = m1)

1/(8*p*(1-p)) + 1/2 # exact formula

# Scenario 2: Include father, with genotype 1/1
m2 = m1
genotype(m2, id = "fa") = c(1, 1)
expectedLR(numPed, denomPed, ids = "ch", marker = m2)

1/(8*p*(1-p)) + 1/(4*p^2) # exact formula

forrel documentation built on March 14, 2021, 1:06 a.m.