ibd.proportion: Score IBD proportion.

Description Usage Arguments Details Value Examples

Description

ibd.proportion returns the proportion of IBD sharing between two haplotypes of the same individual or two individuals.

Usage

1
2
ibd.proportion(inheritance, ind1index, ind2index = NULL, startpos = NULL,
  endpos = NULL)

Arguments

inheritance

list of matrices.

ind1index, ind2index

positive integer.

startpos, endpos

non-negative number.

Details

When only one individual index is supplied, ibd.proportion returns the realized inbreeding coefficient of the individual. When two individual indices are supplied, ibd.proportion returns the realized relatedness of the two individuals.

Value

A value between 0 and 1 representing the proportion of IBD segment.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 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)

# realized inbreeding of inbred child
get.pedindex(pedinfo, "31")
ibd.proportion(inheritance, 5)

# realized relatedness between individual 21 and 22 (parents of inbred child)
get.pedindex(pedinfo, c("21", "22"))
ibd.proportion(inheritance, 3, 4)

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