Learn R Programming

optiSel (version 0.9.1)

pedIBDatN: Calculates the Pedigree Based Kinship at Native Alleles

Description

Calculates the pedigree based probability of alleles to be IBD at Native alleles.

Usage

pedIBDatN(Pedig, thisBreed=NA, keep.only=NULL, keep=keep.only, nGen=NA)

Arguments

Pedig

Data frame containing the pedigree where the first 3 columns correspond to: Individual ID, Sire, and Dam. Additional columns include column Breed with breed names. Missing parents are coded as NA, 0, or "0".

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.

nGen

Number of generations taken into account for estimating the native effective size. The default means that the effective native effective size is not estimated.

Value

A list with the following components:

pedZ

matrix with pedZij = Bij = Probability that two alleles chosen from individuals i and j are IBD or at least one of them is a migrant allele.

pedN

matrix with pedNij = Probability that two alleles chosen from individuals i and j are both native alleles.

The list has class attribute "kinMatrices" and the additional attribute condProb.

Details

Calculates a list containing matrices needed to compute pedigree based kinships at native alleles, defined as the conditional probability that two randomly chosen alleles are IBD, given that both originate from native founders. A native founder is an individual with unkown parents belonging to thisBreed.

Examples

Run this code
# NOT RUN {
data(PedigWithErrors)
data(Phen)
keep  <- Phen$Indiv
Pedig <- prePed(PedigWithErrors, keep=keep, thisBreed="Hinterwaelder", lastNative=1970)
fD    <- pedIBDatN(Pedig, thisBreed="Hinterwaelder", keep.only=keep, nGen=6)

#Number of Migrant Founders: 237
#Number of Native  Founders: 150
#Individuals in Pedigree   : 1658
#Native Ne = 49.5 (estimated from 6 previous generations)
#Mean kinship of native alleles:  0.0777
# }

Run the code above in your browser using DataLab