Learn R Programming

optiSel (version 2.0.9)

pedIBDorM: Calculates Kinships taking Allele Origin into Account

Description

Calculates the pedigree based probability of alleles to be IBD (identical by descent) or Migrant alleles: For each pair of individuals the probability is computed that two alleles taken at random are IBD or are migrant alleles.

Usage

pedIBDorM(Pedig, thisBreed=NA, keep.only=NULL, keep=keep.only)

Value

A list with the following components:

pedIBDorM

Matrix containing for individuals i and j the probability that two alleles chosen from the individuals are IBD or at least one of them is a migrant allele (only computed if 1 is in method)

pedIBDorMM

Matrix containing for individuals i and j the probability that two alleles chosen from the individuals are IBD or both are migrant alleles (only computed if 2 is in method)

Arguments

Pedig

Data frame containing the Pedigree. The data frame has columns (1) Individual, (2) Sire, (3) Dam, (4) Sex, and (5) Breed. Missing parents are coded as NA. Both parents must either be missing or present. If this is not the case use prePed.

thisBreed

Name of the breed in column (5) of the pedigree for which the kinships are to be computed.

keep

If keep is provided then kinships are computed only for these animals and their ancestors.

keep.only

If keep.only is provided then kinships are computed only for these animals.

Author

Robin Wellmann

Details

Computation of modified pedigree based kinship matrices taking allele origin into account.

A native founder is an individual with unkown parents belonging to thisBreed. A migrant is an individual with unkown parents not belonging to thisBreed.

Examples

Run this code
data(PedigWithErrors)
data(Phen)
keep  <- Phen$Indiv
Pedig <- prePed(PedigWithErrors, keep=keep, thisBreed="Hinterwaelder", lastNative=1970)
Kin   <- pedIBDorM(Pedig, thisBreed="Hinterwaelder", keep.only=keep)

mean(Kin$pedIBDorM)
#[1] 0.8201792
mean(Kin$pedIBDorMM)
#[1] 0.335358

Run the code above in your browser using DataLab