Learn R Programming

forrel (version 1.1.0)

checkPairwise: Check pedigree data for relationship errors

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

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.

See Also

IBDestimate()

Examples

Run this code
# NOT RUN {
### 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)

# }
# NOT RUN {
# 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)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab