Learn R Programming

rres (version 1.1)

ibd.marker: Score IBD sharing at a list of marker positions.

Description

ibd.marker determines pairwise IBD sharing at marker positions.

Usage

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

Arguments

inheritance

list of numeric matrices.

marker

numeric vector.

ind1index, ind2index

positive integer, represents index of individual in pedigree.

relatedness

logical, determines coding of IBD information.

Value

A numeric vector of IBD sharing status at the list of marker positions.

Details

When only index of one individual is supplied, IBD sharing status at each marker 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 at each marker is either in relatedness (default) or lexicographical order of IBD state, where recoding can be done using recode.ibd.

Examples

Run this code
# NOT RUN {
# 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)
nsnp = 10
marker = sort(runif(nsnp, 0, 100))

# IBD at markers between the two haplotypes of the inbred individual
ibd.marker(inheritance, marker, 5)

# IBD at markers between the two full sibs, with different IBD coding
ibd.marker(inheritance, marker, 3, 4) # relatedness
ibd.marker(inheritance, marker, 3, 4, relatedness = FALSE) # lexicographical order of IBD state
# }

Run the code above in your browser using DataLab