geno1: Calculates P(G|H)

Description Usage Arguments Value Examples

View source: R/geno1.R

Description

The marker data for one individual at two markers is G = (a1/a2, b1/b2). H is a n by n matrix of haplotype probabilities

Usage

1
geno1(a1, a2, b1, b2, H)

Arguments

a1

First allele, first marker

a2

Second allele, first marker

b1

First allele, second marker

b2

Second allele, second marker

Value

P(G|H)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Below I go through some cases trying to figure out
# what the LD probabilities should be

p = q = c(0.1, 0.2, 0.3, 0.4)
# Checks when LE
H = p%o%q # Haplotype probs for LE

abs(geno1(1, 1, 1, 1, H) - p[1]^2*q[1]^2) < 1e-15
abs(geno1(1, 2, 3, 3, H) - 2*p[1]*p[2]*q[3]^2) < 1e-15
abs(geno1(1, 2, 3, 4, H) - 2*p[1]*p[2]*2*q[3]*q[4]) < 1e-15
abs(geno1(2, 2, 4, 4, H) - p[2]^2*q[4]^2) < 1e-15

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