likPO: Likelihood for parent offspring pair with mutation

Description Usage Arguments Details Examples

View source: R/likPO.R

Description

See Equation and p. 25-26 and Eq. (6.14) in Egeland, Kling, Mostad (2015)

Usage

1
likPO(p, M, AF, CH)

Arguments

p

Vector of allele frequencies

M

Mutation matrix

AF

Genotype of father

CH

Genotype of child

Details

Alleles are assumed to be integers 1,2 ...

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
### Example p. 26 Egeland, Kling, Mostad (2015)
# Function:
a = 1; b = 2; cc = 3; d = 4 # renumbered alleles compared to p. 26
AF = c(a, b); CH = c(cc, d)
pc = 0.25; pd = 0.097826; pa = 0.25; pb = 1- pa - pd - pc
p = c(pa, pb, pc, pd)
library(pedmut) # To make mutation matrix only
M = mutationMatrix(model = "proportional", alleles = 1:4,
                           afreq = p, rate = m)
l1 = likPO(p, M, AF, CH)

library(pedprobr)
PO = nuclearPed(father = "AF", children = "CH")
am = matrix(ncol = 2, c(1, 0, 3, 2, 0, 4))
rownames(am) = labels(PO)
la = list(afreq = p, alleles = 1:4, mutmod = "proportional",
          rate = m, name ="L1")
PO = setMarkers(PO,locusAttributes = la, alleleMatrix = am)
l2 = likelihood(PO,1)

abs(l1-l2) < 1e-15

thoree/inbred documentation built on March 28, 2021, 7:42 p.m.