checkPairwise: Check pedigree data for relationship errors

Description Usage Arguments Value Author(s) See Also Examples

View source: R/checkPairwise.R

Description

This function provides a convenient way to check for pedigree errors, given the available marker data. The function calls ibdEstimate() to estimate IBD coefficients for all pairs of typed pedigree members, and computes the likelihood ratio (LR) comparing each estimate to the coefficients implied by the pedigree. By default, the estimates are shown in a colour-coded plot where unlikely relationships are easy to spot.

Usage

1
checkPairwise(x, plot = TRUE, labels = FALSE, LRthreshold = 1000, ...)

Arguments

x

A ped object or a list of such.

plot

A logical (default: TRUE). If TRUE, a plot is produced, showing the IBD estimates in the IBD triangle.

labels

A logical (default: FALSE). If TRUE, labels are included in the IBD triangle plot.

LRthreshold

A positive number (default: 1000). IBD estimates whose LR exceed this, when compared to the coefficients implied by the pedigree, are encircled in the plot.

...

Further parameters passed on to ribd::ibdTriangle().

Value

A data frame containing both the estimated and pedigree-based IBD coefficients for each pair of typed individuals. The last column contains the likelihood ratio comparing the estimated coefficients to the pedigree-based ones.

Author(s)

Magnus Dehli Vigeland

See Also

ibdEstimate()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
### Example with realistic data

x = addSon(nuclearPed(nch = 2), parent = 4)
x = setMarkers(x, locus = NorwegianFrequencies)
x = profileSim(x, N = 1, seed = 1729)[[1]]

checkPairwise(x)

### Create sample swap between 1 and 3
als = getAlleles(x)
als[c(1,3), ] = als[c(3,1), ]
y = setAlleles(x, alleles = als)

checkPairwise(y)


# Combined plot of pedigree and IBD estimates
dev.new(height = 5, width = 8, noRStudioGD = TRUE)
layout(rbind(1:2), widths = 2:3)
plot(x, margins = c(4,2,4,2))
checkPairwise(x, labels = TRUE)

forrel documentation built on March 14, 2021, 1:06 a.m.