zeroIBD: Probability of zero IBD

View source: R/zeroIBD.R

zeroIBDR Documentation

Probability of zero IBD

Description

Estimate the probability of no IBD sharing in a pairwise relationship.

Usage

zeroIBD(sims, ids = NULL, threshold = 0, unit = "cm")

Arguments

sims

A list of genome simulations, as output by ibdsim().

ids

A vector with two ID labels. If NULL (default), these are deduced from the sims object.

threshold

A nonnegative number (default:0). Only IBD segments longer than this are included in the computation.

unit

The unit of measurement for threshold: Either "mb" or "cm" (default).

Value

A list with the following two entries:

  • zeroprob: The fraction of sims in which ids have no IBD sharing

  • stErr: The standard error of zeroprob

Examples

###
# The following example computes the probability of
# no IBD sharing between a pair of fourth cousins.
# We also show how the probability is affected by
# truncation, i.e., ignoring short segments.
###

# Define the pedigree
x = cousinPed(4)
cous = leaves(x)

# Simulate (increase N!)
s = ibdsim(x, N = 10)

# Probability of zero ibd segments. (By default all segs are used)
zeroIBD(s, ids = cous)

# Re-compute with nonzero threshold
zeroIBD(s, ids = cous, threshold = 1, unit = "cm")
zeroIBD(s, ids = cous, threshold = 1, unit = "mb")


ibdsim2 documentation built on Aug. 17, 2023, 5:17 p.m.