Learn R Programming

DNAprofiles (version 0.3.1)

ibdprobs: IBD probabilities

Description

Returns the IBD probabilities for a pairwise relationship.

Usage

ibdprobs(x)

Arguments

x
A pairwise relationship (e.g. "FS" for full siblings), or a 3-vector of IDB-probabilities.

Value

Numeric of length 3 with the probabilities that 0, 1 or 2 alleles are identical by descent

Details

When a character vector is supplied, the function returns the IBD probabilities. The following pairwise relationships are supported:
  • "ID", identity/monozygotic twins
  • "FS", full siblings
  • "PO" alias "PC", parent/offspring
  • "HS", half siblings
  • "AV", uncle/nephew
  • "FC", first cousins
  • "SC", second cousins
  • "UN", unrelated

When a numeric vector is supplied (e.g. c(0,1,0)), the function checks the input for validity and returns the input; throws an error otherwise.

Examples

Run this code
identical(ibdprobs("PO"),ibdprobs(c(0,1,0))) #TRUE

Run the code above in your browser using DataLab