ibd.length: Score IBD length.

Description Usage Arguments Details Value Examples

Description

ibd.length returns the total length of IBD segemnt between two haplotypes.

Usage

1
ibd.length(inher.hap1, inher.hap2, startpos = NULL, endpos = NULL)

Arguments

inher.hap1, inher.hap2

numeric matrix.

startpos, endpos

non-negative number.

Details

This function works with output from sim.recomb.

Value

A non-negative number representing the length of IBD segment in Haldane centiMorgan.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# a simple pedigree with sibling marriage
pedigree = as.character(rep(1, 5))
member = as.character(c(11, 12, 21, 22, 31))
sex = as.numeric(c(1, 2, 1, 2, 1))
father = as.character(c(NA, NA, 11, 11, 21))
mother = as.character(c(NA, NA, 12, 12, 22))
pedinfo = data.frame(pedigree, member, sex, father, mother, stringsAsFactors = FALSE)
inheritance = sim.recomb(pedinfo, 100)

# IBD length between the two haplotypes of inbred individual 31
ibd.length(inheritance[[9]], inheritance[[10]])

bowenwang7/r3 documentation built on May 17, 2019, 6:39 p.m.