Description Usage Arguments Details Value Examples
ibd.segment
determines the starting and endping genetic positions of segments with different amount of pairwise IBD sharing.
1 | ibd.segment(inheritance, ind1index, ind2index = NULL, relatedness = TRUE)
|
inheritance |
list of numeric matrices. |
ind1index, ind2index |
positive integer, represents index of individual in pedigree. |
relatedness |
logical, determines coding of IBD information. |
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
.
A dataframe of three variables. ibd
represents IBD sharing status of a segment, and startpos
/endpos
represents starting/ending genetic position of the segment.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.