ibd.segment: Score IBD sharing by segment.

Description Usage Arguments Details Value Examples

Description

ibd.segment determines the starting and endping genetic positions of segments with different amount of pairwise IBD sharing.

Usage

1
ibd.segment(inheritance, ind1index, ind2index = NULL, relatedness = TRUE)

Arguments

inheritance

list of numeric matrices.

ind1index, ind2index

positive integer, represents index of individual in pedigree.

relatedness

logical, determines coding of IBD information.

Details

When only index of one individual is supplied, IBD sharing status for each segment is coded as 0 (not IBD) or 1 (IBD) between the two haplotypes of the individual.

When indices of two individuals are supplied, IBD sharing status for each segment is either in relatedness (default) or lexicographical order of IBD state, where recoding can be done using recode.ibd.

Value

A dataframe of three variables. ibd represents IBD sharing status of a segment, and startpos/endpos represents starting/ending genetic position of the segment.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# 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 segments between the two haplotypes of the inbred individual
ibd.segment(inheritance, 5)

# IBD segments between the two full sibs
ibd.segment(inheritance, 3, 4) # relatedness
ibd.segment(inheritance, 3, 4, relatedness = FALSE) # lexicographical order of IBD state

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