Learn R Programming

optiSel (version 2.0)

genecont: Calculates Genetic Contributions using Pedigrees.

Description

Calculates the genetic contributions each individual has from specified ancestors.

Usage

genecont(Pedig, from=NULL, to=NULL)

Arguments

Pedig

Data frame containing the pedigree, where the first columns are Indiv (Individual ID), Sire, and Dam.

from

Vector with ancestors whose contributions to the individuals should be calculated. By default, the contributions from all individuals will be calculated.

to

Vector with individuals for which the contributions from ancestors should be calculated. By default, the contributions are calculated for all individuals.

Value

Lower triangular matrix with genetic contributions for each pair of individuals. Column i contains the genetic contribution of ancestor i to all individuals.

Details

This function calculates genetic contributions of specified ancestors to each individual.

Examples

Run this code
# NOT RUN {
data(ExamplePed)
Pedig <- prePed(ExamplePed)
cont  <- genecont(Pedig)

plot(Pedig$Born, cont[,"276000803611144"], pch=18, ylim=c(0,1))
Pedig["276000803611144",]

#faster:
cont  <- genecont(Pedig, from="276000803611144")
head(cont)
plot(Pedig$Born, cont[,"276000803611144"], pch=18, ylim=c(0,1))
# }

Run the code above in your browser using DataLab