completeness: Calculates Pedigree Completeness

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Calculates completeness of the pedigree for individuals and for groups of individuals in each ancestral generation.

Usage

1
completeness(Pedig, keep=NULL, maxd=50, by="Indiv")

Arguments

Pedig

Data frame containing the pedigree, where the first columns are Indiv (Individual ID), Sire, and Dam. More columns can be passed in the Pedig argument, in particular a column for grouping with the name defined by argument by.

keep

Vector with IDs of the individuals for which the completeness will be calculated, or a logical vector indicating the individuals. By default, all individuals are used.

maxd

Number of generations for which completeness should be calculated.

by

Name of a column in data frame Pedig. The completeness will be computed separately for each group defined by the column.

Details

The function computes the completeness of the pedigree for the specified individuals and for groups of individuals. It is the proportion of known ancestors in each generation. Generation 0 corresponds to the individual itself, so the completeness is always 1 in generation 0.

Value

Data frame with the following columns

Indiv (or 'by')

ID of the individual or level of the grouping factor,

Generation

Generation number,

Completeness

Completeness of the pedigree in the respective generation.

Author(s)

Robin Wellmann

References

Cazes P, Cazes MH. (1996) Comment mesurer la profondeur genealogique d'une ascendance? Population (French Ed) 51:117-140.

See Also

Another function for characterizing pedigree completeness is summary.Pedig.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#Computes the pedigree completeness of Hinterwald cattle 
#born between 2006 and 2007 in each ancestral generation.

data(PedigWithErrors)
Pedig <- prePed(PedigWithErrors)
compl <- completeness(Pedig, keep=Pedig$Born %in% (2006:2007), maxd=50, by="Indiv")
head(compl)

#Summary statistics can be computed directly from the pedigree:
Summary <- summary(Pedig, keep=Pedig$Born %in% (2006:2007))
head(Summary)

hist(Summary$PCI,        xlim=c(0,1),  main="Pedigree Completeness")
hist(Summary$Inbreeding, xlim=c(0,1),  main="Inbreeding")
hist(Summary$equiGen,    xlim=c(0,20), main="Number of Equivalent Complete Generations")
hist(Summary$fullGen,    xlim=c(0,20), main="Number of Fully Traced Generations")
hist(Summary$maxGen,     xlim=c(0,20), main="Number of Maximum Generations Traced")

compl <- completeness(Pedig, keep=Pedig$Born %in% (2006:2007), maxd=50, by="Sex")
head(compl)

## Not run: 
library("ggplot2")
ggplot(compl, aes(Generation, Completeness, col=Sex))+geom_line()

## End(Not run)

optiSel documentation built on May 1, 2019, 10:29 p.m.