Learn R Programming

paramlink (version 1.1-0)

examineKinships: Relatedness estimation

Description

The function IBDestimate estimates IBD coefficients (k0, k1, k2) for specified pairs of pedigree members, using maximum likelihood methods (imported from the maxLik package).

Checking for pedigree errors is conveniently done with the examineKinships function: This computes IBD coefficients for all pairs in the pedigree(s) and produces a color-coded plot where wrong relationships are easy to spot.

These functions work with SNP markers only.

Usage

examineKinships(x, who = "all", 
                interfam = c("founders", "none", "all"), 
                makeplot = T, 
                showRelationships = c("UN", "PO", "MZ", "S", "H,U,G", "FC", "SC"), 
                ...)

IBDestimate(g1, g2=NULL, dat, f=NULL, error=NULL, plot.action=2, pointcol=2, cex=1, ...)

Arguments

x

A linkdat object, or a list of such.

who

A character vector of one or more of the words "parents", "siblings", "grandparents", "cousins", "distant" and "unrelated". Two short forms are possible: "all" (all of the above) and "close" (all of the above except "distant" and "unrelated".)

interfam

A character; either "founders", "none" or "all", indicating which interfamiliar pairs of individuals should be included. Only relevant if x is a list of several linkdat objects.

makeplot

A logical.

showRelationships

A character vector passed on to the relationships argument of IBDtriangle.

g1, g2

The pairs of individuals for which IBD estimates should be computed. Several formats are possible. If g1 is a vector of ID labels, and g2 NULL, then all pairs among the g1 are included. If g2 is not NULL, only pairs intersecting both g1 and g2 are considered. Finally, g1 can be given as a matrix with two columns and each row indicating a pair.

If dat is a list of linkdat objects, then all ID labels must be characters of the form "X-Y", where X is the family ID, and Y the individual ID.

dat

Either a data frame (typically produced by paramlink:::.ibdPrep), a single linkdat object or a list of such.

f

A numeric vector containing the frequencies of the "2" allele. If NULL (default), this is computed from dat.

error

A single numeric to be used in error modelling, or NULL. See details.

plot.action

An integer: 2 = make new triangle and draw points; 1 = add points to existing triangle; 0 = no plotting.

pointcol

A single numeric or character: Color specification for the points in the plot.

cex

A single numeric: Point size. (See par)

Other arguments.

Value

A matrix (or a list of matrices) with 6 columns: ID1, ID2, N (#markers with no missing alleles), k0, k1, k2.

Details

Maximum likelihood estimation is done by the maxLik function in the maxLik package.

More to come here.

References

E.A. Thompson (2000): Statistical Inferences from Genetic Data on Pedigrees. NSF-CBMS Regional Conference Series in Probability and Statistics. Volume 6.

See Also

maxLik, linkdat, points

Examples

Run this code
# NOT RUN {
x = cousinsPed(2)
x = simpleSim(x, 1000, 1:2) # 1000 equifrequent SNPs
examineKinships(x, who=c("par", "sib"))

#dontrun
# comparing the founders with another unrelated person:
y = singleton(1, famid=2)
y = simpleSim(y, 1000, 1:2)
examineKinships(list(x, y), who="unrelated", interfam="founders")

# IBD estimates for the cousins (famid=1, iid=7 and 8) vs. 
# unrelated singleton (famid=2, iid=1):
ibd = IBDestimate(c("1-7", "1-8"), "2-1", list(x,y), error=0.005)
ibd

# }

Run the code above in your browser using DataLab